Components
--
-
- Web: Next.js app (App Router), server-rendered pages, client hooks for auth state. -
- API routes: Authentication, admin approvals, listings CRUD (soft-delete), profile update. -
- Data: Postgres via Prisma (models: User, Listing, ListingTranslation, ListingImage, VerificationToken). -
- Mail: SMTP (smtp.sohva.org) + DKIM signing for verification emails. -
- Auth: Email/password, verified+approved requirement, JWT session cookie (
session_token), roles.
-
Layers Diagram
-Source: docs/drawio/architecture.drawio. Edit with draw.io and export locally.
Domain Model Snapshot
+Component map
erDiagram
+
+flowchart LR
+ Browser[Client browser] -->|HTTP/HTTPS| Next[Next.js App Router
SSR/ISR + API routes]
+ Next --> Prisma[Prisma ORM]
+ Prisma --> Postgres[(PostgreSQL)]
+ Next --> Mailer[SMTP mailer
(smtp.sohva.org + DKIM)]
+ Next --> Storage[Image URLs (remote/bucket)]
+ Admin[Admin / Moderators] --> Next
+ Next --> Auth[Auth module
JWT session cookie]
+
+ Domain model
+erDiagram
USER ||--o{ LISTING : owns
USER ||--o{ LISTING : approves
LISTING ||--|{ LISTINGTRANSLATION : has
@@ -67,14 +68,24 @@
string id
string url
}
-
+
Auth Flow (High-Level)
-See PlantUML source: docs/plantuml/auth-register-login.puml. Render locally with PlantUML.
Key notes
+-
+
- Web: Next.js app (App Router), server-rendered pages, client hooks for auth state. +
- API routes: Authentication, admin approvals, listings CRUD (soft-delete), profile update. +
- Data: Postgres via Prisma (models: User, Listing, ListingTranslation, ListingImage, VerificationToken). +
- Mail: SMTP (smtp.sohva.org) + DKIM signing for verification emails. +
- Auth: Email/password, verified+approved requirement, JWT session cookie (
session_token), roles.
+