# shatab99/dakar-go-office architecture

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

- Interactive diagram: https://gitdiagram.com/shatab99/dakar-go-office
- Repository: https://github.com/shatab99/dakar-go-office

## Overview

This is a Node/Express API for travel and lodging services, with account authentication, provider management, bookings, payments, notifications, and administration. The principal request path is HTTP client → Express app → versioned router → feature routes/controllers → services → data or external integrations, then a standardized response. The README also describes JWT auth, Swagger, MongoDB, and dynamic querying. Several feature services were not sampled, so their internal calls and storage relationships are intentionally not inferred; the excerpts show both MongoDB connection setup and Prisma-backed auth operations.

Main entry points: [`src/app/route/route.ts`](https://github.com/shatab99/dakar-go-office/blob/main/src/app/route/route.ts) (API router), [`src/app.ts`](https://github.com/shatab99/dakar-go-office/blob/main/src/app.ts) (Express application), [`src/app/modules/auth/auth.controller.ts`](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/auth/auth.controller.ts) (Auth controller), [`src/app/modules/auth/auth.service.ts`](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/auth/auth.service.ts) (Auth service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["API runtime"]
  node_express_app["Express application<br/>[app.ts]"]
  node_api_router["API router<br/>[route.ts]"]
  node_error_handler["Global error handler"]
  node_response["Response formatter<br/>[sendResponse.ts]"]
  node_async_wrapper["Async wrapper<br/>[catchAsync.ts]"]
end

subgraph group_identity["Identity and users"]
  node_auth_routes["Auth routes<br/>[auth.routes.ts]"]
  node_auth_controller["Auth controller<br/>[auth.controller.ts]"]
  node_auth_service["Auth service<br/>[auth.service.ts]"]
  node_auth_middleware["JWT authorization<br/>[auth.ts]"]
  node_jwt["JWT helper<br/>[jwtHelper.ts]"]
  node_user_routes["User routes<br/>[user.routes.ts]"]
  node_user_controller["User controller<br/>[user.controller.ts]"]
  node_user_service["User service<br/>[user.service.ts]"]
end

subgraph group_travel["Travel and lodging"]
  node_hotel_routes["Hotel routes<br/>[hotel.routes.ts]"]
  node_hotel_controller["Hotel controller"]
  node_hotel_service["Hotel service<br/>[hotel.service.ts]"]
  node_travel_routes["Travel routes<br/>[travel.routes.ts]"]
  node_travel_controller["Travel controller"]
  node_travel_service["Travel service<br/>[travel.service.ts]"]
end

subgraph group_commerce["Bookings and payments"]
  node_hotel_booking["Hotel booking"]
  node_travel_booking["Travel booking"]
  node_payment["Payment service<br/>[payment.service.ts]"]
  node_webhook["Payment webhook<br/>[webhook.Service.ts]"]
end

subgraph group_operations["Operations and platform"]
  node_notifications["Notifications"]
  node_admin["Administration<br/>[admin.service.ts]"]
  node_provider_admin["Provider administration"]
  node_dynamic_query["Dynamic query helper<br/>[queryBuilder.ts]"]
  node_prisma_client["Prisma client<br/>[prisma.ts]"]
  node_stripe_account["Stripe account helper"]
  node_stripe_config["Stripe configuration<br/>[stripe.ts]"]
  node_swagger["Swagger UI<br/>[swaggerConfig.ts]"]
end

node_client(("API client"))
node_mongodb[("MongoDB")]

node_client -->|"sends requests"| node_express_app
node_express_app -->|"mounts routes"| node_api_router
node_express_app -->|"handles errors"| node_error_handler
node_express_app -->|"connects to"| node_mongodb
node_express_app -->|"serves docs"| node_swagger
node_api_router -->|"mounts routes"| node_auth_routes
node_api_router -->|"mounts routes"| node_user_routes
node_api_router -->|"mounts routes"| node_hotel_routes
node_api_router -->|"mounts routes"| node_travel_routes
node_api_router -->|"mounts booking routes"| node_hotel_booking
node_api_router -->|"mounts booking routes"| node_travel_booking
node_auth_routes -->|"routes to"| node_auth_controller
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"reads and updates"| node_prisma_client
node_auth_service -->|"creates tokens"| node_jwt
node_auth_service -->|"creates customer"| node_stripe_account
node_auth_middleware -->|"verifies tokens"| node_jwt
node_auth_middleware -->|"loads user"| node_prisma_client
node_user_routes -->|"routes to"| node_user_controller
node_user_controller -->|"calls"| node_user_service
node_user_controller -->|"requests account"| node_stripe_account
node_hotel_routes -->|"routes to"| node_hotel_controller
node_hotel_controller -->|"calls"| node_hotel_service
node_travel_routes -->|"routes to"| node_travel_controller
node_travel_controller -->|"calls"| node_travel_service
node_stripe_account -->|"uses configuration"| node_stripe_config
node_hotel_controller -->|"formats response"| node_response
node_travel_controller -->|"formats response"| node_response
node_auth_controller -->|"formats response"| node_response
node_auth_controller -->|"wraps handlers"| node_async_wrapper
node_hotel_controller -->|"wraps handlers"| node_async_wrapper
node_travel_controller -->|"wraps handlers"| node_async_wrapper

click node_express_app "https://github.com/shatab99/dakar-go-office/blob/main/src/app.ts"
click node_api_router "https://github.com/shatab99/dakar-go-office/blob/main/src/app/route/route.ts"
click node_error_handler "https://github.com/shatab99/dakar-go-office/blob/main/src/app/middleware/globalErrorHandler.ts"
click node_response "https://github.com/shatab99/dakar-go-office/blob/main/src/app/middleware/sendResponse.ts"
click node_async_wrapper "https://github.com/shatab99/dakar-go-office/blob/main/src/shared/catchAsync.ts"
click node_auth_routes "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/auth/auth.routes.ts"
click node_auth_controller "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/auth/auth.controller.ts"
click node_auth_service "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/auth/auth.service.ts"
click node_auth_middleware "https://github.com/shatab99/dakar-go-office/blob/main/src/app/middleware/auth.ts"
click node_jwt "https://github.com/shatab99/dakar-go-office/blob/main/src/app/helper/jwtHelper.ts"
click node_user_routes "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/user/user.routes.ts"
click node_user_controller "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/user/user.controller.ts"
click node_user_service "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/user/user.service.ts"
click node_hotel_routes "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/hotel/hotel.routes.ts"
click node_hotel_controller "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/hotel/hotel.controller.ts"
click node_hotel_service "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/hotel/hotel.service.ts"
click node_travel_routes "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/travel/travel.routes.ts"
click node_travel_controller "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/travel/travel.controller.ts"
click node_travel_service "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/travel/travel.service.ts"
click node_hotel_booking "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/hotelBook/hotelBook.service.ts"
click node_travel_booking "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/TravelBook/travelBook.service.ts"
click node_payment "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/payment/payment.service.ts"
click node_webhook "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/webhook/webhook.Service.ts"
click node_notifications "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/notifications/notification.service.ts"
click node_admin "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/admin/admin.service.ts"
click node_provider_admin "https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/admin/provider/provider.service.ts"
click node_dynamic_query "https://github.com/shatab99/dakar-go-office/blob/main/src/app/helper/queryBuilder.ts"
click node_prisma_client "https://github.com/shatab99/dakar-go-office/blob/main/src/utils/prisma.ts"
click node_stripe_account "https://github.com/shatab99/dakar-go-office/blob/main/src/app/helper/createStripeConnectAccount.ts"
click node_stripe_config "https://github.com/shatab99/dakar-go-office/blob/main/src/config/stripe.ts"
click node_swagger "https://github.com/shatab99/dakar-go-office/blob/main/src/config/swaggerConfig.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_express_app,node_api_router,node_error_handler,node_response,node_async_wrapper,node_client toneBlue
class node_auth_routes,node_auth_controller,node_auth_service,node_auth_middleware,node_jwt,node_user_routes,node_user_controller,node_user_service,node_mongodb toneAmber
class node_hotel_routes,node_hotel_controller,node_hotel_service,node_travel_routes,node_travel_controller,node_travel_service toneMint
class node_hotel_booking,node_travel_booking,node_payment,node_webhook toneRose
class node_notifications,node_admin,node_provider_admin,node_dynamic_query,node_prisma_client,node_stripe_account,node_stripe_config,node_swagger toneIndigo
```

## Components

### API runtime

- [Express application](https://github.com/shatab99/dakar-go-office/blob/main/src/app.ts): `src/app.ts`
- [API router](https://github.com/shatab99/dakar-go-office/blob/main/src/app/route/route.ts): `src/app/route/route.ts`
- [Global error handler](https://github.com/shatab99/dakar-go-office/blob/main/src/app/middleware/globalErrorHandler.ts): `src/app/middleware/globalErrorHandler.ts`
- [Response formatter](https://github.com/shatab99/dakar-go-office/blob/main/src/app/middleware/sendResponse.ts): `src/app/middleware/sendResponse.ts`
- [Async wrapper](https://github.com/shatab99/dakar-go-office/blob/main/src/shared/catchAsync.ts): `src/shared/catchAsync.ts`

### Identity and users

- [Auth routes](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/auth/auth.routes.ts): `src/app/modules/auth/auth.routes.ts`
- [Auth controller](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/auth/auth.controller.ts): `src/app/modules/auth/auth.controller.ts`
- [Auth service](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/auth/auth.service.ts): `src/app/modules/auth/auth.service.ts`
- [JWT authorization](https://github.com/shatab99/dakar-go-office/blob/main/src/app/middleware/auth.ts): `src/app/middleware/auth.ts`
- [JWT helper](https://github.com/shatab99/dakar-go-office/blob/main/src/app/helper/jwtHelper.ts): `src/app/helper/jwtHelper.ts`
- [User routes](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/user/user.routes.ts): `src/app/modules/user/user.routes.ts`
- [User controller](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/user/user.controller.ts): `src/app/modules/user/user.controller.ts`
- [User service](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/user/user.service.ts): `src/app/modules/user/user.service.ts`

### Travel and lodging

- [Hotel routes](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/hotel/hotel.routes.ts): `src/app/modules/hotel/hotel.routes.ts`
- [Hotel controller](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/hotel/hotel.controller.ts): `src/app/modules/hotel/hotel.controller.ts`
- [Hotel service](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/hotel/hotel.service.ts): `src/app/modules/hotel/hotel.service.ts`
- [Travel routes](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/travel/travel.routes.ts): `src/app/modules/travel/travel.routes.ts`
- [Travel controller](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/travel/travel.controller.ts): `src/app/modules/travel/travel.controller.ts`
- [Travel service](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/travel/travel.service.ts): `src/app/modules/travel/travel.service.ts`

### Bookings and payments

- [Hotel booking](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/hotelBook/hotelBook.service.ts): `src/app/modules/hotelBook/hotelBook.service.ts`
- [Travel booking](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/TravelBook/travelBook.service.ts): `src/app/modules/TravelBook/travelBook.service.ts`
- [Payment service](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/payment/payment.service.ts): `src/app/modules/payment/payment.service.ts`
- [Payment webhook](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/webhook/webhook.Service.ts): `src/app/modules/webhook/webhook.Service.ts`

### Operations and platform

- [Notifications](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/notifications/notification.service.ts): `src/app/modules/notifications/notification.service.ts`
- [Administration](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/admin/admin.service.ts): `src/app/modules/admin/admin.service.ts`
- [Provider administration](https://github.com/shatab99/dakar-go-office/blob/main/src/app/modules/admin/provider/provider.service.ts): `src/app/modules/admin/provider/provider.service.ts`
- [Dynamic query helper](https://github.com/shatab99/dakar-go-office/blob/main/src/app/helper/queryBuilder.ts): `src/app/helper/queryBuilder.ts`
- [Prisma client](https://github.com/shatab99/dakar-go-office/blob/main/src/utils/prisma.ts): `src/utils/prisma.ts`
- [Stripe account helper](https://github.com/shatab99/dakar-go-office/blob/main/src/app/helper/createStripeConnectAccount.ts): `src/app/helper/createStripeConnectAccount.ts`
- [Stripe configuration](https://github.com/shatab99/dakar-go-office/blob/main/src/config/stripe.ts): `src/config/stripe.ts`
- [Swagger UI](https://github.com/shatab99/dakar-go-office/blob/main/src/config/swaggerConfig.ts): `src/config/swaggerConfig.ts`

### Other components

- **API client**
- **MongoDB**

## Connections

- API client → Express application: sends requests (evidence: `src/app.ts`)
- Express application → API router: mounts routes (evidence: `src/app.ts`)
- Express application → Global error handler: handles errors (evidence: `src/app.ts`)
- Express application → MongoDB: connects to (evidence: `src/app.ts`)
- Express application → Swagger UI: serves docs (evidence: `src/app.ts`)
- API router → Auth routes: mounts routes (evidence: `src/app/route/route.ts`)
- API router → User routes: mounts routes (evidence: `src/app/route/route.ts`)
- API router → Hotel routes: mounts routes (evidence: `src/app/route/route.ts`)
- API router → Travel routes: mounts routes (evidence: `src/app/route/route.ts`)
- API router → Hotel booking: mounts booking routes (evidence: `src/app/route/route.ts`)
- API router → Travel booking: mounts booking routes (evidence: `src/app/route/route.ts`)
- Auth routes → Auth controller: routes to (evidence: `src/app/modules/auth/auth.routes.ts`)
- Auth controller → Auth service: calls (evidence: `src/app/modules/auth/auth.controller.ts`)
- Auth service → Prisma client: reads and updates (evidence: `src/app/modules/auth/auth.service.ts`)
- Auth service → JWT helper: creates tokens (evidence: `src/app/modules/auth/auth.service.ts`)
- Auth service → Stripe account helper: creates customer (evidence: `src/app/modules/auth/auth.service.ts`)
- JWT authorization → JWT helper: verifies tokens (evidence: `src/app/middleware/auth.ts`)
- JWT authorization → Prisma client: loads user (evidence: `src/app/middleware/auth.ts`)
- User routes → User controller: routes to (evidence: `src/app/modules/user/user.routes.ts`)
- User controller → User service: calls (evidence: `src/app/modules/user/user.controller.ts`)
- User controller → Stripe account helper: requests account (evidence: `src/app/modules/user/user.controller.ts`)
- Hotel routes → Hotel controller: routes to (evidence: `src/app/modules/hotel/hotel.routes.ts`)
- Hotel controller → Hotel service: calls (evidence: `src/app/modules/hotel/hotel.controller.ts`)
- Travel routes → Travel controller: routes to (evidence: `src/app/modules/travel/travel.routes.ts`)
- Travel controller → Travel service: calls (evidence: `src/app/modules/travel/travel.controller.ts`)
- Stripe account helper → Stripe configuration: uses configuration (evidence: `src/app/helper/createStripeConnectAccount.ts`)
- Hotel controller → Response formatter: formats response (evidence: `src/app/modules/hotel/hotel.controller.ts`)
- Travel controller → Response formatter: formats response (evidence: `src/app/modules/travel/travel.controller.ts`)
- Auth controller → Response formatter: formats response (evidence: `src/app/modules/auth/auth.controller.ts`)
- Auth controller → Async wrapper: wraps handlers (evidence: `src/app/modules/auth/auth.controller.ts`)
- Hotel controller → Async wrapper: wraps handlers (evidence: `src/app/modules/hotel/hotel.controller.ts`)
- Travel controller → Async wrapper: wraps handlers (evidence: `src/app/modules/travel/travel.controller.ts`)
