Logical Architecture

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

Components

Layers Diagram

Source: docs/drawio/architecture.drawio. Edit with draw.io and export locally.

Domain Model Snapshot

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
  }

Auth Flow (High-Level)

See PlantUML source: docs/plantuml/auth-register-login.puml. Render locally with PlantUML.