Node.js / TypeScript
Weekly Goalsβ
- Backend
- Understand HTTP fundamentals and build a basic REST API in Node.js.
- Learn Express or Fastify (pick one to start; you can compare later).
- Implement routing, basic controllers, and error handling.
- DSA
- Continue arrays/strings and sliding window; add some linked list basics.
- Theory
- Deeper HTTP concepts: headers, status codes, idempotency.
Use with:
- 16-Week Roadmap
- Projects (start backend for a small service, e.g., URL shortener)
Weekly Overview Tableβ
| Day | Focus |
|---|---|
| 1 | HTTP basics & Node HTTP module |
| 2 | Express/Fastify setup & basic routes |
| 3 | Controllers, services, simple architecture |
| 4 | Input validation & error handling |
| 5 | Basic auth stub & middleware |
| 6 | Mini REST API project (e.g., URL shortener v1) |
| 7 | Weekly review & small mock API design discussion |
Day 1 β HTTP Basics & Node HTTP Moduleβ
4-Hour Planβ
-
Block 1 (Concepts β 60β75 min)
- Review HTTP:
- Methods (GET, POST, PUT, DELETE, PATCH).
- Status codes (2xx, 3xx, 4xx, 5xx).
- Headers, query params, path params, request body.
- Review HTTP:
-
Block 2 (Hands-On β 60 min)
- Use Nodeβs built-in
httpmodule:- Build a simple server that responds with JSON.
- Parse URL and route to different handlers manually.
- Use Nodeβs built-in
-
Block 3 (DSA β 60 min)
- 2β3 problems (arrays/strings/sliding window).
-
Block 4 (Review β 30 min)
- Draw a simple request-response diagram for your server.
6-Hour Planβ
- Add:
- Extended exercise (60 min):
- Implement basic routing logic with a map of path β handler.
- Extended exercise (60 min):
Day 2 β Express/Fastify Setup & Basic Routesβ
4-Hour Planβ
-
Block 1 (Setup β 60β75 min)
- Pick Express or Fastify:
- Initialize project with TS.
- Set up
src/app.ts,src/server.ts.
- Pick Express or Fastify:
-
Block 2 (Routing β 60 min)
- Implement:
- Routes:
GET /health,GET /items,POST /items. - Use a simple in-memory array as storage.
- Routes:
- Implement:
-
Block 3 (DSA β 60 min)
- 2β3 problems (linked list basics or arrays).
-
Block 4 (Review β 30 min)
- Note differences between your manual HTTP server and Express/Fastify.
6-Hour Planβ
- Add:
- Refactor (60 min):
- Separate routes into their own module.
- Add a basic logger middleware (console-based).
- Refactor (60 min):
Day 3 β Controllers, Services, and Simple Architectureβ
4-Hour Planβ
-
Block 1 (Architecture β 60β75 min)
- Learn layered architecture:
- Controller β Service β Repository (even if repository is in-memory for now).
- Learn layered architecture:
-
Block 2 (Hands-On β 60 min)
- Refactor API:
- Create
controllers/,services/,repositories/folders. - Move business logic to services.
- Create
- Refactor API:
-
Block 3 (DSA β 60 min)
- 2β3 problems mixing previous topics.
-
Block 4 (Review β 30 min)
- Draw ASCII diagram of your appβs layers.
Client
|
v
Controller -> Service -> Repository -> In-memory storage / DB (later)
6-Hour Planβ
- Add:
- Unit tests (60 min):
- Test at least one service function with Jest.
- Unit tests (60 min):
Day 4 β Input Validation & Error Handlingβ
4-Hour Planβ
-
Block 1 (Concepts β 60β75 min)
- Learn:
- Request validation (basic manual checks or library).
- Error handling middleware in Express/Fastify.
- Learn:
-
Block 2 (Hands-On β 60 min)
- Add:
- Validation for
POST /items. - Centralized error handler returning JSON error responses.
- Validation for
- Add:
-
Block 3 (DSA β 60 min)
- 2β3 problems (arrays/strings/sliding window).
-
Block 4 (Review β 30 min)
- Write down standard error response format you will use (e.g.,
{ message, code, details }).
- Write down standard error response format you will use (e.g.,
6-Hour Planβ
- Add:
- Negative test cases (60 min):
- Write tests for invalid inputs and error handling.
- Negative test cases (60 min):
Day 5 β Basic Auth Stub & Middlewareβ
4-Hour Planβ
-
Block 1 (Concepts β 60β75 min)
- Read about:
- Basic auth flows (email/password, tokens).
- Middleware concept in Express/Fastify.
- Read about:
-
Block 2 (Hands-On β 60 min)
- Implement:
- A stub auth middleware that checks for a hardcoded API key or token.
- Protect some routes with this middleware.
- Implement:
-
Block 3 (DSA β 60 min)
- 2β3 problems (linked lists / arrays).
-
Block 4 (Review β 30 min)
- Note how auth middleware will evolve later (JWT, sessions).
6-Hour Planβ
- Add:
- Refactor routes (60 min):
- Add role-based access stub (e.g.,
X-Role: adminheader).
- Add role-based access stub (e.g.,
- Refactor routes (60 min):
Day 6 β Mini REST API Project (URL Shortener v1 or Simple Resource API)β
4-Hour Planβ
-
Block 1 (Design β 45β60 min)
- Choose:
- Simple URL shortener v1 (in-memory mapping), or
- Simple task manager API.
- Define endpoints and data model.
- Choose:
-
Block 2 (Implementation β 90 min)
- Build:
- CRUD endpoints.
- Use layered architecture.
- Add logging and error handling.
- Build:
-
Block 3 (Review β 30β45 min)
- Identify:
- Where you will later plug in DB and Redis.
- Identify:
6-Hour Planβ
- Add:
- Extra features (60 min):
- Pagination for list endpoints.
- Basic filtering via query params.
- Extra features (60 min):
Day 7 β Weekly Review & Small Mock API Designβ
4-Hour Planβ
-
Block 1 (Review β 60β75 min)
- Revisit:
- HTTP methods, status codes.
- Express/Fastify routing and middleware.
- Your mini REST API design.
- Revisit:
-
Block 2 (Mock API Design β 60 min)
- Whiteboard/design:
- APIs for a simple note-taking app:
POST /notes,GET /notes,GET /notes/:id, etc.
- APIs for a simple note-taking app:
- Whiteboard/design:
-
Block 3 (DSA β 45β60 min)
- 2β3 mixed problems, focusing on weakest topic.
6-Hour Planβ
- Add:
- Self-interview (45β60 min):
- Explain your API design out loud, focusing on:
- Resource naming.
- Status codes.
- Error handling.
- Explain your API design out loud, focusing on:
- Self-interview (45β60 min):