- Learning Objectives
- Suggested Study
- Sundays & Projects
- Class Recordings
- Curriculum (external)
- HYF Home (external)
expand/collapse
- π₯ HTTP: You can explain these basic notions of the HTTP protocol, the main verbs, headers, ...
- π₯ Client/Server Architecture: You can draw a diagram of your project explaining how the front- and back-ends connect, and can generalize this idea to any web app they use.
- π₯ Persistence: You can explain what persistence is and how it is used in the backend of a web app. You can implement persistence using the backend's file system.
- π₯ Postman: You can use Postman to test and inspect HTTP request/response cycles.
- π₯ VSCode Debugger: You can use breakpoints to pause and step through a Node.js scripts and APIs using the VSCode debugger.
- π₯ Promisification: You can convert built-in node modules from consuming callbacks being
async
functions. - π₯ NPM Modules: You can find, install, require and use an NPM module in your projects
- π₯ Function Roles: You can explain and apply these 4 function roles in your backend code:
- controllers: like event handlers, but for HTTP requests. (like event handlers in the frontend)
- middleware: do things with a request before it is handled. (no frontend analogy)
- data access: read/write from your data source and return the prepared data, in this module the data source is the file system. (like api calls in the frontend)
- logic: pure functions that transform data and have unit tests. (same as for the frontend)
- utils: functions with side-effects that do one helpful thing. (like procedures in the frontend)
- π₯ Express.js: You can ...
- listen a new server
- use middleware
.get
,.post
,.put
,.delete
- route params
- request body
- send response
- Express Router
- static serving
- π₯ Entry Points: You can identify the entry points for your app:
- Initialization: npm scripts, first file, configuration points, server listening
- Request/Response Cycle: first middleware, logging, routes, error handling
- π₯ API Documentation: You can use JSDoc-style comments to document your API, and a documentation script to build API documentation
- π£ File System: You can read, write and append to .txt files. You can can parse, manipulate and re-save data stored in a .json file using the built-in
fs
andutil.promisify
functions. - π£ Data Validation: You can validate data sent in a request to the backend before saving it to a .json file
- π£ RESTful Routes: You can implement RESTful routes in Express.js, including using the correct
app._
verbs. - π£ Authentication: You can explain the principles of authentication and can contribute to a group project that has basic authentication
- π£ Authentication vs. Authorization: You can explain the difference and how it is implemented in your projects
- π£ Environmental Variables: You can explain what an environmental variable is, what they're used for, and how they're configured
- π£ Backend Configuration: You can use environmental variables to launch your backend in different modes
- π₯ Asynchronous Callbacks: You can read, trace and complete simple scripts that use callbacks to work with the file system
- π₯ CI Deployment: You can set up a deployment for your web apps and connect it to your repository using a CI action so
main
/master
is always deployed. - π CLI Apps: You can complete a simple CLI app that takes user input from the command line and accesses the file system
- π
node-fetch
: You make API requests from the backend, and use the data in your web apps - π Testing Routes: You can explain how tests for API routes work, and can write routes that pass given tests. You can also write tests for a route that already exists.
References and Practice to help you master this module.
expand/collapse
- What is it? How to use it?
- packages for fun:
- cowsay - make cows say things
- packages for serious:
- node-fetch - Make API requests from Node
- express - Minimalist web framework for node
- express.urlencoded() - Parse HTTP request body into JS object
- cors - Cross Origin Resource Sharing for Express
- morgan - logging for Express
- joi, tv4 - JSON schemas & validation
Postman - use your APIs without a frontend
- Getting started with Node.js debugging in VS Code
- Burke Holland
- VSCode Channel Intro
- James Q Quick
- CodeSpace, 2 Ways
- 101
- Mosh: Node.js in 1 hour
- Traversy: Node for Absolute Beginners
- Traversy: Node.js Crash Course
- NetNinja: Node Js Crash Course
argsv
- Use command line arguments in Node
- Built-In Modules
- The file system (first 20 minutes)
- references
- assert - Test values in Node.js
- fs - Read & write form the file system
- path - Manipulate file paths
- util.promisify - Convert functions that take callbacks into Promises
- API Calls
- node-fetch: a module for using
fetch
syntax in Node.js - To study a full app with
node-fetch
, head over to weather-it-promised & weather-it-async-await - /node-fetchemon (exercises to practice
node-fetch
)
- node-fetch: a module for using
- Middleware: tutorialspoint, express.js guide, writing middleware (video)
- Static Serving: alligator article, codedamn video
- Error Handling Middleware:
- CORS: Cross Origin Resource Sharing
- HTTP Statuses
- What is Express?
- LearnWebCode
- Traversy: Express.js Crash Course Build RESTful APIs with Node and Express by Mosh
- How To Build a Job Search App (Node, APIs, Vanilla JS): video, code
- Error Handling
Router
config
file: how to
- π£
/using-express
: examples and exercises covering how to use express to build a web app. - **[
/reverse-engineer'](./reverse-engineer)**: projects with a
demo.min.js` file to reverse-engineer- π£
/textidor-series
- π₯
/cowsaydex
- π£
- π₯π£π₯π
/example-apps
: a variety of projects to study with code organized in different ways. some are simple and some are advanced. Enjoy! - π `/node-fetchemon'
- π node-practice-replace (separate repo)
- π pokedex-api (separate repo)
- π diy-wiki (separate repo)
Directly from GitHub
From Terminal
- Heroku Getting Started
- Scotch Tutorial
- Heroku devhints
- Heroku DevCenter: Node.js Support
- Heroku DevCenter: Advanced Automation
Founders and Coders is another open-source course in web development. They have some great resources for learning Node, Express and Web Apps
- Developing an Express API with RESTful routes
- Persisting API data to the file system using a .json file
expand/collapse
- Have Node
- Install NVM (node version manager)
- Make sure you have the latest Node.js installed (16..)
- The Net Ninja, Introduction to Node.js(video, for this week watch at least first 2 lessons or up to 5th, unfortunately lesson 6 about Express is outdated due to the new version of Express, where some methods were deprecated)
- Postman: install it and make an API request -Postman tutorial (video, you need only first half 'Unit 1') -Express
- What is Express?(article)
- LearnWebCode(video)
- Error-First Callbacks
- fredkschott (article)
- David Connelly (video)
- Read and run ./example-apps/storage-server
- You do not need to understand everything, just enough that it's not totally new.
- What are servers? What's a server-client architecture?
- What is NodeJS?
- How can we use the Expressjs library to build servers on NodeJs?
- What's the difference between static and dynamic data?
- How can we serve simple static data? (route params, query params, static-server)
- HTTP Methods (Verbs)
- Walkthrough of a starter-project where one path has been fully implemented
- Class project: implement the missing path
No project! There's enough to study without one ;)
If you want to begin preparing for the group project in Week 3 you can begin experimenting with the Web Apps Starter Repo
- HTTP Status Codes
- POST Requests and the Body
- Using Postman
- How do we store/load data (memory vs. file system)?
- How do we separate our concerns? (multi-tier architecture)
- Using middleware
- Logging
- Validation
- Error Handler
expand/collapse
Again, no project. Just more study and prep for next week.
- CORS
- Authentication (BasicAuth, followed by Token-Based Auth, simple-password storage)
- Authorization
- Authentication vs. Authorization
expand/collapse
Lecture on CORS and Authentication/Authorization.
Implement some form of authentification, preferably Basic Authentification in this project
- Token-based auth with hashed password storage
- JWT - JSON Web Tokens (fancy authentication)
expand/collapse
code review
review common problems as a class
continue group project
- finish group project
expand/collapse
code review
review common problems as a class
continue group project
- Students: Here you can find recordings of this module from past classes. Enjoy!
- Coaches: When sending your PR's with links please ...
- Indicate which class you were teaching
- Which week it was (if the module is more than 1 week)
- Give your name
- and a helpful description
Class 7-8
- week 1:
- Part 1: Node, Web Apps, CLI's,
fs
,process.argv
,assert
- Part 2: Exercise recap, Project intro
- Wrap-up: Homework explanation
- Part 1: Node, Web Apps, CLI's,
- week 2:
- week 3:
- week 4
Class 9-10
- Week 1
- Week 2
- Week 3
- Week 4:
Class 11-12
- Week 1: part 1, part 2, part 3, part 4
- Week 2: part 1, part 2, part 3, part 4, part 5
- Week 3: Refactoring pt. 1, Refactoring pt. 2, middleware & error handling, homework
- Week 4: JSON Schemas, Schema Validation,
t4v
validation library, conclusion