Architecture
Decisions (ADRs)
ADR-003: Monolith First

ADR-003: Single Next.js Monolith for MVP

Status: Accepted Date: 2026-02

Context

Envara has several distinct surfaces: marketing site, creator dashboard, respondent questionnaire, report viewer, and API. These could be deployed as separate services or as a single application.

Decision

Build a single Next.js application using the App Router. All surfaces share one codebase, one deployment, and one database connection. Clear directory structure separates concerns for future decomposition if needed.

Alternatives Considered

OptionProsCons
Single Next.js appOne deployment, shared code, fast iterationMonolith risks (coupling, deploy frequency)
Separate frontend + APIClear separation, independent scalingTwo deployments, API contract overhead, slower iteration
Micro-frontendsIndependent team scalingMassive overkill for a solo founder

Consequences

Positive:

  • One git push deploys everything.
  • Shared types, components, and utilities across all surfaces.
  • Vercel handles the infrastructure — no ops overhead.
  • Developer velocity is maximised during the critical first 8 weeks.

Negative:

  • All surfaces share a deploy cycle (mitigated by Vercel preview deployments).
  • A bug in the dashboard could theoretically affect the respondent questionnaire (mitigated by route-level error boundaries).

Exit strategy: If scale demands it, the respondent questionnaire (/r/[token]) is the most likely candidate for extraction — it's the highest-traffic, lowest-complexity surface with no auth dependency. The directory structure supports this.