Project Setup & the Current Express Baseline
Website Rebuild with Express
Chapter 1 · Project Setup & the Current Express Baseline
This is the sixth and truly final course in the Website Rebuild series, alongside the already-complete Next.js, Django, Laravel, Rails, and Astro rebuilds. It builds on this site's own existing express1/express2 courses and the Food Tracker (React + Express) project — this chapter assumes the language and the basic Express mental model are already familiar ground.
Scaffolding the Project
The Minimal Server
Confirmed: The Most Minimal Framework in the Series
app.set('view engine', 'ejs') is a literal, explicit statement — Express itself has no default rendering engine at all, and would run exactly the same way if this line named Pug, Handlebars, or Nunjucks instead. Nothing about "how views render" is Express's own opinion; it's entirely the developer's choice, stated once, in one line.
No ORM, No Routing Convention, No Session Handling
mysql2 is a plain database driver, not an ORM — Chapter 2 writes real SQL directly, continuing the same deliberate choice the Food Tracker (React + Express) course already made for this exact stack. Express's own routing is a thin method-chaining API (app.get(), app.post()) with no file-based or convention-driven routing at all — every route is registered by hand. Session handling, request validation, CSRF protection — none of it exists until a specific package is chosen and installed for it, chapter by chapter, starting here.
Six Frameworks, Compared Honestly
| Next.js | Django | Laravel | Rails | Astro | Express | |
|---|---|---|---|---|---|---|
| Built-in ORM? | No | Yes | Yes | Yes | No | No |
| Built-in rendering engine? | Yes (JSX) | Yes (DTL) | Yes (Blade) | Yes (ERB) | Yes (Astro syntax) | No — chosen explicitly |
| Built-in routing convention? | Yes — file-based | Explicit but built in | Explicit but built in | Explicit but built in | Yes — file-based | No — hand-registered |
| Built-in session handling? | No | Yes | Yes | Yes | No | No |
Hands-On Exercises
Scaffold a new Express project, and confirm a minimal "Hello World" route responds correctly at http://localhost:3000.
📄 View solutionRemove app.set('view engine', 'ejs'), attempt to call res.render() from a route, and confirm Express has no default rendering engine to fall back on.
📄 View solutionInspect the freshly scaffolded project's package.json, and confirm nothing beyond express, ejs, and mysql2 exists yet — no ORM, no session library, no validation library.
📄 View solutionChapter 1 Quick Reference
npm install express ejs mysql2— the entire starting stackapp.set('view engine', 'ejs')— Express has no default templating engine at all- The most minimal framework in the series — no ORM, no routing convention, no session handling, no built-in rendering
mysql2— a plain driver, not an ORM, continuing the Food Tracker (React + Express) course's own established choice- Next chapter: Designing a Flexible URL & Content Model