adr-2026-05-21-nextjs-mongodb-authjs-stack

acceptedtype/adr

ADR — Next.js + MongoDB + Auth.js stack & delivery

TL;DR

Deliver Museum Ibu Marsinah as one Next.js application on Vercel with MongoDB, Auth.js (Google + credentials) and admin / user roles, static landing content from /public until CMS depth is known, local dev + Vercel prod, reusing the proven LumenDev Invoice auth shape for speed.

Context

  • Client deadline 2026-05-25; full brief arrives 2026-05-22 (Friday night).
  • LumenDev standard stack: [[Resources/Tech/Personal default fullstack stack]].
  • Booking rule requires identified users → auth cannot be deferred.

Decision

| Topic | Choice | |-------|--------| | Architecture | Single Next.js fullstack (App Router, Server Actions/API routes as needed) | | Database | MongoDB (Atlas, LumenDev-operated) | | Auth | Auth.js v5 — Google OAuth + email/password; JWT sessions + Mongo adapter pattern per [[Resources/Tech/Auth.js/Auth.js Next.js JWT Google MongoDB adapter pattern|Tech note]] | | Roles | admin (content + booking oversight), user (book Rumah Singgah) | | Content v0 | Files under /public + minimal editable fields only if admin CMS is in p0 | | Environments | development = local; production = Vercel | | Hosting | Vercel project under LumenDev account | | Repo | lumendev-museum-ibu-marsinah on LumenDev GitHub |

Consequences

  • Positive: Fast bootstrap by cloning Invoice auth/middleware patterns; one deploy surface; fits team skillset.
  • Negative: /public-only content is awkward for non-dev editors until CMS lands; may need quick admin CRUD after Friday.
  • Risks: Scope creep on “manage content” — gate behind admin MVP (list/edit key fields) not full page builder.

Alternatives considered

  • Separate CMS (Sanity, etc.) — rejected for v0 (integration time).
  • Clerk / hosted auth — rejected (new vendor + deadline); Auth.js already proven in-house.
  • Split frontend + API repos — rejected (ops overhead for UMKM timeline).

References

  • [[Projects/lumendev-invoice/decisions/adr-2026-05-15-nextjs-mongodb-invoice-stack-snapshot|Invoice stack snapshot]]
  • [[Projects/lumendev-museum-ibu-marsinah/context/client-brief-initial|Client brief]]