Node & Express Intro
- Database integration with Mongo DB
- Profile signup/login
- REST API design
- Session Management
This is a good introduction to Node JS and backend programming in general. It provides a soid foundation for the more advanced, full-featured tutorials on Velocity 360..
In this video, we install the required tools (Node, express, Mongo) and create a basic web project using the Express Generator. Then we add our first route, the API handler, which will eventually manage the main CRUD (Create, Read, Update, Delete) operations for our profiles.
In this video, we set up the Mongo database integration using the Mongoose ORM then add the Profile schema. We connect to Mongo and run queries for all Profile objects in the database (none right now) via the API route from the first video.
In this video, we create a simple sign up for on the home page in order to create actual profiles for the backend. We register a few fake profiles and then create another route to fetch them individually.
Controllers and PromisesRegister or Log In to View
In this video, we extract the Profile CRUD operations into its own controller file in order the make the API route more modular. We also introduce the concept of promises to avoid overly nested callbacks and use promises instead of completion handlers to run our controller code.
Hashing PasswordRegister or Log In to View
In this video, we conceal passwords from the API requests. Then we hash the passwords on profile registrations so that even if they are exposed from the database, they will be encrypted. Last, we set up an account route for the registration process which will redirect the user to a profile page on sign up.
SessionsRegister or Log In to View
We set up session management in this video in order to keep track of the logged in user. This way, whenever the user navigates to various pages on the site or leaves and returns later, we will know who the user is.
JSON Web TokensRegister or Log In to View
In this video we use JSON web tokens to further enhance our authentication set up. When a user logs in, we create a token with secret key that gets passed back and forth with every subsequent request. We then use it to identify the logged in user on the profile page and render the username.
Submitting CommentsRegister or Log In to View
In this video, we set up the comment area so that users can submit comments. We post comments to your API handler at first to ensure it works, then we create a new endpoint in the account route in order to bind comments to the profile that is currently logged in.
Displaying Profile CommentsRegister or Log In to View
In this video, we render the comments for the logged in user on the profile page. We changed the template engine to mustache which gives us additional functionality for looping through data.
Styling and PartialsRegister or Log In to View
To finish out the site, we add Bootstrap for basic styling on the profile page. We also render the Nav bar using partials which enables us to avoid repeat code throughout the various pages of a site.