π§© Week 10 β Node.js + Express.js Basics
π― Goal: Learn the fundamentals of Node.js and Express to build backend APIs and servers.
π Daily Breakdown
β
β Day 1 β Introduction to Node.js
π§ Topics:
- What is Node.js? How it works (Event Loop)
- Installing Node.js and npm
- Creating a simple "Hello World" server
- Core modules: fs, http, path
π Activities:
- Install Node.js & verify with node -v
- Create a simple HTTP server on localhost
- Log requests and send custom responses
β
β Day 2 β Node Modules & File System
π§ Topics:
- Using built-in modules: fs, os, path
- Creating and reading files
- Writing and appending to files
- Synchronous vs Asynchronous operations
π Activities:
- Create a script to log server stats
- Build a note-taking file writer (like a diary)
- Read user data from JSON file
β
β Day 3 β Introduction to Express.js
π§ Topics:
- What is Express? Why use it?
- Installing Express via npm
- Express routing: GET, POST
- Setting up a basic REST API
π Activities:
- Initialize npm (npm init -y)
- Build a server with Express
- Create sample routes: /, /about, /contact
β
β Day 4 β Middleware & Static Files
π§ Topics:
- What is middleware? How it works in Express
- Creating custom middleware
- Serving static HTML/CSS/JS from βpublicβ folder
- Using built-in express.static()
π Activities:
- Build a logging middleware (logs each request)
- Serve a static portfolio website from Express
- Use express.json() and express.urlencoded() middleware
β
β Day 5 β REST API Basics
π§ Topics:
- RESTful principles: GET, POST, PUT, DELETE
- Using Postman for API testing
- CRUD API with in-memory data
- Response codes: 200, 201, 400, 404
π Activities:
- Create an in-memory product API
- Test endpoints via Postman
- Return appropriate JSON responses
β
β Day 6 β CRUD Project: Mini Contact Manager
π§ Tasks:
- Setup Express server
- Create routes to:
- Get all contacts
- Add new contact
- Update contact
- Delete contact
- Use array to store contacts temporarily
π Bonus:
- Add simple frontend using fetch()
β
β Day 7 β Quiz + Practice & Wrap-Up
π§ Tasks:
- Review all concepts (Node + Express + REST)
- Build mini REST API from scratch (To-do or Notes)
- Quiz: 15 MCQs (Node.js, Express basics, HTTP)
- Code Challenge: Debug broken API routes
β
Ready to move forward with π§© Week 11 β MongoDB + Mongoose integration?