Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
Nginxでのデプロイ時のエラーについて |
https://teratail.com/questions/371567?rss=all
|
Nginxでのデプロイ時のエラーについて前提・実現したいこと自作のwebアプリケーションをNginxにデプロイしようとしたところ、正常に機能しないので解決したいです。 |
2021-11-30 04:07:42 |
海外TECH |
Ars Technica |
Here are the best Cyber Monday deals we’re seeing for less than $60 |
https://arstechnica.com/?p=1815697
|
cards |
2021-11-29 19:40:14 |
海外TECH |
MakeUseOf |
How to Track Downloads in Google Drive, Dropbox, and Box |
https://www.makeuseof.com/tag/how-to-track-downloads-in-google-drive-dropbox-and-box/
|
How to Track Downloads in Google Drive Dropbox and BoxIf you re sharing files through cloud hosting it can be useful to track when those files are downloaded and how often Here are three methods to do just that |
2021-11-29 19:30:12 |
海外TECH |
MakeUseOf |
How to Be Productive When Your Work Computer Is Also Your Personal Computer |
https://www.makeuseof.com/be-productive-when-work-computer-is-also-personal-computer/
|
How to Be Productive When Your Work Computer Is Also Your Personal ComputerIf your personal computer is the same as your work computer you might struggle to be productive Here are ways to help you get more done |
2021-11-29 19:30:12 |
海外TECH |
MakeUseOf |
Turtle Beach's Cyber Monday Gaming Event: Up to 60% Off Headsets and Bundles |
https://www.makeuseof.com/turtle-beach-cyber-monday-deals/
|
cyber |
2021-11-29 19:05:12 |
海外TECH |
MakeUseOf |
Make These Changes for an Eco-Friendlier 3D Print |
https://www.makeuseof.com/make-these-changes-for-an-eco-friendlier-3d-print/
|
useful |
2021-11-29 19:00:30 |
海外TECH |
DEV Community |
MongoDB $weeklyUpdate (November 22, 2021): Latest MongoDB Tutorials, Events, Podcasts, & Streams! |
https://dev.to/mongodb/mongodb-weeklyupdate-november-22-2021-latest-mongodb-tutorials-events-podcasts-streams-204i
|
MongoDB weeklyUpdate November Latest MongoDB Tutorials Events Podcasts amp Streams Hi everyone Welcome to MongoDB weeklyUpdate Here you ll find the latest developer tutorials upcoming official MongoDB events and get a heads up on our latest Twitch streams and podcast curated by Adrienne Tacke Enjoy Freshest Tutorials on DevHubWant to find the latest MongoDB tutorials and articles created for developers by developers Look no further than our DevHub Let s Give Your Realm Powered Ionic Web App the Native Treatment on iOS and Android Diego Freniche We can convert an existing Ionic React Web App that saves data in MongoDB Realm using Apollo GraphQL into an iOS and Android app Building an Autocomplete Form Element with Atlas Search and JavaScriptNic Raboy In this tutorial we re going to see how to create a simple web application that surfaces autocomplete suggestions to the user Migrate from Azure CosmosDB to MongoDB Atlas Using Apache KafkaRobert Walters In this blog post we will cover how to leverage Apache Kafka to move data from Azure CosmosDB Core Native API to MongoDB Atlas Create a REST API with Cloudflare Worker MongoDB Atlas amp RealmMaxime Beugnet Luke Edwards In this blog post we create a serverless REST API with a Cloudflare worker using the MongoDB Realm Web SDK and a MongoDB Atlas cluster to store the data Official MongoDB Events amp Community EventsAttend an official MongoDB event near you Chat with MongoDB experts learn something new meet other developers and win some swag Nov Dec Las Vegas MongoDB at AWS re Invent MongoDB on Twitch amp YouTubeWe stream tech tutorials live coding and talk to members of our community via Twitch and YouTube Sometimes we even stream twice a week Be sure to follow us on Twitch and subscribe to our YouTube channel to be notified of every stream Latest StreamFollow us on Twitch and subscribe to our YouTube channel so you never miss a stream Last Word on the MongoDB PodcastLatest EpisodeCatch up on past episodes Ep Matt Asay and Joe Drumgoole Life at Local LondonEp NextJS with Ado KukicEp Tech Conferences with Nancy Monaghan and Dorothy McClelland Not listening on Spotify We got you We re most likely on your favorite podcast network including Apple Podcasts PlayerFM Podtail and Listen Notes These weeklyUpdates are always posted to the MongoDB Community Forums first Sign up today to always get first dibs on these weeklyUpdates and other MongoDB announcements interact with the MongoDB community and help others solve MongoDB related issues |
2021-11-29 19:52:29 |
海外TECH |
DEV Community |
All we need to learn about GIT |
https://dev.to/maratahnjoroge/all-we-need-to-learn-about-git-3944
|
All we need to learn about GIT What is Verion Control Version control or source control is the practice of tracking and managing changes to software code Version control systems are software tools that help software teams manage changes to source code over time It keeps track of every modification to the code in a special kind of database If a mistake is made developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption to all team members Great version control systems facilitate a smooth and continuous flow of changes to the code rather than the frustrating and clumsy mechanism of file locking giving the green light to one developer at the expense of blocking the progress of others Version control software is an essential part of the every day of the modern software team s professional practices SIMPLE GIT COMMANDS EVERY DEVELOPER SHOULD LEARNGit is a free and open source version control system originally created by Linus Torvalds in Unlike older centralized version control systems such as SVN and CVS Git is distributed every developer has the full history of their code repository locally This makes the initial clone of the repository slower but subsequent operations such as commit blame diff merge and log dramatically faster It also has excellent support for branching merging and rewriting repository history which has lead to many innovative and powerful workflows and tools Pull requests are one such popular tool that allows teams to collaborate on Git branches and efficiently review each other s code Git is the most widely used version control system in the world today and is considered the modern standard for software development Note To understand this article visit Git to know more about it Git InitThe git init command is the first command that you will run on Git The git init command is used to create a new blank repository It is used to make an existing project a Git project Several Git commands run inside the repository but the init command can be run outside of the repository Creating the first repositoryA repository is a directory that contains all the project related data There can also be more than one project on a single repository git initThe above command will create an empty git repository Suppose we want to make a git repository on our desktop To do so open Git Bash on the desktop and run the above command Consider the below output The above command will initialize a git repository on the desktop Now we can create and add files on this repository for version control To create a file run the touch command as follows touch lt file name gt To add files to the repository run the git add command as follows git add lt file name gt Note To learn more about the git add command visit Git Add An empty repository git is added to my existing project If we want to start version controlling for existing files we have to track these files with the git add command followed by a commit We can list all the untracked files by git status command git statusConsider the below output In the above output the list of all untracked files is displayed by the git status command To learn more about the status command visit Git Status After tracking our files we can add our files using the git add command Git branch Branches are highly important in the git world By using branches several developers are able to work in parallel on the same project simultaneously We can use the git branch command for creating listing and deleting branches Creating a new branch git branch lt branch name gt This command creates a branch locally To push the new branch into the remote repository you need to use the following command Viewing branches git push u lt remote gt lt branch name gt Deleting a branch git branch d lt branch name gt To learn more about the git branch command visit Git Branch Git checkout This is also one of the most used Git commands To work in a branch first you need to switch to it We use git checkout mostly for switching from one branch to another We can also use it for checking out files and commits git checkout lt name of your branch gt There are some steps you need to follow for successfully switching between branches The changes in your current branch must be committed or stashed before you switchThe branch you want to check out should exist in your localThere is also a shortcut command that allows you to create and switch to a branch at the same time git checkout b lt name of your branch gt This command creates a new branch in your local b stands for the branch and checks the branch out to new right after it has been created To learn more about the git checkout command visit Git Checkout Git commit This is maybe the most used command of Git Once we reach a certain point in development we want to save our changes maybe after a specific task or issue Git commit is like setting a checkpoint in the development process which you can go back to later if needed We also need to write a short message to explain what we have developed or changed in the source code git commit m commit message To learn more about the git commit command visit Git Commit NB Git commit saves your changes only locally Git push After committing your changes the next thing you want to do is send your changes to the remote server Git push uploads your commits to the remote repository git push lt remote gt lt branch name gt However if your branch is newly created then you also need to upload the branch with the following command git push set upstream lt remote gt lt name of your branch gt orgit push u origin lt branch name gt To learn more about the git push command visit Git Push NB Git push only uploads changes that are committed Remember the more you use git the more comfortable you ll…git with it I couldn t resist |
2021-11-29 19:45:45 |
海外TECH |
DEV Community |
Build A Modern Product Notification System: For Engineers and Product |
https://dev.to/courier/build-a-modern-product-notification-system-for-engineers-and-product-10am
|
Build A Modern Product Notification System For Engineers and Product The Developer s guide To Building Notification SystemsPart User RequirementsPart Scalability amp ReliabilityPart Routing amp PreferencesHi I m Troy Goode the founder of Courier Today we re going to talk about building a modern product notification system This talk s really intended for engineers product managers anyone working for a product organization that needs to send notifications and messages to their users and maybe is thinking about where and how they need to be building that over the next months months months as their product and organization evolves By the end of this we re hoping to really give you enough to get started thinking about what improvements you might want to make to your notification infrastructure or what notifications you want to send that you re not sending today and how you should think about building and maintaining those systems moving forward We are putting together a white paper that ll be linked below So take a look at that if you want to dig into even more detail than what we cover in this discussion So when we think about a modern product notification system we need to think about what are the requirements right And what we re going to walk you through is a few of the ways we think about it when we work with our customers and what we hear about from our customers that may have already built their own product notification system before they met Courier Here s the way I normally like to break it down is between requirements that are for the development team Right The team that s building and maintaining these notifications and these messages and the requirements that are really for more of the product management team the design team the marketing team and support team those that maybe aren t directly responsible for building this infrastructure but who really rely on this infrastructure to power a lot of the activities and objectives that they re trying to achieve with their projects with the product User RequirementsWhen we think about the objectives and the requirements for development team three of them we re going to dig into deeper later on in this discussion That would be scale and reliability abstracting your channels and providers thinking about how do you route between the different kinds of channel and take into account the preferences of the recipient or user And how do you take all of the messages that are flowing through this infrastructure and put a layer of observability and analytics on top of it so you can know what is and is not working the way you would want it to In addition to that though and we won t go into these in as quite as much detail in this discussion but you should be thinking about what is the developer experience for other developers within the organization Because while some companies that we work with have a dedicated centralized notification infrastructure managed by a dedicated centralized comms team many many many more companies that we talk to don t and this infrastructure sometimes can be centralized sometimes not but the team is very typically distributed and different teams will need to interact with the infrastructure that you re building to solve different use cases They re essentially a customer they re an internal customer of yours so what should that experience look like You need to be thinking about the analytics needed by dev ops and other parts of the organization not just at the business level but also at the operational level How do you know when the messages are going out as expected When are they not When are they delayed Which of these investments are paying off and maybe you should double down on and which maybe aren t and maybe you should revisit and reconsider Last is and this is really kind of tied to that developer experience How do you set up good testing environments This is actually especially challenging for messaging infrastructure You want to be able to potentially run integration tests and you want to be able to run scale tests but how do you do this without accidentally sending messages to real people or significantly driving up costs with your downs stream service providers Thinking through how do you create an environment where a developer can test against their local changes How can they test within a staging environment pulling together a number of different possible poll requests and testing it all together to see that it s not going to impact production negatively Then of being able to do things like smoke tests and the actual non testing production sends from your live environment Managing Volume SpikesWhether you re sending messages a day or million messages a day you do need to think about scale and reliability Obviously scale becomes much harder as you go to larger and larger volumes but what we ve found is that even for companies with really small amounts of notification volume it s still harder to scale than you might think The reason why is because it tends to come in bursts Your notification volume doesn t really get spread out like peanut butter If you re sending messages a month that doesn t mean you re sending messages a day and you wouldn t then divide that by hours and by minutes Instead what you see is huge spikes from time to time and then long valleys Provider Constraints amp ErrorsWhen you re thinking about building your infrastructure you need to make sure that you re accounting for what your tallest spike may be And that s the spike on your side but you also need to be thinking about downstream impact because whatever channel you re using whether it be email or mobile push or Slack or SMS there are going to be constraints that your service provider implements as well How many messages can you send out over how long of a period of time You also need to be thinking about “Okay well if my spike exceeds the possible spike input for that provider I need to make sure that I m backing up those messages and robustly being able to trickle them through the downstream service provider at the rate that that service provider allows On the reliability side of things messaging is not perfect It s pretty common to see issues and failures When we re looking at email we have things like bounces incorrect email addresses also service outages for ESPs Long delays in things like getting delivery confirmation from the various ESPs not only at the send layer but at the receive layer On SMS you see a number of issues that can vary by region where you might see temporary outages in one region of the world While the rest of the regions are working fine ON things like push it s very common to not even be able to know “Did my message get successfully delivered You might see that the Apple push notification service accepted this message That doesn t mean that it ever showed up on a device for the user Across all of these different channels each has their own unique constraints around how do you know how well things are working and under what scenarios might they fail Retry InfrastructureYou need to be thinking about what happens when they fail One obvious thing to do is to make sure you have robust retry infrastructure in place so that as a message goes out if it fails for any reason you want to be able to requeue it and retry it If you do this make sure this will impact kind of the scalability requirements that you have because if a bunch of them start to fail let s say it s a general service outage of the downstream provider or let s say imagine your API key is wrong because somebody rotated it and forgot to go update it within your environment variables Well now you re going to see a ton of that volume basically get requeued and reprocessed and then fail and requeued and reprocessed This is where things like exponential back offs come into play I also think you should really think about things like determining whether a failure is retry able or not If it s an API key that s invalid honestly you probably shouldn t retry it It s unlikely to be resolved with a subsequent request I ve seen a few service providers where we get intermittent API key failures and so on Courier side we ve had to kind of add even more intelligence but I would say that that s an edge case More than likely you can say if the API key is bad you need to go that environment variable retrying it s not necessarily going to help But there are other failures that may very well be intermittent and that might be downstream at the carrier level where you are going to want to retry that If you have these retries in place if you have exponential back offs you need to be thinking about the time limit on them Retry for up to how long Up to hours Up to hours That can also really vary by the type of content you re trying to deliver Channel Provider FailoverYou probably don t want to deliver a password reset message hours later that would be weird Some messages maybe it s fine to deliver a few days even a week later Each of the kinds of messages that you re sending may have a different correct strategy for how long you re willing to retry these things Think about that and think about ways to instrument your platform to say “Okay for this kind of message here s going to be our retry policy For this one we re never going to retry it This is an important message It s got to go out but if it doesn t go out maybe it doesn t make sense to retry it I kind of think you probably wanted to retry at least a few times in a short time span but you might not be interested in retrying for more than a few minutes For others you might be fine with a really long retry policy with maybe less frequent retries during that life cycle so that it can have less impact on the scalability requirements of your system The other thing you can consider especially if you have multi channel infrastructure is when do you failover from one channel to another failure another channel Another thing you can consider is if you have multiple channels when do you failover from one channel to another Let s say that you were going to send me a mobile push message and for whatever reason you get a failure You know in this case that didn t go through Well you could retry it and maybe in some cases that would be something you d want to do but maybe in other cases what you should do is retry that message on a different channel This time send it to Troy via email or SMS instead of push That s channel failover You should also consider provider failover Let s say you re sending an email maybe SendGrid is your email service provider and for whatever reason the SendGrid account isn t working right now so you attempt to send the message it fails and you can see that this is not really worth retrying with SendGrid Again bad API key or a service adage on SendGrid s side Well now instead of failing over to a different channel do you instead failover and call Mailgun or Postmark A lot of times this is something that you really want to do at scale because you have a lot of messages going out to a lot of users and you don t necessarily want to get in that password reset example to send this message hours later You want to make sure that it goes out now and while you probably have a service provider that s your preferred well it s good to have a backup IdempotencyAs you think about things like retry logic well you also want to make sure that you re not resending the same notification to the same user This is unfortunately pretty easy to end up doing One of the things that you need to bake into a system is idempotency and idempotency just means a way to track which messages have been sent to which users Imagine that you were sending a batch of messages and notifications to different users and you re looping through this batch and halfway through processing it something fails Well you want to requeue and retry that batch Now you make it to user number and it fails again and you retry the whole thing again But what ends up happening here is you see the same user receiving the same notification many many times HBO Max recently had an issue with this Well what you want to do and what you want to bake into your infrastructure to prevent this is idempotency You want to be able to key each of these notifications that you re sending to an idempotency key similar to how Stripe does it so that you can make sure that each of those notifications can it s processed for each user only once Your infrastructure needs to be checking for this even if it s processing everything in one big batch that way you can safely retry not just individual messages but also huge batches of messages As you build out all of this infrastructure for retries for failovers for item potency the key things you re going to be wanting to measure are latency and in this regard we re really talking about from the time that you said “Send this message to Troy how long does it take for the infrastructure to attempt that send Time to first attempt Many things can happen after that where maybe the provider failed but that first bit that s your latency and you want to keep that as small as possible Well under a second The gold standard here is about milliseconds You also want to be checking things like “Well what is the deliverability rate I m getting for each of these providers and for each of the channels Now channels tend to be more of let s call it a performance optimization input You can know which channels are most effective but provider deliverability is more of a systems effectiveness measurement You will see significant differences in deliverability between different vendors and providers that you re using It s really critical to measure each of them so you can understand which one s working well for you and which one is not This is basically what then can drive towards the ceiling of what is possible for that channel You don t want to be artificially constrained by some limitations you might have placed on you by issues with the provider that you re using As you pull all of this data together around things like latency and deliverability start to come up with what you think for your own internal needs to be your SLO What is your service level objective What is the goal that you want to make sure that your team is consistently hitting to make sure that it s not negatively impacting the rest of the business Service Level ObjectivesOnce you ve identified your SLO then you want to be thinking about “Okay well what are the SLIs that help you measure that What are the service level indicators maybe you re using Datadog or some sort of other observability platforms “That I can look at to see what is the latency What is the request per second that we re able to process here What is the deliverability rate we re getting for each channel Look at those SLIs figure out a way to pull that together and report it out to the rest of your engineering team Maybe it s just your team maybe it s the entire department You can figure that out for what works best for your business but you have to make sure that you re constantly measuring this because it will just change over time even without you interacting with it Measuring it at just one point in time is not sufficient Make sure that you have processes in place to continuously measure this and compare it against your own internal objectives The Right Message at The Right Time to The Right User through The Right ChannelA few moments ago we were talking about failover When do you decide to failover between one channel and another or failover between one provider within a channel to another provider That s one form of routing Routing between channels routing between providers But routing is actually a broader concept that you should be thinking about as you design your modern product notification system Failover and reliability is one goal here but also things like well just making sure that the message is delivered to the user using the right channel at the right time Scheduling falls under the routing umbrella Do you deliver that message right now or do you wait until tomorrow morning business hours or maybe after work Figure out when you want to deliver this message and figure out based upon when it s being delivered well which channel s going to be most effective If you re a BB product delivering a message in the middle of the day perhaps Slack would be a great channel If you re a BC product delivering a message at PM well maybe mobile push is likely the best channel for that message That s kind of a naive take though because you can also take a lot of data about the user to help influence this For example let s say you have in app notifications a little toast that pops in from the corner of the screen or a desktop notification that appears in the corner of the operating system or even as a PWA notification on their mobile device Well maybe do you only want to send those if the user is currently online Same thing for Slack a Slack notification Do you want to send a message to the user in Slack if they re not currently logged into Slack Would you maybe instead reroute that message to email Take into account what you know about the user If you don t have their phone number you re not going to be sending an SMS so make sure that you are able to then reroute and redirect that notification to the channel that will be valid for them If you have other metadata about the user such as presence of are they online and which platform use that to help you understand which channel s going to be the best Use other context around what kind of use they are what kind of use case it is and what time of day it is in their time zone to help determine when and via which channel you should be delivering your messages Dynamic PreferencesOne last thing to think about when you re thinking about building routing across channels into your notification infrastructure is well does the user actually have a preference As much intelligence as you can add to dynamically switch between different channels a lot of times users might have their own opinion and being able to extend that opinion out via your app and ask them for their opinion via for example a preferences page is really important Let them turn off just the notifications they don t want to receive instead of everything Let them say “Hey for this notification I d rather receive it via SMS instead of email Maybe at some point you even consider things like letting them specify a different recipient Maybe say “Hey you know what I m going to be on vacation Please send this to my colleague instead of me or pause notifications for some time period instead of turning it off entirely “I m going on PTO don t send any more of these notifications for the next week As you think about this there s going to be differences between what preferences you re willing to let users set on some channels or on some kinds of notifications versus others Let s say you have password reset emails are not something you ever want somebody to unsubscribe from whereas the weekly newsletter you probably want them to unsubscribe from that without impacting some of your other more growth oriented messages Divide up the different kinds of notifications that you send Think about how you segment them and think about the different channel options that are applicable to the user for each of those notifications DigestsLastly think about potentially what we call digests which is pulling many many notifications together and instead of sending many many notifications out to the user do you aggregate them and send them out to the user in a batch If you think about LinkedIn for example Instead of receiving an email every time somebody asks to connect with you sometimes you ll receive a notification from LinkedIn saying five six people have asked to connect with you Do you start to batch and group things together and send out digests which will increase the value of that notification and decrease the annoyance factor Audit LogsWe ve talked a little bit about observability in analytics We talked about using SLIs to make sure that you re meeting your SLOs What else do you need to be pulling together Well the way I think about it is this Observability is really primarily geared towards support and engineering It s to make sure that a system is working the way you expect it to There are some performance indicators that would fall under this things like those SLIs but you also need to think about logs It s more challenging than I think any of us might wish it were When we think about channels and often this varies by both channel and provider if we think about really mature channels like email if you re a SendGrid customer you can log into the SendGrid account and get a pretty good snapshot of what emails you ve been sending to whom and what the impact was Did it land Did it bounce Did it get opened or clicked But as you look at other channels it starts to become something that you have less access to certainly via the actual provider Mobile push you typically need to layer another service on top of to get access to that data Things like Slack or WhatsApp you have very little to no visibility into without building custom infrastructure When you re sending this message how does the developer or in some cases support team look at what happened What happened as soon as the developer said “Send this notification to Troy what happened next How did the system decide which channel that was going to deliver that message to Troy What happened when it made that API call Did it fail Did it have to be retried If it s being retried when s it going to reattempt it and when will it be delivered Logging is really helpful for really looking at and debugging use cases in test and development but also in production when you do see things go wrong Make sure that that data s all being pulled together in some way whether you re putting it into your data warehouse and creating look at reports that give you direct logs access Those typically are not likely real time which makes it hard for certain debug scenarios Maybe instead put it in something like Datadog which is better for the engineer debugging scenario but maybe a little bit tougher for the support debug scenario Regardless make sure you re finding a way to pull that data those logs together in a place that both the engineering team and the support team can access Engagement amp UX OutcomesBeyond the observability side of things then we look at the analytics side of things and this is really the business outcome side of your notifications Is it driving the value that you re hoping for Is it creating engagement Is it creating the right experience If somebody s resetting their password or receiving a magic login SMS or email you want to make sure that s coming in fast and that people are actually clicking it You should see very few instances of people requesting password reset emails without them resetting their password You should see very few instances of people getting a FA token delivered via SMS without them then logging in and inserting that FA token You want to make sure that you re measuring for each of these use cases how many of these notifications are going out which channels are they going out via and what was the outcome Did it actually produce the intended effect You want to then look at this and you can start to see “Hey maybe the one provider works better than another or maybe “This channel isn t as effective as you were hoping it would be Pulling that data together and being able to look at it in aggregate by channel in aggregate by notification use case template for example looking at it by user cohort these are at ways you are going to want to slice and dice this data so that people in the product management team people in the engineering team people in the data team can look at that data and understand where does it make sense to continue to invest Where might there be problems and there be dragons Dig in deeper to figure out what needs to be fixed or improved Building a modern product notification system honestly it s pretty complicated but it s not impossible Most software companies have to do this at some point in their life cycle If you re just getting started probably just pick a single channel and a single provider and off you go If it s something like email or mobile push which usually most companies start with one of those two there are great platforms for both of those channels to get started with As you expand and grow your audience and maybe start to investigate additional channels or additional use cases that are more complex then usually need to start to think about investing in a broader ecosystem of infrastructure that can tie all of this together At scale you re probably going to want multiple providers for each channel In fact if one of your channels is mobile push you re going to need that more or less from the beginning because you ve got the Apple ecosystem and the Android ecosystem you re probably going to need to service both Start to think about even from the very beginning how do you abstract away these different channels these different providers How do you pull together all of this data create observability create analytics that can be consumed by your team and the rest of the organization Hopefully this video gave you enough to get a feel for what parts of a modern product notification system are applicable to you today versus what might make sense down the road For whatever parts are applicable to today we ve produced a white paper that digs into even more detail We d love to have you download it and check it out looking for feedback if you have any Are there other parts of building a modern product notification system we haven t really talked about that you d love to hear how we do it or how we see other customers building We also have a Discord server and would love to have you join us there We re all hanging out Would love to chat with you and geek out around notifications if this is something you re working on Please stop by and say hi Thank you |
2021-11-29 19:39:23 |
海外TECH |
DEV Community |
Top 5 decentralized app development frameworks |
https://dev.to/logrocket/top-5-decentralized-app-development-frameworks-42g
|
Top decentralized app development frameworksWritten by Victor Jonah ️With the recent rise of decentralized applications or DApps frameworks created specifically to ease DApp development have become more common Like frameworks for frontend developers DApp frameworks are pieces of code written to build software which helps make building applications for blockchain easier While using a framework is not necessary it does help develop software better and faster In this article we will compare a few popular frameworks that are generally used by blockchain engineers and look at their benefits disadvantages and networks including Hardhat Truffle Embark Brownie OpenZeppelinBut before we get into this let s discuss the types of DApps are available What are DApps Decentralized applications DApps provide a new way to interact with web applications You may have heard that “blockchain is the future or “the future is decentralized this mentality permeates through the quick releases of new blockchain based technologies meaning developers can access reliable frameworks The DApps that are based on blockchain technology run on a peer to peer PP network of several computers or servers rather than a traditional central server These applications are built on the concept of smart contracts and the consensus process or mechanism This means when an application is decentralized it is first created with underlying blockchain technology pushed to a preferred blockchain network Remember that a blockchain network is a collection of several thousands of computers identified as nodes or servers each owned by a person Each node server and computer then becomes a distributed database meaning every other server has a copy of the same data With all this in mind a few benefits of building a DApp is that they do not have any downtime because they do not have a central server They are also not prone to cyber attacks and cannot be shut down because there is no central server and all the servers are distributed If one distributed server is attacked others become aware It is also open source making it transparent and open to developers In summary a DApp does not bank on a traditional central server or service provider like Google Cloud Heroku or Digital Ocean Rather its deployment to the blockchain makes it transparent with no central location to store data and no third party control Types of DAppsThe different types of DApps available are often seen through the different sectors of blockchain technology solutions a DApp is built to solve For example the first ever DApp built was on the Ethereum blockchain Similarly the main reason Bitcoin was built was to remove the financial middleman that is the bank from the process of currency transfers With Bitcoin money transfers can be PP without using a bank Like Bitcoin there are many other sectors where DApps play a deliberate role Decentralized finance DeFi Decentralized finance or DeFi is a term given to financial services that use decentralized money like Bitcoin or Ethereum to perform operations Traditionally we have financial services that operate using a central authority like banks and governments including financial services such as providing loans savings plans and insurance However many saw having a central authority perform these financial operations as risky because of fraud corruption and mismanagement This gave birth to DeFi Building a DeFi application requires choosing the platform this includes Ethereum Solana Binance Smart contracts and many more DeFi s main focus is to remove the middleman while offering transparency and decentralization DeFi apps are used in decentralized exchange insurance and loan services with apps like Pancackeswap and inch Decentralized autonomous organization DAO A decentralized autonomous organization or DAO is an organization that operates fully through code smart contracts These organizations operate on the rules given to them and then operate solely on those terms So a DAO can run a company without the help of human activity with the decentralized board creating rules for the DAO to run on meaning there is no need for repetitive board meetings A possible example of a DAO is a driverless taxi company In this example we could have a DAO Lyft or DAO Uber that operates entirely on a collection of smart contracts deployed on any blockchain This would streamline operations like where to send profits like how MakerDao operates when and where to send the taxis when to refuel the cars and more Merchandise managementA merchandise management DApp is most often associated with supply chain processes and systems The traditional supply chain does not provide insight or transparency to products meaning we don t always know what a product is truly made of or where it comes from With blockchain in the supply chain however product traceability is available you can trace where products come from because data stored in the blockchain is decentralized An example of this is GX Blocks Comparing DApp frameworksLet s now look at the most common frameworks for building DApps HardhatHardhat is a framework for building smart contracts that offers a development environment for professionals This development environment lets users compile run tests check smart contracts for mistakes or debugging and deploy decentralized applications Hardhat installationTo install Hardhat ensure you have Node js installed on your computer Then initialize a project with npm init y and run the following command below npm install D hardhatIf installed properly execute Hardhat with this command npx hardhat b d d b b b P d b b d d Yb Yb Y Y Y YWelcome to Hardhat v What do you want to do …❯Create a sample project Create an empty hardhat config js Quitnpx comes with Node js when installed and helps execute executables installed on your local environment To ensure Hardhat executes in your project run the command again npx hardhatHardhat version Usage hardhat GLOBAL OPTIONS lt TASK gt TASK OPTIONS GLOBAL OPTIONS config A Hardhat config file emoji Use emoji in messages help Shows this message or a task s help if its name is provided max memory The maximum amount of memory that Hardhat can use network The network to connect to show stack traces Show stack traces tsconfig A TypeScript config file verbose Enables Hardhat verbose logging version Shows hardhat s version AVAILABLE TASKS accounts Prints the list of accountscheck Check whatever you needclean Clears the cache and deletes all artifactscompile Compiles the entire project building all artifactsconsole Opens a hardhat consoleflatten Flattens and prints contracts and their dependencieshelp Prints this messagenode Starts a JSON RPC server on top of Hardhat Networkrun Runs a user defined script after compiling the projecttest Runs mocha testsTo get help for a specific task run npx hardhat help task This same command also checks the available tasks Hardhart offers Hardhat also offers an ecosystem of plugins meaning there are more libraries you must install when working with Hardhat including the following npm install save dev nomiclabs hardhat waffle ethereum waffle chai nomiclabs hardhat ethers ethersThis includes hardhat waffle a plugin to test your smart contracts hardhat ethers which allows you interact with your smart contract from the frontend chai a Node js testing library The Hardhat networkRemember that smart contracts cannot deploy to a central server like a traditional application rather they must deploy to the Ethereum blockchain network that requires spending ETH currency Because the Ethereum network is the server ensure you test your smart contract before deploying to the Ethereum network also called the mainnet To test we need a local blockchain which Hardhat offers to us with Hardhat Network To begin this network run the following command npx hardhat nodeStarted HTTP and WebSocket JSON RPC server at http Accounts Account xffdeaadffceabcfffb ETH Private Key xacbecaebaabdffbacbcbedefcaedbffffAccount xcdcacdbeddcc ETH Private Key xcefaafdcedaecafbbd In your project folder you should see Greeter sol in the contracts folder SPDX License Identifier Unlicensepragma solidity import hardhat console sol contract Greeter string private greeting constructor string memory greeting console log Deploying a Greeter with greeting greeting greeting greeting function greet public view returns string memory return greeting function setGreeting string memory greeting public console log Changing greeting from s to s greeting greeting greeting greeting To compile this run the following npx hardhat compile Hardhat benefitsA few of the most common benefits of using Hardhat as your DApp framework include the following Remember these are the most common you might have a personalized benefit too First Hardhat is under active maintenance because it is one of the most used frameworks for building decentralized applications This can be attributed to its open source format with large community support thanks to over k users on GitHub and an active Discord community with k members at the time of posting this article It is continuously under development and growing quickly And with its technology based in JavaScript and TypeScript it s easy for JavaScript developers to pick up Hardhat disadvantagesOne main disadvantage of Hardhat is that it is clearly for professionals and not beginners since its documentation is fairly brief on how to get started Beginners building DApps might need to try other frameworks like Truffle before looking into Hardhat TruffleTruffle is another framework for building decentralized applications on the Ethereum blockchain It is the most popular and one of the pioneer frameworks It offers the aid of compilation deployment and testing Most other frameworks followed Truffle s path and if you are someone new in DApp development you will most likely encounter Truffle due to its beginner friendly setup It can also be used for other earned value management compatible EVM blockchains like Binance Smart Chain Hyperledger Polygon and more It also supports the Solidity and Vyper languages And if you are familiar with Node js it is an edge because Truffle is written in JavaScript Truffle installationYou must have Node js installed on your PC to begin Installation is easy you just run this command in your project npm install g truffleNext initialize Truffle in your project truffle initIf successful this is what you should see below Starting init gt Copying project files to Users macbookpro Desktop Projects dapp truffleInit successful sweet Try our scaffold commands to get started truffle create contract YourContractName scaffold a contract truffle create test YourTestName scaffold a testhttp trufflesuite com docsThe project structure is as follows dapp truffle ls contractsmigrationstesttruffle config js The Truffle networkTruffle offers a development network to run and test DApps without needing to deploy to the mainnet and serves as a local development blockchain for testing In the truffle config js file the network object comes with development and advance network configurations networks development host port network id match any network websockets true live host Random IP for example purposes do not use port network id Ethereum public network The development configuration is the default network where you run the following command truffle migrate networkTo compile your smart contracts use the command below truffle compile Truffle benefitsDue to its popularity and widespread usage Truffle has wide support from its users with over k GitHub users at the time of posting And like Hardhat maintenance is continuous to provide active support and Truffle supports local blockchain testnet and deploys to the mainnet easily Truffle disadvantagesDebugging in Truffle is not as easy as Hardhat because Truffle requires you to create events and throw them into a log making you look for that event Whereas in Hardhat you have a console log prompting messages on the terminal making you debug faster EmbarkEmbark is another framework for the EVM blockchain that is regarded as a full stack framework This means the framework offers the solution of building an entire decentralized application s frontend and backend simultaneously Embark watches for changes in your Solidity smart contracts and frontend HTML and JavaScript code and redeploys them to the blockchain network Embark installationBefore installing Embark ensure you have Node js installed on your computer Also Embark requires you to have the following installed as well The Ethereum Client that provides a blockchain network to test our application IPFS that helps store files in a decentralized mannerWhile these are optional it is still recommended to install them Installing Embark is pretty straightforward npm g install embarkTo begin working with Embark we must first run the following command embark demo cd embark demoThis creates a scaffold application with all required folders to work with With that in sight you run the application to spin up the Ethereum and IPFS nodes Remember Embark watches for changes in your code so it redeploys embark run The Embark networkRemember we must still connect to a blockchain network so we can test it through interacting Embark can work with clients such as Geth or Parity In the config blockchain js file you can configure the blockchain you want The below code is a sample from Embark s documentation module exports default enabled true client geth development clientConfig miningMode dev testnet endpoint accounts mnemonic word mnemonic Embark s benefitsEmbark has slightly more stars from the GitHub community than Hardhat coming in at about k stars It also comes with a UI dashboard that gives a survey of the processes Embark is working on for those interested in deploying to the web rather than a console And as stated previously it s a framework that helps build full stack solutions which other frameworks mentioned in this article cannot do Embark disadvantagesFrom my observation when trying to run Embark I ran into some errors while installing After that there were warnings on my terminal when I checked the currently installed version Also the project looks stale because there have been no contributions to it for months at the time of writing this article BrownieBrownie is a framework that builds applications for the EVM but is Python based meaning it supports the programming language Vyper a Python smart contract language Brownie also supports Solidity Unlike other frameworks mentioned in this article Brownie s test language is Python using hypothesis Overall Brownie handles deployment testing and debugging Deployment is easy when deploying to the local or testnet blockchain Brownie also supports a mainnet fork which takes a live snapshot of the current blockchain if you want to communicate with certain smart contracts that are not available on the local or testnet blockchain Brownie installationInstallation can be done via pipx or pip but pipx is the recommended way by Brownie Install pipx if you don t have it python m pip install user pipxpython m pipx ensurepathThen install Brownie pipx install eth brownie The Brownie networkBrownie offers development and live environments that allow testing These environments can be configured on the terminal using a few commands To view existing networks use the following brownie networks listBrownie Python development framework for EthereumThe following networks are declared Ethereum ├ーMainnet Infura mainnet ├ーRopsten Infura ropsten ├ーRinkeby Infura rinkeby ├ーGoerli Infura goerli └ーKovan Infura kovanEthereum Classic ├ーMainnet etc └ーKotti kottiDevelopment ├ーGanache CLI development └ーGanache CLI Mainnet Fork mainnet forkTo add a new network add the following command brownie networks add environment id host host KEY VALUE Brownie benefitsBrownie has a built in console for project interaction which other frameworks do not offer For example adding a network through the console lets you run a command to add a network quickly rather than writing it in your codebase It is also superior to others since it fully supports Solidity and Vyper which are two different smart contract languages And with its interactive mode when running tests if a test fails it stops and shows in the console alerting the user Brownie disadvantagesBecause Brownie is a Python based framework JavaScript devs will not be able to easily use the framework OpenZeppelinOpenZepplin is a toolkit with plugins that help build smart contracts faster For example it has major standard tokens like ERC and ERC implementations and more To use any of the smart contracts in OpenZeppelin you must import them into your own smart contract Note that OpenZeppelin is actually distributed as an npm package meaning you must install Node js first OpenZeppelin installationTo install OpenZeppelin use the following command npm install openzeppelin cliTo set up an OpenZeppelin project use the following npx openzeppelin initWith an example smart contract from OpenZeppelin s documentation written below we must compile the following code contracts Counter solpragma solidity contract Counter uint public value function increase public value To compile run the following oz compileYou can use openzeppelin compile or oz compile but oz is just a short command to pick The OpenZeppelin networkDeploying our smart contract is just as easy as compiling them OpenZeppelin uses Ganache as a network for development where you can have a local blockchain You should install Ganache if you do not have it yet npm install ganache cliTo start a new process run the following npx ganache cli deterministicThen deploy the smart contracts npx oz deploy✓ Compiled contracts with solc commit efd Choose the kind of deployment upgradeable Pick a network development Pick a contract to instantiate Counter✓ Added contract Counter✓ Contract Counter deployed Call a function to initialize the instance after creating it No✓ Setting everything up to create contract instances✓ Instance created at xCfEBFecdBAFfCCA OpenZeppelin benefitsOpenZeppelin has many implemented functionalities like creating an ERC Because this is already available within OpenZeppelin you do not need to reinvent the wheel saving time when developing It also has thorough documentation helping you understand what OpenZeppelin offers Most of its contract functionalities are upgradeable meaning you can modify the plugins yourself OpenZeppelin disadvantagesOpenZeppelin provides upgradeable contracts but the downside is that there s an admin role to handle implementation which can impose security risks How to choose the right framework for your DApp projectThe best way to choose the right framework for a project is to understand what you want to build and what necessary toolkit you need Perhaps you want something that is Python based which definitely points to the Brownie framework as your only option Another aspect to consider when choosing a framework is understanding its community and support for that selected framework What if there is a major bug Could you and your team fix it Or is the community strong enough to help fix it ConclusionWith the recent rise in the development of DApps more tools have spun up to help build applications faster The most common and most used are Hardhat and Truffle but this is not limited to all developers If you have a project in mind skim through each framework s documentation to see which suits you best Note that these frameworks are constantly undergoing maintenance and might need your support as well since they are open source in Web LogRocket Full visibility into your web appsLogRocket is a frontend application monitoring solution that lets you replay problems as if they happened in your own browser Instead of guessing why errors happen or asking users for screenshots and log dumps LogRocket lets you replay the session to quickly understand what went wrong It works perfectly with any app regardless of framework and has plugins to log additional context from Redux Vuex and ngrx store In addition to logging Redux actions and state LogRocket records console logs JavaScript errors stacktraces network requests responses with headers bodies browser metadata and custom logs It also instruments the DOM to record the HTML and CSS on the page recreating pixel perfect videos of even the most complex single page apps Try it for free |
2021-11-29 19:25:37 |
海外TECH |
DEV Community |
Build a real-time video chat app with React Native |
https://dev.to/trydaily/build-a-real-time-video-chat-app-with-react-native-2hm
|
Build a real time video chat app with React NativeDaily s React Native library allows developers to build mobile apps compatible with both Android and iOS with one codebase It also means your web developers who have likely crossed paths with React at some point can write code that will get compiled into native mobile code with a smaller learning curve since React and React Native are fairly similar Recently on the Daily blog we discussed how to build your own audio call app in React Native That tutorial specifically looked at Daily s Party Line demo app which was built to handle the use case where every call is always audio only Today s agendaIn today s tutorial we ll take a look at Daily s React Native Playground demo app which uses more of a traditional video call format call participants have the option to turn on and off both audio and video More specifically we ll cover How to build a multi participant video call in React Native with react native daily jsHow to give call participants control of their devices in the video call to toggle their local microphone and camera Who is this tutorial for If you are interested in building a mobile app with video calls and have some React Native or even React knowledge this tutorial is for you React Native projects can be a little more finicky to run locally than web apps because of the platform specific setup requirements so having some comfort with React Native is a big plus We won t cover every section of the Playground demo app code base in this tutorial since a lot of the functionality is similar to daily js web apps which we promise already have a bunch of existing tutorials A note on today s stack and React HooksSince this app is written in React Native we ll be looking at React Native code examples and React hooks from the demo codebase We recommend familiarizing yourself with React Hooks before reading on to get the most out of this tutorial We ve also used TypeScript in this demo app TypeScript isn t specifically discussed below but having some familiarity with it will help you review the code examples Getting startedFor anyone new to React Native app development we ll quickly cover some basics Typically you ll want to test on both Android and iOS mobile or tablet devices to ensure your app is working in both operating systems To test on iOS devices you ll need to download XCode which is only available to download on Mac computers You ll also want to pour yourself a coffee or two while it downloads and hope you re not on deadline Note This means you will need a Mac to access XCode for iOS development Android however can be tested with Android Studio which is available on a range of operating systems In terms of running the Daily Playground demo app locally thorough instructions for both Android and iOS development are included in the repo s README Note You ll need to use real devices instead of a device emulator when you re testing the video audio features In terms of which OS to start with if you don t have a personal preference it s typically faster to get this app running on an Android device App features and functionalityAs mentioned we won t cover every part of this codebase To start let s discuss the overall structure and functionality of the app so you know how to navigate it The App component is the top level parent component It renders either the home screen or the in call view Let s quickly review how the home screen works When you first land on the home screen there s an empty room URL text input a “Create demo room button and a disabled “Join call button If you know which Daily room you want to join you can enter the room URL in the text input and press “Join call which will be enabled once the input has a value If you do not have a room URL we ve set up an endpoint that will create a new room for you using Daily s REST API This endpoint is called when the “Create room button is pressed which calls the method createRoom defined in App App tsx lt Button type secondary onPress createRoom label appState AppState Creating Creating room Create demo room gt App tsx const createRoom gt setRoomCreateError false setAppState AppState Creating api createRoom then room gt setRoomUrlFieldValue room url setAppState AppState Idle catch gt setRoomCreateError true setRoomUrlFieldValue undefined setAppState AppState Idle Here we update our appState state value to be in a temporary “creating state call api createRoom and if it s successful set our roomUrlFieldValue value and appState Both appState and roomUrlFieldValue are component state values initialized in App Note Take a look at api ts to see the api createRoom method Whether you use your own Daily room URL or one created in the app when you press the “Join call button it will take the roomUrlFieldValue set the roomUrl state value with it and kick off creating the Daily call object Here we have the “Join call button App tsx “Join call button will call startCall on press lt StartButton onPress startCall disabled startButtonDisabled starting appState AppState Joining gt Next we call startCall App tsx Join the room provided by the user or the temporary room created by createRoom const startCall gt setRoomUrl roomUrlFieldValue And lastly a useEffect hook is triggered by the roomURL value getting updated which creates our Daily call object the brain of this operation App tsx Create the callObject as soon as we have a roomUrl This will trigger the call starting useEffect gt if roomUrl return const newCallObject Daily createCallObject setCallObject newCallObject roomUrl The following line is where the call object is actually created const newCallObject Daily createCallObject Then by setting that value in our component s state the call object instance can be referred to later setCallObject newCallObject After the call object has been created we can then actually join our room finally Considering we pressed the “Join call button App tsx useEffect gt if callObject roomUrl return callObject join url roomUrl catch gt Doing nothing here since we handle fatal join errors in another way via our listener attached to the error event setAppState AppState Joining callObject roomUrl Here in another useEffect hook in App when the callObject and roomUrl state values are truthy which they now are we can actually join our call by passing the roomUrl to our call object instance This step is also where our app view will change from the home screen to the in call view This happens because of this line in the effect above setAppState AppState Joining App tsx const showCallPanel AppState Joining AppState Joined AppState Error includes appState When showCallPanel ーshown above ーis truthy our in call view will render instead of the home screen App tsx lt View style styles container gt showCallPanel lt View style styles callContainerBase orientation Orientation Landscape styles callContainerLandscape null gt lt CallPanel roomUrl roomUrl gt lt Tray onClickLeaveCall leaveCall disabled enableCallButtons gt lt View gt … home screen We ll leave it at that for the home screen and focus on the CallPanel component ーour in call view ーfor the rest of this tutorial If you have any questions about this section please reach out We re happy to help Displaying video tiles in your Daily React Native appLet s start by familiarizing ourselves with what our in call app UI is supposed to look like We have the local participant s camera feed at the top left corner the room URL and a button to copy it to your clipboard in the middle of the screen and our tray at the bottom If anyone is screen sharing they ll also be included as a small thumbnail at the top Note Screen sharing can t be initiated in this app but call participants can join the room from any platform including a web app using daily js where screen sharing is permitted The tray i e the Tray component has buttons to toggle the local participant s audio video and to leave the call When more participants join their videos are shown in the middle of the screen replacing the room URL information Iterating over our participant listNow that we know what we re talking about let s jump right to where we re actually creating our participant videos with react native daily js In CallPanel tsx we render an array called largeTiles which represents the remote participants CallPanel tsx lt ScrollView alwaysBounceVertical false alwaysBounceHorizontal false horizontal orientation Orientation Landscape gt lt View style styles largeTilesContainerInnerBase orientation Orientation Portrait styles largeTilesContainerInnerPortrait styles largeTilesContainerInnerLandscape gt largeTiles lt our remote participants lt View gt lt ScrollView gt Note We ve put this in a ScrollView but you may prefer a FlatList component if you know you will be having larger calls A FlatList will only render the visible tiles which should help with performance It s less of a concern in on video calls Our largeTiles remote participants and thumbnailTiles the local participant or screen sharer are determined by the same memoized function The tiles in largeTiles can be either full size or half size depending on the number of participants CallPanel tsx Get lists of large tiles and thumbnail tiles to render const largeTiles thumbnailTiles useMemo gt let larges JSX Element let thumbnails JSX Element Object entries callState callItems forEach id callItem gt let tileType TileType if isScreenShare id tileType TileType Full else if isLocal id containsScreenShare callState callItems tileType TileType Thumbnail else if participantCount callState callItems lt tileType TileType Full else tileType TileType Half const tile lt Tile key id videoTrackState callItem videoTrackState audioTrackState callItem audioTrackState mirror usingFrontCamera amp amp isLocal id type tileType disableAudioIndicators isScreenShare id onPress isLocal id flipCamera gt sendHello id gt if tileType TileType Thumbnail thumbnails push tile else larges push tile return larges thumbnails callState callItems flipCamera sendHello usingFrontCamera Let s step through this function We declare two arrays that we ll be updating in this function larges and thumbnailsWe get an array of our call participants Object entries callState callItems and do the following for each or forEach if you will Note The tileType can be TileType Full TileType Half or TileType Thumbnail The latter is the local participant and the first two options are for remote participants our largeTiles If the “participant is actually a screen share we make it a full size tileIf the participant is local or currently sharing their screen we make them a thumbnailIf the call has or less participants total remote participants will have full size tiles otherwise they ll have half size tiles We then render a Tile component for each participant and update our larges and thumbnails arraysOkay we ve come pretty far but we still need to render our actual video and audio for the participants so bear with us Rendering participant mediaThe most important part of the Tile component is the mediaComponent a memoized instance of the DailyMediaView component imported from react native daily js Tile tsximport DailyMediaView from daily co react native daily js const mediaComponent useMemo gt return lt DailyMediaView videoTrack videoTrack audioTrack audioTrack mirror props mirror zOrder props type TileType Thumbnail style styles media objectFit cover gt videoTrack audioTrack props mirror props type The videoTrack and audioTrack are props passed to Tile from CallPanel but are actually set in callState ts callState tsfunction getCallItems participants id string DailyParticipant Ensure we always have a local participant let callItems initialCallState callItems for const id participant of Object entries participants callItems id videoTrackState participant tracks video audioTrackState participant tracks audio if shouldIncludeScreenCallItem participant callItems id screen videoTrackState participant tracks screenVideo audioTrackState participant tracks screenAudio return callItems We re jumping around here a bit but the important thing to understand is that our Daily callObject provides our participant information see callObject participants and our participant information contains their media video audio tracks We can then pass those tracks to the DailyMediaView component to actually play those tracks in the app Jumping back to the Tile component we get the videoTrack and audioTrack values from the videoTrackState and audioTrackState props Tile tsx const videoTrack useMemo gt return props videoTrackState amp amp props videoTrackState state playable props videoTrackState track null props videoTrackState const audioTrack useMemo gt return props audioTrackState amp amp props audioTrackState state playable props audioTrackState track null props audioTrackState This means we use the tracks from the individual participant information if they re available and otherwise set that corresponding props to null Both are valid types for the DailyMediaView videoTrack and audioTrack props Tile also has an overlay with the audio and camera muted icons when they apply i e when there s no track to play but we won t review that code here Again let us know if you have any questions Controlling your local devices in callAs a final note let s see how our Tray component interacts with the Daily call object As a reminder it s rendered in App tsx at the same time the CallPanel component is rendered As mentioned the tray lets up control our local camera and microphone as well as leave the current call to return to the home screen To toggle our local camera we can call setLocalAudio on the call object instance Tray tsx const toggleCamera useCallback gt callObject setLocalVideo isCameraMuted callObject isCameraMuted Similarly we can toggle our microphone on or off with setLocalAudio Tray tsx const toggleMic useCallback gt callObject setLocalAudio isMicMuted callObject isMicMuted Lastly pressing the “Leave button will call the leaveCall function call a prop passed from App App tsx Leave the current call If we re in the error state AppState Error we ve already left so just clean up our state const leaveCall useCallback gt if callObject return if appState AppState Error callObject destroy then gt setRoomUrl undefined setRoomUrlFieldValue undefined setCallObject null setAppState AppState Idle else setAppState AppState Leaving callObject leave callObject appState Here we re destroying our call object instance and resetting the state in App to get back to our initial values ResourcesWe hope this helps you navigate building your own video call apps with Daily s React Native library We covered the most important aspects of our Playground app but we re always happy to answer any questions you may have If you re looking to learn more about building with Daily s React Native library check out our beloved docs or read our previous tutorial on building a Clubhouse clone app |
2021-11-29 19:21:35 |
海外TECH |
DEV Community |
How To Set Up Continuous Integration And Deployment With CircleCI |
https://dev.to/mariehposa/how-to-set-up-continuous-integration-and-deployment-with-circleci-1pe9
|
How To Set Up Continuous Integration And Deployment With CircleCIIn this tutorial I will be demonstrating how to set up continuous integration and continuous deployment with CircleCI At the end of this article you would have deployed a Node application to Heroku and have subsequent builds automatically deployed on successful testing via CircleCI What is CircleCI and why should you use it CircleCI is a platform for continuous integration and continuous deployment which is used by developers to automate testing building and deployment of applications It is free and has a strong community so finding support is not a problem CircleCI is also easily configured and I hope to prove this with this article so please read on ️ PrerequisitesIf you d like to follow along with this tutorial please make sure the following requirements are met A running Node app with its tests passing If you don t have one you can fork this project and follow its documentation to set it up A CircleCI account You can sign up here A Heroku app You can sign up here for the account and follow this tutorial to create a Heroku app Now let s get started The first step will be to log in to your CircleCI account Successful login should display your account dashboard Before we do any actual work let s connect the Node app to CircleCI On the left sidebar click on Projects then click on the Setup project button for the Node app Select Write your own using our starter config yml template for the config yml file and click on Let s GoThen select Node as a sample config for the project and click on Commit and Run Go to the Node app GitHub repo and merge the pull request from CircleCI Now we need to add HEROKU APP NAME and HEROKU API KEY to the project environment variables so that CircleCI can connect to the Heroku app HEROKU APP NAME is the name of your Heroku app I named mine circleci test ma HEROKU API KEY is your Heroku account API key To get your HEROKU API KEY go to your Heroku Dashboard click on Account Settings then scroll down to the API Key section and click on Reveal to copy your API key Now navigate back to the CircleCI dashboard Click on the Project Settings for the Node app and then click on Environment Variables On the Environment Variables page create two variables named HEROKU APP NAME and HEROKU API KEY and give them their respective values as gotten from your Heroku dashboard Go back to the Node app on your editor Remove the default configuration inside the config yml file config from CircleCI and replace it with the following config version orbs node circleci node heroku circleci heroku workflows heroku deploy jobs build heroku deploy via git requires build filters branches only mainjobs build docker image circleci node steps checkout restore cache key dependency cache checksum package json run name Install dependencies command npm install save cache key dependency cache checksum package json paths node modules run name Run test command npm testLet s take a minute to break down this config file version version is used to have access to orbs orbs node circleci node heroku circleci heroku orbs enable us to integrate with software just with a single line of code For example we made use of JavaScript that is why we use an orb that points to that with circleci node The orb circleci heroku points to Heroku since we re also using that for deployment workflows heroku deploy jobs build heroku deploy via git requires build filters branches only mainworkflow specifies how jobs should be run Here we made the build run before deploying to Heroku heroku deploy via git is used to deploy changes from GitHub to Heroku require is used inside heroku deploy via git to delay deployment until the build is done The filters block is used to specify the main branch for deployment jobs build docker image circleci node steps checkout restore cache key dependency cache checksum package json run name Install dependencies command npm install save cache key dependency cache checksum package json paths node modules run name Run test command npm testjobs are typically a series of steps Here we use restore cache to restore the dependencies that were installed in the previous builds Then we run npm install to install new dependencies and cache them too to prevent having to re install We then run the npm test command to run the unit tests Commit the changes and push to GitHub You can check the build on CircleCI it should return Success depending on whether your Node app passes all tests you should be fine if you simply clone the repo and made no changes You can also check out the deployed version of the Node app on your Heroku dashboard That s it At this point any changes you make to the project should get deployed as soon as they are pushed to the branch we specified in the config file It s always advisable to do sanity checks so make sure to push a small change and see it deployed If you found this article helpful please leave a heart or a comment If you have any questions please let me know in the comment section Also don t forget to follow me for more articles Thank you |
2021-11-29 19:15:00 |
Apple |
AppleInsider - Frontpage News |
Cyber Monday Apple deal: Save $250 on this 13-inch MacBook Pro with 512GB SSD |
https://appleinsider.com/articles/21/11/29/cyber-monday-apple-deal-save-250-on-this-13-inch-macbook-pro-with-512gb-ssd?utm_medium=rss
|
Cyber Monday Apple deal Save on this inch MacBook Pro with GB SSDAmazon has issued a cash discount on Apple s current inch MacBook Pro with GB of storage this Cyber Monday bringing the cost of the upgraded model down to Plus save on every other MacBook Pro configuration with our exclusive coupon inch MacBook Pro dealsCyber Monday MacBook Pro deals are shaping up to be highly aggressive this year with Amazon s latest markdown on the inch MacBook Pro one of the steepest available Save instantly update sold out on the M model in Space Gray with GB of RAM and a GB SSD Thanks to an instant rebate of off stacked with another off at checkout the price is the best available for the upgraded configuration according to our inch MacBook Pro Price Guide Read more |
2021-11-29 19:01:32 |
海外TECH |
Network World |
BrandPost: IT Teams Dealing with Great Expectations and Stress |
https://www.networkworld.com/article/3642830/it-teams-dealing-with-great-expectations-and-stress.html#tk.rss_all
|
BrandPost IT Teams Dealing with Great Expectations and Stress At some companies it seems as though IT teams have transformed from company scapegoat to company G O A T greatest of all time Amidst a momentous digital transformation IT teams were essential in easing the massive business disruptions of and by enabling a massive shift to remote work and rapid upswing in digital commerce With anticipation that will be a more stable year than the previous two it s a good time to examine the role of IT and the expanding expectation of how teams can support and secure line of business LOB initiatives outside of traditional security perimeters That was the topic eagerly debated by participants in an IDGTechTalk Twitter chat sponsored by ComcastBusiness November th To read this article in full please click here |
2021-11-29 19:30:00 |
海外科学 |
NYT > Science |
Antiviral Covid-19 Pills Are Coming. Will There Be Enough Tests? |
https://www.nytimes.com/2021/11/29/health/covid-pill.html
|
accurate |
2021-11-29 19:40:28 |
海外TECH |
WIRED |
The 53 Best Cyber Monday Deals for $50 or Less |
https://www.wired.com/story/best-cyber-monday-deals-under-50-2021
|
wired |
2021-11-29 19:49:00 |
海外TECH |
WIRED |
Jack Dorsey Was the Soul of Twitter |
https://www.wired.com/story/jack-dorsey-was-the-soul-of-twitter
|
dorsey |
2021-11-29 19:35:48 |
医療系 |
医療介護 CBnews |
アウトリーチ機能がケアマネジメント力を育む-介護経営に明るい未来をもたらすために(8) |
https://www.cbnews.jp/news/entry/20211126191631
|
医療福祉大学 |
2021-11-30 05:00:00 |
ニュース |
BBC News - Home |
Covid: All UK adults to be offered booster jab |
https://www.bbc.co.uk/news/uk-59465577?at_medium=RSS&at_campaign=KARANGA
|
omicron |
2021-11-29 19:41:43 |
ニュース |
BBC News - Home |
Labour reshuffle: Yvette Cooper becomes shadow home secretary |
https://www.bbc.co.uk/news/uk-politics-59461674?at_medium=RSS&at_campaign=KARANGA
|
labour |
2021-11-29 19:53:44 |
ニュース |
BBC News - Home |
Covid-19 in the UK: How many coronavirus cases are there in my area? |
https://www.bbc.co.uk/news/uk-51768274?at_medium=RSS&at_campaign=KARANGA
|
cases |
2021-11-29 19:24:19 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
テック株「金利上昇に弱い」説の盲点、株価上昇は終わっていない - 政策・マーケットラボ |
https://diamond.jp/articles/-/288964
|
金利上昇 |
2021-11-30 04:50:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【鶴丸高校】華麗なる卒業生人脈!吉田憲一郎ソニーグループ会長兼社長、大田弘子政策研究大学院大学特別教授、電通元社長、サッポロビール元社長… - 日本を動かす名門高校人脈 |
https://diamond.jp/articles/-/288723
|
吉田憲一郎 |
2021-11-30 04:45:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
全国高校「国公立100大学合格力」ランキング・ベスト10!3位府立北野、2位甲陽学院、1位は?【2022年入試版】 - 中学受験への道 |
https://diamond.jp/articles/-/288781
|
全国高校「国公立大学合格力」ランキング・ベスト位府立北野、位甲陽学院、位は【年入試版】中学受験への道新型コロナ禍の中、初めての大学入学共通テストとともに、年大学入試は行なわれた。 |
2021-11-30 04:40:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
全国高校「国公立100大学合格力」ランキング・ベスト50【2022年入試版】 - 中学受験への道 |
https://diamond.jp/articles/-/288780
|
全国高校「国公立大学合格力」ランキング・ベスト【年入試版】中学受験への道新型コロナ禍の中、初めての大学入学共通テストとともに、年大学入試は行われた。 |
2021-11-30 04:40:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
暴力団による「企業恐喝の手口」、元マル暴刑事が明かす巧妙化の実態とは - DOL特別レポート |
https://diamond.jp/articles/-/288963
|
|
2021-11-30 04:35:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
韓国の次期大統領候補「許されぬ3つの歴史改ざん」、元駐韓大使が解説 - 元駐韓大使・武藤正敏の「韓国ウォッチ」 |
https://diamond.jp/articles/-/288981
|
次期大統領 |
2021-11-30 04:32:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「所得倍増」がわずか1%の賃上げに、岸田首相の軽すぎる公約 - DOL特別レポート |
https://diamond.jp/articles/-/289036
|
岸田文雄 |
2021-11-30 04:31:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「自動車一本足打法」で日本沈没、分水嶺を迎えた日本経済の行方 - 今週のキーワード 真壁昭夫 |
https://diamond.jp/articles/-/288962
|
「自動車一本足打法」で日本沈没、分水嶺を迎えた日本経済の行方今週のキーワード真壁昭夫月から国内の自動車生産台数が回復し始めた。 |
2021-11-30 04:30:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ポイント還元と現金キャッシュバック、実際はどっちがお得? - News&Analysis |
https://diamond.jp/articles/-/289022
|
newsampampanalysis |
2021-11-30 04:27:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
立憲民主党は誰が代表になっても将来性なし!結党自体が間違いだった理由 - 上久保誠人のクリティカル・アナリティクス |
https://diamond.jp/articles/-/288961
|
上久保誠人 |
2021-11-30 04:25:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
デジタル化による「情報格差」の解消とシステム化が古い体質の業界を革新する - 及川卓也のプロダクト視点 |
https://diamond.jp/articles/-/288599
|
デジタル化による「情報格差」の解消とシステム化が古い体質の業界を革新する及川卓也のプロダクト視点情報格差はデジタル化の遅れにより生じる。 |
2021-11-30 04:20:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「苦境の日本酒業界」、復活のための3つの施策とは - News&Analysis |
https://diamond.jp/articles/-/288960
|
「苦境の日本酒業界」、復活のためのつの施策とはNewsampampAnalysisコロナによるダメージは各業界に及んでいるが、酒類業界も例外ではない。 |
2021-11-30 04:15:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
なぜポジティブ思考は「良い決断」をするのに役立たないのか - イノベーション的発想を磨く |
https://diamond.jp/articles/-/288901
|
自分 |
2021-11-30 04:12:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
親が知るべき、コロナ禍で劇的に変わった子どもと企業の繋がり方 - 親世代に送る「今どき就活」情報、わが子と向き合うためのヒント |
https://diamond.jp/articles/-/289009
|
親が知るべき、コロナ禍で劇的に変わった子どもと企業の繋がり方親世代に送る「今どき就活」情報、わが子と向き合うためのヒント年卒業の学生は、コロナ禍の混乱の中での就活を余儀なくされた。 |
2021-11-30 04:10:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
野菜不足の解消法4選、「使い切れない」悩みもお任せ! - 仕事脳で考える食生活改善 |
https://diamond.jp/articles/-/288959
|
野菜不足の解消法選、「使い切れない」悩みもお任せ仕事脳で考える食生活改善外食が続いたり、デリバリーに頼りがちな食生活だったりすると、「なんとなく野菜不足……」と思っている人も多いのではないでしょうか。 |
2021-11-30 04:05:00 |
ビジネス |
東洋経済オンライン |
相次ぐ電車内の傷害事件、自分の身をどう守る? 非常ボタンや消火器の場所を覚えておこう | 経営 | 東洋経済オンライン |
https://toyokeizai.net/articles/-/470962?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
傷害事件 |
2021-11-30 04:30:00 |
マーケティング |
AdverTimes |
くら寿司、12月商戦期へ加速 ダウンタウン起用CM13作目 |
https://www.advertimes.com/20211130/article369898/
|
開始 |
2021-11-29 19:00:49 |
コメント
コメントを投稿