FSWD · MERN Stack · Three letters land
Everything you've built so far ran inside someone's browser — and every order the form ever collected had nowhere to be saved. This unit builds the other half of full-stack: Node servers, Express APIs, a real MongoDB database, and a Redis cache in front of it.
Your 15 sessions, in order
The unit's biggest structural moment comes first: folder fork #2. A server isn't a browser page — it can't live inside poshtik-campus/ or poshtik-campus-react/ — so Class 29 creates poshtik-campus-server/ fresh, after explaining exactly why. Three rounds this unit, not two: raw Node, then Express, then the database and cache.
Why a server-side language at all — a real order needs somewhere to be saved. Folder fork #2 explained plainly, Node re-verified from Class 21's install, the REPL as your first browserless JavaScript, and running a .js file with node.
SOONWhat a module is, fs.readFile vs fs.readFileSync side by side, the classic async print-order surprise — and your bilingual menu saved as menu.json, the first real file the server project owns.
SOONhttp.createServer and your first server answering a real browser at localhost:3000, the url module parsing paths, hand-rolled routing with if/switch (the "poor man's router"), and a real 302 redirect watched in the Network tab.
SOONThe package registry behind that npm create vite moment from Class 21 — npm init and your server's own package.json, installing packages, node_modules, dependencies vs devDependencies, and the npm start convention.
SOONSame poshtik-campus-server/ from Class 32 — today it becomes a running server: menu.json read with fs and served at /menu, plus / and /contact routes, all raw Node. Closes with the honest itch: hand-rolling every path doesn't scale.
SOONCallbacks formalised, a synchronous file read genuinely freezing a server for everyone — felt, then fixed. The events module with a custom orderPlaced event, and why Node's one-thread, non-blocking style suits this work.
SOONThe exact tedium of Class 31's hand-rolled router, removed. npm install express, a first app in three lines shown side by side with the raw version, routing basics — and the Poshtik Campus menu returned as real JSON for the first time.
SOONNative modules named and tied back to Classes 29–31, reading a request body with express.json() (and the body-parser story the exam still asks), your order form's data reaching a server for the first time, and honest status codes.
SOON?category=millet filtering the menu with req.query — your Unit-2 .filter() working server-side now — plus what middleware really is, a logging middleware you write yourself, and a stub previewing Unit 5's JWT auth shape.
SOONSame server folder, now a complete API: GET /menu with the full bilingual list, GET /menu?category=... filtered, and POST /order validating the order form server-side — the API your Unit-3 React app will eventually call. One catch remains: orders still vanish on restart.
SOONLab 9's vanishing orders get their diagnosis: in-memory data. What a database is, SQL vs NoSQL compared honestly, six real scenarios sorted between them — then MongoDB and Compass installed and toured.
SOONThe dishes collection created, one document inserted, then the full 10-item bilingual menu seeded with insertMany — so find(), findOne() and the $gt/$lt/$regex operators run against real data with real, meaningfully-partial answers.
SOONupdateOne with $set, deleteOne, a full insert-update-delete sequence from a written spec — then the official driver connects Node to MongoDB and Lab 9's /menu route reads from the real dishes collection instead of a hardcoded array.
SOONAtlas, indexing and aggregation surveyed — then the unit's final idea: what if the same query runs a thousand times a minute? Redis installed, SET / GET / EXPIRE, and the /menu route checking the cache first, falling back to MongoDB on a miss.
SOONOpens with the MERN payoff — all four letters, all built by you. Then the finale: the menu seeded into MongoDB, POST /order saving into a real orders collection, Redis caching on the busiest route, and the Unit-4 recap with exam strategy.
SOONThe running project · folder fork #2
Poshtik Campus పౌష్టిక్ క్యాంపస్ · poshtik-campus-server/ begins
The data is still the continuity: the same bilingual menu from Class 17's poshtikMenu array becomes menu.json in Class 30, then MongoDB's dishes collection in Class 38 — the exact 10 items, never a toy dataset. By Lab 10, the order form you built in Unit 1 has a real API validating it and a real database remembering it.
poshtik-campus-server/ — a real Node project with its own package.json (Class 32), growing through all three labsGET /menu, GET /menu?category=... and a validating POST /order (Lab 9)dishes and orders collections — data that finally survives a restart (Lab 10)This terminal is live — boot the server, then fire the requests yourself. Watch /menu go from cache MISS to cache HIT, and watch the bad order get rejected. Terminal truth is this unit's habit.