mern-stack-architecture
Installation
SKILL.md
MERN / Full-Stack Architecture Skill
Helps decide the right full-stack shape instead of defaulting to "add an Express server" out of habit.
Decision: do you even need a separate Express backend?
- No separate backend (default for most SaaS/web apps): Next.js Server Actions + Route Handlers talking directly to the database (via an ORM) cover the vast majority of CRUD, auth, and mutation needs with less operational overhead.
- Separate backend service justified when: you need a long-running process (websockets/queues/cron beyond what serverless allows), the API must be consumed by multiple independent clients (mobile app + web + third parties) with its own versioned contract, or you have heavy compute that shouldn't run in the Next.js deploy target.
Modern MERN stack (2026 defaults)
- M: MongoDB (Atlas) with Mongoose, or increasingly Postgres (Supabase/Neon) with Prisma/Drizzle when relational integrity matters — pick based on data shape, not habit.
- E: Express only when a standalone service is justified (see above); otherwise Next.js Route Handlers replace it.
- R: React (via Next.js App Router, not bare CRA/Vite for anything production-facing that needs SSR/SEO).
- N: Node.js runtime, or Next.js's own server runtime for the unified case.