Component map
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 and Moderators] --> Next
Next --> Auth[Auth module / JWT session cookie]
Edit the Mermaid block above to evolve the architecture.
Domain model
erDiagram
USER ||--o{ LISTING : owns
USER ||--o{ LISTING : approves
LISTING ||--|{ LISTINGTRANSLATION : has
LISTING ||--o{ LISTINGIMAGE : has
USER {
string id
string email
string passwordHash
Role role
UserStatus status
datetime emailVerifiedAt
datetime approvedAt
datetime rejectedAt
datetime removedAt
}
LISTING {
string id
ListingStatus status
datetime approvedAt
datetime rejectedAt
datetime removedAt
string country
string region
string city
}
LISTINGTRANSLATION {
string id
string slug
string title
string locale
}
LISTINGIMAGE {
string id
string url
}
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.