# onlyxplore/onlyxplore-backend architecture

> Architecture diagram of the GitHub repository onlyxplore/onlyxplore-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/onlyxplore/onlyxplore-backend
- Repository: https://github.com/onlyxplore/onlyxplore-backend

## Overview

OnlyXplore is a NestJS backend with authentication, trip discovery, host profile and dashboard APIs, and administrative reporting. A typical request enters through an API controller and is delegated to its service; authentication additionally supports registration, login, email verification, password reset, and two-factor email. Prisma provides the database client, while mail delivery and Supabase image storage are integrations. The README is an unmodified Nest starter and does not document product capabilities; several service implementations and module wiring were not sampled, so uncertain persistence and cross-module links are omitted.

Main entry points: [`src/auth/auth.service.ts`](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/auth.service.ts) (Auth Service), [`src/auth/auth.controller.ts`](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/auth.controller.ts) (Auth API), [`src/host-profile/host-profile.controller.ts`](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/host-profile/host-profile.controller.ts) (Host Profile API), [`src/mail/mail.service.ts`](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/mail/mail.service.ts) (Mail Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Identity &amp; Access"]
  node_authctl["Auth API<br/>[auth.controller.ts]"]
  node_authsvc["Auth Service<br/>[auth.service.ts]"]
  node_guard["JWT Guard<br/>[jwt-auth.guard.ts]"]
  node_jwtstrategy["JWT Strategy<br/>[jwt.strategy.ts]"]
  node_tokens["Token Service<br/>[token.service.ts]"]
end

subgraph group_discovery["Trip Discovery"]
  node_explorectl["Explore API"]
  node_exploresvc["Explore Service<br/>[explore.service.ts]"]
end

subgraph group_host["Host Tools"]
  node_profilectl["Host Profile API"]
  node_profilesvc["Host Profile Service"]
  node_hostctl["Host Dashboard API"]
  node_hostsvc["Host Dashboard Service"]
end

subgraph group_admin["Administration"]
  node_adminctl["Admin Dashboard API"]
  node_adminsvc["Admin Dashboard Service"]
end

subgraph group_platform["Platform Services"]
  node_main["Nest Bootstrap<br/>[main.ts]"]
  node_app["Application Root<br/>[app.module.ts]"]
  node_mail["Mail Service<br/>[mail.service.ts]"]
  node_prisma["Prisma Service<br/>[prisma.service.ts]"]
  node_dbschema["Data Schema<br/>[schema.prisma]"]
  node_supabase["Supabase Storage Client"]
end

node_clients(("API Clients"))
node_postgres[("PostgreSQL")]
node_smtp(("SMTP Mail Server"))
node_resend(("Resend"))

node_clients -->|"sends requests"| node_main
node_main -->|"creates app"| node_app
node_clients -->|"calls auth API"| node_authctl
node_authctl -->|"delegates"| node_authsvc
node_authctl -->|"guards routes"| node_guard
node_authsvc -->|"queries data"| node_prisma
node_authsvc -->|"generates tokens"| node_tokens
node_authsvc -->|"sends messages"| node_mail
node_clients -->|"requests trips"| node_explorectl
node_explorectl -->|"delegates"| node_exploresvc
node_clients -->|"manages profile"| node_profilectl
node_profilectl -->|"delegates"| node_profilesvc
node_profilectl -->|"guards routes"| node_guard
node_clients -->|"requests host data"| node_hostctl
node_hostctl -->|"delegates"| node_hostsvc
node_clients -->|"requests reports"| node_adminctl
node_adminctl -->|"delegates"| node_adminsvc
node_prisma -->|"reads and writes"| node_postgres
node_mail -.->|"sends email"| node_resend
node_mail -->|"sends email"| node_smtp

click node_main "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/main.ts"
click node_app "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/app.module.ts"
click node_authctl "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/auth.controller.ts"
click node_authsvc "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/auth.service.ts"
click node_guard "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/jwt-auth.guard.ts"
click node_jwtstrategy "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/jwt.strategy.ts"
click node_tokens "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/token.service.ts"
click node_mail "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/mail/mail.service.ts"
click node_explorectl "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/explore/explore.controller.ts"
click node_exploresvc "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/explore/explore.service.ts"
click node_profilectl "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/host-profile/host-profile.controller.ts"
click node_profilesvc "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/host-profile/host-profile.service.ts"
click node_hostctl "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/host-dashboard/host-dashboard.controller.ts"
click node_hostsvc "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/host-dashboard/host-dashboard.service.ts"
click node_adminctl "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/admin-dashboard/admin-dashboard.controller.ts"
click node_adminsvc "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/admin-dashboard/admin-dashboard.service.ts"
click node_prisma "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/prisma/prisma.service.ts"
click node_dbschema "https://github.com/onlyxplore/onlyxplore-backend/blob/main/prisma/schema.prisma"
click node_supabase "https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/supabase/supabase.service.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_authctl,node_authsvc,node_guard,node_jwtstrategy,node_tokens,node_clients toneBlue
class node_explorectl,node_exploresvc,node_postgres toneAmber
class node_profilectl,node_profilesvc,node_hostctl,node_hostsvc,node_smtp toneMint
class node_adminctl,node_adminsvc toneRose
class node_main,node_app,node_mail,node_prisma,node_dbschema,node_supabase,node_resend toneIndigo
```

## Components

### Identity & Access

- [Auth API](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/auth.controller.ts): `src/auth/auth.controller.ts`
- [Auth Service](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/auth.service.ts): `src/auth/auth.service.ts`
- [JWT Guard](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/jwt-auth.guard.ts): `src/auth/jwt-auth.guard.ts`
- [JWT Strategy](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/jwt.strategy.ts): `src/auth/jwt.strategy.ts`
- [Token Service](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/auth/token.service.ts): `src/auth/token.service.ts`

### Trip Discovery

- [Explore API](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/explore/explore.controller.ts): `src/explore/explore.controller.ts`
- [Explore Service](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/explore/explore.service.ts): `src/explore/explore.service.ts`

### Host Tools

- [Host Profile API](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/host-profile/host-profile.controller.ts): `src/host-profile/host-profile.controller.ts`
- [Host Profile Service](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/host-profile/host-profile.service.ts): `src/host-profile/host-profile.service.ts`
- [Host Dashboard API](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/host-dashboard/host-dashboard.controller.ts): `src/host-dashboard/host-dashboard.controller.ts`
- [Host Dashboard Service](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/host-dashboard/host-dashboard.service.ts): `src/host-dashboard/host-dashboard.service.ts`

### Administration

- [Admin Dashboard API](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/admin-dashboard/admin-dashboard.controller.ts): `src/admin-dashboard/admin-dashboard.controller.ts`
- [Admin Dashboard Service](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/admin-dashboard/admin-dashboard.service.ts): `src/admin-dashboard/admin-dashboard.service.ts`

### Platform Services

- [Nest Bootstrap](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/main.ts): `src/main.ts`
- [Application Root](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/app.module.ts): `src/app.module.ts`
- [Mail Service](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/mail/mail.service.ts): `src/mail/mail.service.ts`
- [Prisma Service](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/prisma/prisma.service.ts): `src/prisma/prisma.service.ts`
- [Data Schema](https://github.com/onlyxplore/onlyxplore-backend/blob/main/prisma/schema.prisma): `prisma/schema.prisma`
- [Supabase Storage Client](https://github.com/onlyxplore/onlyxplore-backend/blob/main/src/supabase/supabase.service.ts): `src/supabase/supabase.service.ts`

### Other components

- **API Clients**
- **PostgreSQL**
- **SMTP Mail Server**
- **Resend**

## Connections

- API Clients → Nest Bootstrap: sends requests
- Nest Bootstrap → Application Root: creates app
- API Clients → Auth API: calls auth API
- Auth API → Auth Service: delegates
- Auth API → JWT Guard: guards routes
- Auth Service → Prisma Service: queries data
- Auth Service → Token Service: generates tokens
- Auth Service → Mail Service: sends messages
- API Clients → Explore API: requests trips
- Explore API → Explore Service: delegates
- API Clients → Host Profile API: manages profile
- Host Profile API → Host Profile Service: delegates
- Host Profile API → JWT Guard: guards routes
- API Clients → Host Dashboard API: requests host data
- Host Dashboard API → Host Dashboard Service: delegates
- API Clients → Admin Dashboard API: requests reports
- Admin Dashboard API → Admin Dashboard Service: delegates
- Prisma Service → PostgreSQL: reads and writes
- Mail Service → Resend: sends email
- Mail Service → SMTP Mail Server: sends email
