Architecture Overview¶
System Diagram¶

High-Level Architecture¶

Components¶
Application Layer¶
| Component | Technology | Purpose |
|---|---|---|
| Web Framework | Next.js 15 | App Router, React Server Components |
| Language | TypeScript 5.7 | Strict mode enabled |
| ORM | Prisma | Database access |
Infrastructure Layer¶
| Component | Technology | Purpose |
|---|---|---|
| Compute | AWS App Runner | Serverless container hosting |
| Database | AWS RDS SQL Server | Relational database |
| Container Registry | AWS ECR | Docker image storage |
| DNS | Cloudflare | DNS and CDN |
| Security | Cloudflare Access | Zero Trust authentication |
DevOps¶
| Component | Technology | Purpose |
|---|---|---|
| CI/CD | GitHub Actions | Build, test, deploy |
| IaC | Terraform | Infrastructure provisioning |
| Secrets | AWS Secrets Manager | Sensitive configuration |
Project Structure¶
luminarium-proof/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── api/health/ # Health check endpoint
│ │ ├── layout.tsx # Root layout
│ │ └── page.tsx # Home page
│ ├── lib/
│ │ ├── db.ts # Prisma client
│ │ └── cloudflare-keys.generated.ts
│ └── middleware.ts # JWT validation
├── prisma/
│ └── schema.prisma # Database schema
├── infra/
│ └── app/ # Terraform configs
├── docs/ # Documentation (this site)
├── .github/workflows/ # CI/CD pipelines
└── .rules/ # Coding standards
Data Flow¶
Request Flow (Authenticated)¶
- User navigates to
luminarium-proof-dev.luminarium.ai - Cloudflare Access intercepts request
- User authenticates with email (OTP or Google)
- Cloudflare issues JWT token
- Request forwarded to App Runner with JWT
- Middleware validates JWT using embedded public keys
- Request processed by Next.js application
- Database queries via Prisma (if needed)
- Response returned through Cloudflare
Health Check Flow (Public)¶
- Request to
/api/health(no auth required) - Middleware skips JWT validation for this path
- Health endpoint checks database connectivity
- Returns JSON status
Future Architecture (Post Stage 0)¶

Future stages will add:
- NextAuth.js - Application-level authentication
- LangChain - AI agent orchestration
- AssemblyAI - Voice transcription
- Logfire - Observability and tracing