Full-Stack Integration & Deployment — Revision Notes
Condensed from Overview, Intermediate, Advanced, and Troubleshooting — for quick review, not first-time learning.
The core shape
A full-stack app = frontend (React/Next.js) → backend API (Express or Next.js API routes) → database (PostgreSQL, typically) → protected by auth → deployed somewhere real. Most real difficulty lives at the seams between these pieces, not inside any one piece — that's this whole technology's premise.
CORS
origin: '*' combined with credentials: truelocalhost, broke immediately after deploying frontend and backend to different real domainsEnvironment variables
NEXT_PUBLIC_ in Next.js) = baked into the shipped JS bundle at build time, readable by anyone via dev toolsAuth token flow (memorize this chain, not just the pieces)
Login form → POST credentials → backend verifies + issues token → frontend stores token → frontend attaches token (Authorization: Bearer ) on every subsequent protected request → backend middleware verifies token before the route handler runs → req.user available to the handler.
A break anywhere in this chain produces the same symptom (401) — trace the whole chain, don't guess at one link.
Status code discipline (frontend and backend must agree)
400 — malformed request, frontend-fixable401 — missing/invalid auth → frontend should clear token, prompt re-login403 — authenticated but not permitted → do NOT clear token or prompt re-login404 — resource doesn't exist500 — genuine backend/DB failure, not fixable by changing the requestAI-assisted development
Good fit: boilerplate, tests for logic you understand, unfamiliar syntax lookups. Keep human judgment: architecture decisions, anything security-sensitive (auth, DB queries touching user input). The actual professional skill: scoped prompting + reviewing output like a teammate's PR, being able to explain every shipped line.
Deployment topology
Environment parity / drift
Dev/staging/production should be configured as identically as practical. Drift (an env var set in staging but never set in production; a database version mismatch) is one of the most common full-stack-specific bug sources — because a full-stack app has more independently-configured pieces than a single-technology app.
Explicit scope boundary — what this technology deliberately does NOT teach in depth
This scoping is deliberate and load-bearing, not a content gap — this technology teaches the integration points only.
Top 5 troubleshooting patterns (see Troubleshooting tab for full detail)
localhost URL instead of an env-var-driven oneVersioning Note
The following are genuinely volatile and should be rechecked against current sources, not treated as fixed: specific deployment platforms' exact current free-tier limits, pricing, and feature sets (Vercel, Railway, Render, and any others) (needs verification — recheck against current source); AI coding assistant tooling specifics — which tools exist, their exact current capabilities, and how they're best used in a real workflow — this space moves fast and genuinely changes month to month (needs verification — recheck against current source). The durable parts of this technology — CORS as a browser mechanism, the frontend/backend/database/deployment architecture shape, the public/private environment-variable security distinction, and the general integration-layer skill itself — are stable and do not need this caveat.

