Logical Architecture

Next.js App Router, Prisma/Postgres, role-based auth, email verification, approvals.

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