This page consolidates the current ignitionstack.pro architecture. It links the living code in ../src, captures our decision process (ADR + RFC), and documents the system with C4 Model diagrams so newcomers can reason about structure before touching code.
| Artifact | Purpose | Location |
|---|---|---|
| ADR (Architecture Decision Record) | Immutable record of why a structural decision happened. | content/architecture/adr-*.mdx |
| RFC (Request for Comments) | Proposal for upcoming work. Describe problem, goals, alternatives, rollout plan. Submit as docs/rfc/{id}-{slug}.mdx and link it here once approved. | docs/rfc/ (repo root) |
| C4 Model Diagrams | Visualise context, containers, and core components. Maintained in this page with Mermaid for repeatability. | This page |
When introducing a new subsystem:
Context, Container, or Component).src/app.src/app/[locale]/ renders via React Server Components. Client-only features (chat input, analytics) use "use client" boundaries and hooks.src/app/actions/* (mutations) and src/app/server/* (queries) orchestrate logic. All mutations must return ActionResult<T> and log via createServiceLogger.src/app/lib/repositories/* encapsulate Supabase calls, convert to typed entities (src/app/lib/mappers/*), and enforce per-entity validation. Supabase clients live in src/app/lib/supabase/{client,server,admin}.ts and respect RLS vs. admin contexts.src/app/lib/logger.ts, analytics hooks (src/app/hooks/use-page-view.ts, use-click-tracking.ts), and GA/Playwright instrumentation described in /content/analytics/* and /content/testing/index.mdx.src/app/api/*) receive Stripe/Resend callbacks, call server actions/repositories, and use revalidateTag to keep cached UI in sync.| Layer | Key Modules | Notes |
|---|---|---|
| Presentation | src/app/[locale]/(pages), src/app/components/*, src/app/hooks/* | Always load data via server queries or cached repositories. |
| Application | src/app/actions/*, src/app/server/* | Server actions are mutation-only; server queries are read-only, both return typed data. |
| Domain | src/app/lib/repositories/*, src/app/lib/mappers/*, src/app/lib/analytics-events.ts | Repository pattern centralizes Supabase, Analytics registry centralizes GA4 events. |
| Infrastructure | src/app/lib/supabase/*, supabase/migrations/*, scripts/test-build.sh | Supabase clients, migrations, and operational scripts. |
| Observability & Quality | content/analytics/*, src/app/test/**/*, playwright.config.ts, vitest.config.ts | Structured logging, GA4 specs, Vitest + Playwright suites. |
| ID | Title | Summary | Status |
|---|---|---|---|
| RFC-002 (Planned) | Multi-tenant billing | Defines tenant-boundary caching, per-tenant metadata, and Stripe customer portal flows. | Draft (submit to docs/rfc/002-multitenant-billing.mdx) |
| RFC-003 (Planned) | AI Chatbot enterprise hardening | Formalizes throttling + retention for /chat. | Draft |
content/architecture and link it from the table.src/app/lib/validations/* before reaching repositories.revalidateTag or revalidatePath for every cache tag touched in queries, otherwise stale UI persists./content/testing/index.mdx.This page is the canonical place for architecture shape; keep it synchronized with src/ so devs, reviewers, and AI agents operate with the same mental model.