There are enough basic courses that show you how to create a simple application. In this course you will learn how to create an application that is not even a website.
- [Instructor] In this course, we won't build the next website or blog. Rather, we will use Node.js to build a microservice-based Slack Bot. We already know that Node is used to build websites. It is also widely used to consume APIs or connect to different parts of a stack. Let's assume that we want to build a mobile app for an insurance company to offer customers the possibility to quickly order new services. Usually these companies rely on complex applications running in mainframes. Connecting the mobile app directly to the mainframe is not an option.
This would raise too many security concerns and doesn't even provide the data in a way that we can use it in our app. It is also complicated to manipulate data. Creating a new record in a huge insurance application involves many steps and takes its time, but we don't want the customer to wait. We also don't want to implement this business logic for every platform like iOS or Android. We rather want to offload this to Note.js, queue the task, and tell the user that everything is underway when all the work is done asynchronously in the background.
Node is very good at consuming data from different sources and transforming it for other applications. Let's put it this way. Node is the ideal platform to provide services of all kinds. Why is that? Well, Node.js is event-based. It uses an event loop that application can load off asynchronous tasks to. The event loop takes care of completing the task while the application can proceed processing requests. When the task is complete, the event loop pings back the main application, then executes a callback function to proceed with the result.
Simply put, we tell the event loop, please do this task while we do other work, and let us know when you are done. Because of that, we can use one single thread for our Node application, which saves system resources and also brings higher throughput. Remember, creating a thread for every request depletes resources. It's much better this way. In our application, we will use the API of Slack to get notified when a new message arrives, use a natural language processor called Wit to try to understand the meaning of a message, use self-built, self applications called microservices to find out what to reply, and send the reply back to Slack.
After explaining some basics about Node.js and microservices, Daniel shows you how to sketch out the planned architecture for your application and get the boilerplate code, modules, and credentials in place. Next, he shows how to create a bot user in Slack, connect to Slack, and post messages. He also shows you how to get your bot to process variations in text by creating logic that delegates the processing of intent to dedicated modules. Lastly, he shows how to register additional services and he covers how to use monitoring to identify architectural or performance issues.
- Using Slack APIs
- Sketching out a Slack bot architecture
- Setting up a project and choosing modules
- Creating and naming your bot
- Connecting to Slack
- Setting up and using natural language processing
- Routing by intents
- Implementing geocoding and time calculation
- Adding and monitoring services