# hasan123dayoub-del/takemehigh architecture

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

- Interactive diagram: https://gitdiagram.com/hasan123dayoub-del/takemehigh
- Repository: https://github.com/hasan123dayoub-del/takemehigh

## Overview

TakeMeHigh is a single-agency travel operations system: staff authenticate, manage priced travel products and customers, create passenger bookings, collect payments, and monitor operational and financial reports. Visitors use each agency’s public page to browse trips or submit a custom-trip request. The API’s NestJS application module assembles the domain modules; Prisma provides persistence, while shared scope and lifecycle logic enforce branch access and registration transitions. The README documents several capabilities whose individual implementations were not sampled, so those are represented at subsystem level; web-to-API calls are not asserted without source evidence.

Main entry points: [`apps/api/src/app.module.ts`](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/app.module.ts) (API composition), [`apps/api/src/bookings/bookings.service.ts`](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/bookings/bookings.service.ts) (Passenger bookings), [`apps/api/src/auth/auth.service.ts`](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/auth/auth.service.ts) (Authentication), [`apps/api/src/prisma/prisma.service.ts`](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/prisma/prisma.service.ts) (PostgreSQL data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experiences"]
  node_dashboard["Operations dashboard"]
  node_public["Agency public page"]
  node_login["Sign-in UI"]
end

subgraph group_access["Identity and access"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_accessrules["Branch permissions<br/>[scope.ts]"]
end

subgraph group_catalog["Travel catalog"]
  node_suppliers["Suppliers and costs"]
  node_integrations["Supplier integrations"]
  node_trips["Trips and pricing<br/>[trips.service.ts]"]
  node_programs["Programs and offers"]
  node_lifecycle["Registration lifecycle"]
end

subgraph group_operations["Agency operations"]
  node_customers["Customers and documents"]
  node_bookings["Passenger bookings"]
  node_payments["Payments and receipts"]
  node_visas["Visa records<br/>[visas.service.ts]"]
  node_publicrequests["Public trip requests<br/>[requests.module.ts]"]
  node_reports["Reports and exports<br/>[reports.module.ts]"]
  node_audit["Audit trail<br/>[audit.service.ts]"]
end

subgraph group_platform["API platform"]
  node_api["API composition<br/>[app.module.ts]"]
  node_database[("PostgreSQL data<br/>[prisma.service.ts]")]
  node_shared["Permission catalogue<br/>[index.ts]"]
end

node_staff(("Agency staff"))
node_visitors(("Travel visitors"))

node_staff -->|"signs in"| node_login
node_staff -->|"operates"| node_dashboard
node_visitors -->|"browses"| node_public
node_visitors -->|"requests trip"| node_publicrequests
node_login -->|"authenticates"| node_auth
node_auth -->|"records sign-ins"| node_audit
node_auth -->|"reads and writes"| node_database
node_auth -->|"uses permissions"| node_shared
node_bookings -->|"validates customers"| node_customers
node_bookings -->|"checks products"| node_lifecycle
node_bookings -->|"writes bookings"| node_database
node_bookings -->|"records changes"| node_audit
node_payments -->|"loads booking"| node_bookings
node_payments -->|"writes payments"| node_database
node_trips -->|"uses supplier costs"| node_suppliers
node_trips -->|"delegates lifecycle"| node_lifecycle
node_trips -->|"reads and writes"| node_database
node_lifecycle -->|"updates status"| node_database
node_api -->|"registers module"| node_auth
node_api -->|"registers module"| node_bookings
node_api -->|"registers module"| node_trips
node_api -->|"registers module"| node_integrations
node_api -->|"registers module"| node_customers
node_api -->|"registers module"| node_reports
node_api -->|"registers module"| node_publicrequests
node_accessrules -->|"scopes records"| node_bookings

click node_dashboard "https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/web/src/app/dashboard"
click node_public "https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/web/src/app/(public)"
click node_login "https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/web/src/app/login"
click node_auth "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/auth/auth.service.ts"
click node_accessrules "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/common/scope.ts"
click node_suppliers "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/suppliers/suppliers.module.ts"
click node_integrations "https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/api/src/integrations"
click node_trips "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/products/trips.service.ts"
click node_programs "https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/api/src/products"
click node_lifecycle "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/products/lifecycle.service.ts"
click node_customers "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/customers/customers.module.ts"
click node_bookings "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/bookings/bookings.service.ts"
click node_payments "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/bookings/payments.service.ts"
click node_visas "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/bookings/visas.service.ts"
click node_publicrequests "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/public-site/requests.module.ts"
click node_reports "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/reports/reports.module.ts"
click node_audit "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/audit-logs/audit.service.ts"
click node_api "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/app.module.ts"
click node_database "https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/prisma/prisma.service.ts"
click node_shared "https://github.com/hasan123dayoub-del/takemehigh/blob/main/packages/shared/src/index.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_dashboard,node_public,node_login toneBlue
class node_auth,node_accessrules toneAmber
class node_suppliers,node_integrations,node_trips,node_programs,node_lifecycle toneMint
class node_customers,node_bookings,node_payments,node_visas,node_publicrequests,node_reports,node_audit toneRose
class node_api,node_database,node_shared,node_staff,node_visitors toneIndigo
```

## Components

### Web experiences

- [Operations dashboard](https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/web/src/app/dashboard): `apps/web/src/app/dashboard`
- [Agency public page](https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/web/src/app/(public)): `apps/web/src/app/(public)`
- [Sign-in UI](https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/web/src/app/login): `apps/web/src/app/login`

### Identity and access

- [Authentication](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/auth/auth.service.ts): `apps/api/src/auth/auth.service.ts`
- [Branch permissions](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/common/scope.ts): `apps/api/src/common/scope.ts`

### Travel catalog

- [Suppliers and costs](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/suppliers/suppliers.module.ts): `apps/api/src/suppliers/suppliers.module.ts`
- [Supplier integrations](https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/api/src/integrations): `apps/api/src/integrations`
- [Trips and pricing](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/products/trips.service.ts): `apps/api/src/products/trips.service.ts`
- [Programs and offers](https://github.com/hasan123dayoub-del/takemehigh/tree/main/apps/api/src/products): `apps/api/src/products`
- [Registration lifecycle](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/products/lifecycle.service.ts): `apps/api/src/products/lifecycle.service.ts`

### Agency operations

- [Customers and documents](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/customers/customers.module.ts): `apps/api/src/customers/customers.module.ts`
- [Passenger bookings](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/bookings/bookings.service.ts): `apps/api/src/bookings/bookings.service.ts`
- [Payments and receipts](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/bookings/payments.service.ts): `apps/api/src/bookings/payments.service.ts`
- [Visa records](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/bookings/visas.service.ts): `apps/api/src/bookings/visas.service.ts`
- [Public trip requests](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/public-site/requests.module.ts): `apps/api/src/public-site/requests.module.ts`
- [Reports and exports](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/reports/reports.module.ts): `apps/api/src/reports/reports.module.ts`
- [Audit trail](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/audit-logs/audit.service.ts): `apps/api/src/audit-logs/audit.service.ts`

### API platform

- [API composition](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/app.module.ts): `apps/api/src/app.module.ts`
- [PostgreSQL data](https://github.com/hasan123dayoub-del/takemehigh/blob/main/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`
- [Permission catalogue](https://github.com/hasan123dayoub-del/takemehigh/blob/main/packages/shared/src/index.ts): `packages/shared/src/index.ts`

### Other components

- **Agency staff**
- **Travel visitors**

## Connections

- Agency staff → Sign-in UI: signs in (evidence: `README.md`)
- Agency staff → Operations dashboard: operates (evidence: `README.md`)
- Travel visitors → Agency public page: browses (evidence: `README.md`)
- Travel visitors → Public trip requests: requests trip (evidence: `README.md`)
- Sign-in UI → Authentication: authenticates
- Authentication → Audit trail: records sign-ins (evidence: `apps/api/src/auth/auth.service.ts`)
- Authentication → PostgreSQL data: reads and writes (evidence: `apps/api/src/auth/auth.service.ts`)
- Authentication → Permission catalogue: uses permissions (evidence: `apps/api/src/auth/auth.service.ts`)
- Passenger bookings → Customers and documents: validates customers (evidence: `apps/api/src/bookings/bookings.service.ts`)
- Passenger bookings → Registration lifecycle: checks products (evidence: `apps/api/src/bookings/bookings.service.ts`)
- Passenger bookings → PostgreSQL data: writes bookings (evidence: `apps/api/src/bookings/bookings.service.ts`)
- Passenger bookings → Audit trail: records changes (evidence: `apps/api/src/bookings/bookings.service.ts`)
- Payments and receipts → Passenger bookings: loads booking (evidence: `apps/api/src/bookings/payments.service.ts`)
- Payments and receipts → PostgreSQL data: writes payments (evidence: `apps/api/src/bookings/payments.service.ts`)
- Trips and pricing → Suppliers and costs: uses supplier costs (evidence: `apps/api/src/products/trips.service.ts`)
- Trips and pricing → Registration lifecycle: delegates lifecycle (evidence: `apps/api/src/products/trips.service.ts`)
- Trips and pricing → PostgreSQL data: reads and writes (evidence: `apps/api/src/products/trips.service.ts`)
- Registration lifecycle → PostgreSQL data: updates status (evidence: `apps/api/src/products/lifecycle.service.ts`)
- API composition → Authentication: registers module (evidence: `apps/api/src/app.module.ts`)
- API composition → Passenger bookings: registers module (evidence: `apps/api/src/app.module.ts`)
- API composition → Trips and pricing: registers module (evidence: `apps/api/src/app.module.ts`)
- API composition → Supplier integrations: registers module (evidence: `apps/api/src/app.module.ts`)
- API composition → Customers and documents: registers module (evidence: `apps/api/src/app.module.ts`)
- API composition → Reports and exports: registers module (evidence: `apps/api/src/app.module.ts`)
- API composition → Public trip requests: registers module (evidence: `apps/api/src/app.module.ts`)
- Branch permissions → Passenger bookings: scopes records (evidence: `apps/api/src/bookings/bookings.service.ts`)
