From the course: Node.js: Deploying Applications

Project overview - Node.js Tutorial

From the course: Node.js: Deploying Applications

Start my 1-month free trial

Project overview

- [Instructor] For this class, I'll be using an application I created for the deployment exercises. It's really more of a splash screen. The goal is to demonstrate how code can move through the pipeline from development to release for a database driven application. My goals when putting this together were based around deployment. I wanted to create an application that runs in Node.js, uses a standard framework for web interaction, has a bill process to create the content, and is easy to get up and running. The application stack I chose is the MEAN stack. So the database engine is Mongo, the web server is Express, Angular is used for content generation, and of course it runs on Node. Now let's take a closer look at these elements. Mongo is a document database and we'll place some data in there to work with. It's excellent for document type data with links and descriptors. You're welcome to use whatever Mongo service you like, or even host your own. Just remember that in order for the cloud platforms to serve data from your database, it must be accessible by the world. I'm using mLab as my Mongo hosting service but there are many other options, most of them with a free tier. This application is shall we say, fairly light on the database so you should be fine with whatever choice you make. There are two types of interfaces to the application. The first is a simple backend API retrieving and serving the content from Mongo. This one serves content at api games. The other entry point is a single page application front end built by Angular, which is served at the root of the server. Both of these are served by Express. While Angular is capable of serving content on its own, I chose to use the generated static files from the build and serve them from the Express server as this demonstrates a slightly more flexible arrangement. It also allows a single web server to serve all the content without reverse proxies. The application is view only, as it's really only a landing page to make sure things are working correctly. The templates in Angular have some logic in them to show which environment it was built for which will help us to verify that the right environment is getting built in all the target environments. There's also a timestamp so you can see when the last site was last built. We'll be using the environment version and timestamp to help us make sure we're deploying the right items. Because the files are built on deployment, they're not retained in source control. Although there are some configuration files stored in the repository with the application which will help us get started with some of the applications and services we'll be looking at. I'll cover each of these as we encounter them. The exercise files directory is complete at the start. This course isn't about Node development directly, but how you interface with deployment systems. We'll be running all the deployments and doing all the configuration from your single exercise files directory. So you won't need to move to new directories to follow along with later chapters. When we're done, you'll have a single directory which can publish to Heroku, Elastic Beanstalk, or Azure. And you'll have some experience working with continuous integration systems as well.

Contents