List of Figures

Lesson 0. Setting up Node.js and the JavaScript engine

Figure 0.1. Simplified model of the Node.js event loop

Lesson 1. Configuring your environment

Figure 1.1. Node.js installer page

Figure 1.2. Node.js writing to your machine

Figure 1.3. Installing Git from the downloads page

Lesson 2. Running a Node.js application

Figure 2.1. Running a JavaScript file with Node.js

Lesson 3. Creating a Node.js module

Figure 3.1. Installing a package in terminal

Figure 3.2. Node.js application structure with node_modules

Lesson 4. Building a simple web server in Node.js

Figure 4.1. A web server sends your browser web pages, images, and other resources on request.

Figure 4.2. Running the a basic Node.js server

Figure 4.3. Display of your first web page

Lesson 5. Handling incoming data

Figure 5.1. A web server collects posted data and arranges it.

Figure 5.2. Results of running a curl command

Figure 5.3. Browser view for the /contact URL

Lesson 6. Writing better routes and serving external files

Figure 6.1. Application structure with views

Figure 6.2. Server routing logic to render views

Figure 6.3. Arranging your assets so they’re easier to separate and serve

Figure 6.4. The exports object gives other files access to specific functionality.

Lesson 7. Capstone: Creating your first web application

Figure 7.1. Example home page for Confetti Cuisine

Figure 7.2. Example contact page for Confetti Cuisine

Lesson 8. Setting up an app with Express.js

Figure 8.1. Express.js stands between the HTTP requests and your application code.

Lesson 9. Routing in Express.js

Figure 9.1. The role of middleware functions

Figure 9.2. Express.js MVC file structure

Figure 9.3. Express.js can follow the MVC structure with routes feeding controllers

Lesson 10. Connecting views with templates

Figure 10.1. Converting EJS to HTML

Figure 10.2. Example view of name page

Lesson 12. Capstone: Enhancing the Confetti Cuisine site with Express.js

Figure 12.1. View of courses page

Figure 12.2. View of error page

Lesson 13. Setting up a MongoDB Database

Figure 13.1. Example document

Figure 13.2. MongoDB shell viewing current test database

Figure 13.3. Database view in MongoDB Compass

Lesson 14. Building models with Mongoose

Figure 14.1. Models created with Mongoose map to documents in MongoDB.

Lesson 15. Connecting Controllers and Models

Figure 15.1. Example browser response with subscriber data

Figure 15.2. Example browser view with listed subscriber data

Figure 15.3. Flow from a web page form to your database

Figure 15.4. Promise chain in Mongoose.js

Lesson 16. Capstone: Saving user subscriptions

Figure 16.1. Listing subscriber data on the subscribers page

Figure 16.2. Listing subscription form on the contact page

Lesson 17. Improving Your Data Models

Figure 17.1. Example response for Mongoose REPL commands

Figure 17.2. Relational database associations

Lesson 18. Building the user model

Figure 18.1. Views for each CRUD action

Figure 18.2. Example of users index page in your browser

Lesson 19. Creating and reading your models

Figure 19.1. Example of user-creation form in your browser

Figure 19.2. Users’ index page with linked names in your browser

Figure 19.3. Users show page in your browser

Lesson 20. Updating and Deleting your Models

Figure 20.1. Users index page with edit links in your browser

Figure 20.2. User edit page in your browser

Figure 20.3. Users index page with delete links in your browser

Figure 20.4. User’s show page with links to edit and delete

Lesson 21. Capstone: Adding CRUD Models to Confetti Cuisine

Figure 21.1. Capstone file structure

Figure 21.2. Subscribers index page in the browser

Figure 21.3. Subscriber edit page in the browser

Lesson 22. Adding sessions and flash messages

Figure 22.1. Successful flash message shown on the /users page

Figure 22.2. Error flash message shown on the home page

Lesson 23. Building a user login and hashing passwords

Figure 23.1. Example of user login page in your browser

Figure 23.2. Failed user login page in your browser

Figure 23.3. Successful user login page in your browser

Figure 23.4. Show hashed password in user’s show page in browser

Figure 23.5. Incorrect password screen in browser

Figure 23.6. Failed express-validator validation messages

Lesson 24. Adding User Authentication

Figure 24.1. Example of a successful login in the browser

Figure 24.2. Example of a successful user logout in the browser

Lesson 25. Capstone: Adding User Authentication to Confetti Cuisine

Figure 25.1. Successful login on Confetti Cuisine

Lesson 26. Adding an API to Your Application

Figure 26.1. Display of JSON course results in browser

Figure 26.2. Display of courses in MongoDB

Figure 26.3. Simple modal button in navigation bar

Figure 26.4. Populating course data within modal

Lesson 27. Accessing Your API from Your Application

Figure 27.1. Adding a join button

Figure 27.2. Example modal after a course has been joined

Lesson 28. Adding API Security

Figure 28.1. Displaying the API token on the user’s show page

Lesson 29. Capstone: Implementing an API

Figure 29.1. Application structure with routes folder

Figure 29.2. Modal button in layout navigation

Figure 29.3. Showing course listing through modal in browser

Figure 29.4. Trying to enroll before logging in

Figure 29.5. Successfully enrolling in a course

Lesson 30. Working with Socket.Io

Figure 30.1. Polling between a client and server

Figure 30.2. Opening a web socket connection between a client and server

Figure 30.3. Displaying chat view

Figure 30.4. Displaying text in the chat box

Lesson 31. Saving Chat Messages

Figure 31.1. Displaying chats with two sockets

Figure 31.2. Styling user messages with two sockets

Figure 31.3. Showing user names with two sockets

Lesson 32. Adding a Chat Notification Indicator

Figure 32.1. Displaying user disconnects in chat

Figure 32.2. Animating the chat icon in the navigation bar

Lesson 34. Deploying your application

Figure 34.1. Displaying the Heroku error page

Figure 34.2. Displaying the Heroku courses page

Lesson 35. Managing in production

Figure 35.1. Display of the populated courses page

Lesson 36. Testing your application

Figure 36.1. Displaying passing tests in terminal

Lesson 37. Capstone: Deploying Confetti Cuisine

Figure 37.1. Application not loading on Heroku

Figure 37.2. Displaying contents of mLab database

Figure 37.3. Loading the home page

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset