# dupont-fr/ligan-backend architecture

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

- Interactive diagram: https://gitdiagram.com/dupont-fr/ligan-backend
- Repository: https://github.com/dupont-fr/ligan-backend

## Overview

LIGAN+ is a REST API for discovering and managing local professionals. Customers search nearby activity listings and can contact professionals; professionals manage their listings, while users can authenticate, review activities, and submit solicitations. The API also supports analytics, administration, and paid subscriptions. The README and excerpts establish the API routing and some controller-to-model/service relationships; other links below rely on SOURCE INDEX references, so unsampled behavior is not assumed beyond those references.

Main entry points: [`src/app.ts`](https://github.com/dupont-fr/ligan-backend/blob/main/src/app.ts) (Express API), [`src/modules/admin/controller.ts`](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/admin/controller.ts) (Administration), [`src/modules/subscriptions/controller.ts`](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/subscriptions/controller.ts) (Subscriptions), [`src/models/Activity.ts`](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Activity.ts) (Activity records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["API runtime"]
  node_api["Express API<br/>[app.ts]"]
  node_dbconn["MongoDB connection<br/>[database.ts]"]
  node_mongo[("MongoDB Atlas")]
  node_health["Health check<br/>[controller.ts]"]
end

subgraph group_discovery["Discovery and engagement"]
  node_activities["Activity management<br/>[controller.ts]"]
  node_businesses["Business discovery<br/>[controller.ts]"]
  node_categories["Categories<br/>[controller.ts]"]
  node_reviews["Reviews<br/>[controller.ts]"]
  node_solicitations["Solicitations<br/>[controller.ts]"]
  node_analytics["Analytics<br/>[controller.ts]"]
end

subgraph group_identity["Identity and operations"]
  node_auth["Authentication<br/>[controller.ts]"]
  node_admin["Administration<br/>[controller.ts]"]
  node_email["Email delivery<br/>[email.ts]"]
end

subgraph group_commerce["Plans and payments"]
  node_plans["Plan catalog<br/>[controller.ts]"]
  node_subscriptions["Subscriptions<br/>[controller.ts]"]
  node_payments["Payment handling<br/>[controller.ts]"]
  node_paymentservice["Payment providers<br/>[index.ts]"]
end

subgraph group_data["Domain data"]
  node_usersdata[("User records<br/>[User.ts]")]
  node_activitydata[("Activity records<br/>[Activity.ts]")]
  node_categorydata[("Category records<br/>[Category.ts]")]
  node_reviewdata[("Review records<br/>[Review.ts]")]
  node_solicitationdata[("Solicitation records<br/>[Solicitation.ts]")]
  node_eventdata[("Business events<br/>[BusinessEvent.ts]")]
  node_plandata[("Plan records<br/>[Plan.ts]")]
  node_subscriptiondata[("Subscription records<br/>[Subscription.ts]")]
  node_paymentdata[("Payment records<br/>[Payment.ts]")]
end

node_client(("Web client"))

node_client -->|"calls API"| node_api
node_api -->|"routes requests"| node_health
node_api -->|"routes requests"| node_auth
node_api -->|"routes requests"| node_activities
node_api -->|"routes requests"| node_businesses
node_api -->|"routes requests"| node_categories
node_api -->|"routes requests"| node_admin
node_api -->|"routes requests"| node_analytics
node_api -->|"routes requests"| node_reviews
node_api -->|"routes requests"| node_solicitations
node_api -->|"routes requests"| node_plans
node_api -->|"routes requests"| node_subscriptions
node_api -->|"routes requests"| node_payments
node_dbconn -->|"connects to"| node_mongo
node_activities -->|"reads and writes"| node_activitydata
node_businesses -->|"queries listings"| node_activitydata
node_businesses -->|"reads reviews"| node_reviewdata
node_categories -->|"reads and writes"| node_categorydata
node_categories -->|"queries activities"| node_activitydata
node_reviews -->|"reads and writes"| node_reviewdata
node_reviews -->|"uses activity"| node_activitydata
node_solicitations -->|"reads and writes"| node_solicitationdata
node_auth -->|"manages accounts"| node_usersdata
node_auth -->|"sends messages"| node_email
node_admin -->|"administers users"| node_usersdata
node_admin -->|"administers listings"| node_activitydata
node_admin -->|"manages categories"| node_categorydata
node_admin -->|"moderates reviews"| node_reviewdata
node_admin -->|"manages plans"| node_plandata
node_analytics -->|"aggregates activity"| node_activitydata
node_analytics -->|"reads events"| node_eventdata
node_analytics -->|"aggregates users"| node_usersdata
node_plans -->|"reads plans"| node_plandata
node_subscriptions -->|"resolves and applies"| node_paymentservice
node_subscriptions -->|"reads and creates"| node_paymentdata
node_subscriptions -->|"reads plans"| node_plandata
node_subscriptions -->|"reads subscription"| node_subscriptiondata
node_subscriptions -->|"reads user"| node_usersdata
node_payments -->|"uses provider service"| node_paymentservice
node_payments -->|"uses payment records"| node_paymentdata
node_paymentservice -->|"updates payments"| node_paymentdata
node_paymentservice -->|"resolves plans"| node_plandata
node_paymentservice -->|"updates subscriptions"| node_subscriptiondata

click node_api "https://github.com/dupont-fr/ligan-backend/blob/main/src/app.ts"
click node_dbconn "https://github.com/dupont-fr/ligan-backend/blob/main/src/config/database.ts"
click node_activities "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/activities/controller.ts"
click node_businesses "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/businesses/controller.ts"
click node_categories "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/categories/controller.ts"
click node_reviews "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/reviews/controller.ts"
click node_solicitations "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/solicitations/controller.ts"
click node_analytics "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/analytics/controller.ts"
click node_health "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/health/controller.ts"
click node_auth "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/auth/controller.ts"
click node_admin "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/admin/controller.ts"
click node_email "https://github.com/dupont-fr/ligan-backend/blob/main/src/services/email.ts"
click node_plans "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/plans/controller.ts"
click node_subscriptions "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/subscriptions/controller.ts"
click node_payments "https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/payments/controller.ts"
click node_paymentservice "https://github.com/dupont-fr/ligan-backend/blob/main/src/services/payments/index.ts"
click node_usersdata "https://github.com/dupont-fr/ligan-backend/blob/main/src/models/User.ts"
click node_activitydata "https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Activity.ts"
click node_categorydata "https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Category.ts"
click node_reviewdata "https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Review.ts"
click node_solicitationdata "https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Solicitation.ts"
click node_eventdata "https://github.com/dupont-fr/ligan-backend/blob/main/src/models/BusinessEvent.ts"
click node_plandata "https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Plan.ts"
click node_subscriptiondata "https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Subscription.ts"
click node_paymentdata "https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Payment.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_api,node_dbconn,node_mongo,node_health,node_client toneBlue
class node_activities,node_businesses,node_categories,node_reviews,node_solicitations,node_analytics toneAmber
class node_auth,node_admin,node_email toneMint
class node_plans,node_subscriptions,node_payments,node_paymentservice toneRose
class node_usersdata,node_activitydata,node_categorydata,node_reviewdata,node_solicitationdata,node_eventdata,node_plandata,node_subscriptiondata,node_paymentdata toneIndigo
```

## Components

### API runtime

- [Express API](https://github.com/dupont-fr/ligan-backend/blob/main/src/app.ts): `src/app.ts`
- [MongoDB connection](https://github.com/dupont-fr/ligan-backend/blob/main/src/config/database.ts): `src/config/database.ts`
- **MongoDB Atlas**
- [Health check](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/health/controller.ts): `src/modules/health/controller.ts`

### Discovery and engagement

- [Activity management](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/activities/controller.ts): `src/modules/activities/controller.ts`
- [Business discovery](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/businesses/controller.ts): `src/modules/businesses/controller.ts`
- [Categories](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/categories/controller.ts): `src/modules/categories/controller.ts`
- [Reviews](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/reviews/controller.ts): `src/modules/reviews/controller.ts`
- [Solicitations](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/solicitations/controller.ts): `src/modules/solicitations/controller.ts`
- [Analytics](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/analytics/controller.ts): `src/modules/analytics/controller.ts`

### Identity and operations

- [Authentication](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/auth/controller.ts): `src/modules/auth/controller.ts`
- [Administration](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/admin/controller.ts): `src/modules/admin/controller.ts`
- [Email delivery](https://github.com/dupont-fr/ligan-backend/blob/main/src/services/email.ts): `src/services/email.ts`

### Plans and payments

- [Plan catalog](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/plans/controller.ts): `src/modules/plans/controller.ts`
- [Subscriptions](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/subscriptions/controller.ts): `src/modules/subscriptions/controller.ts`
- [Payment handling](https://github.com/dupont-fr/ligan-backend/blob/main/src/modules/payments/controller.ts): `src/modules/payments/controller.ts`
- [Payment providers](https://github.com/dupont-fr/ligan-backend/blob/main/src/services/payments/index.ts): `src/services/payments/index.ts`

### Domain data

- [User records](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/User.ts): `src/models/User.ts`
- [Activity records](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Activity.ts): `src/models/Activity.ts`
- [Category records](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Category.ts): `src/models/Category.ts`
- [Review records](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Review.ts): `src/models/Review.ts`
- [Solicitation records](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Solicitation.ts): `src/models/Solicitation.ts`
- [Business events](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/BusinessEvent.ts): `src/models/BusinessEvent.ts`
- [Plan records](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Plan.ts): `src/models/Plan.ts`
- [Subscription records](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Subscription.ts): `src/models/Subscription.ts`
- [Payment records](https://github.com/dupont-fr/ligan-backend/blob/main/src/models/Payment.ts): `src/models/Payment.ts`

### Other components

- **Web client**

## Connections

- Web client → Express API: calls API
- Express API → Health check: routes requests (evidence: `src/app.ts`)
- Express API → Authentication: routes requests (evidence: `src/app.ts`)
- Express API → Activity management: routes requests (evidence: `src/app.ts`)
- Express API → Business discovery: routes requests (evidence: `src/app.ts`)
- Express API → Categories: routes requests (evidence: `src/app.ts`)
- Express API → Administration: routes requests (evidence: `src/app.ts`)
- Express API → Analytics: routes requests (evidence: `src/app.ts`)
- Express API → Reviews: routes requests (evidence: `src/app.ts`)
- Express API → Solicitations: routes requests (evidence: `src/app.ts`)
- Express API → Plan catalog: routes requests (evidence: `src/app.ts`)
- Express API → Subscriptions: routes requests (evidence: `src/app.ts`)
- Express API → Payment handling: routes requests (evidence: `src/app.ts`)
- MongoDB connection → MongoDB Atlas: connects to
- Activity management → Activity records: reads and writes (evidence: `src/modules/activities/controller.ts`)
- Business discovery → Activity records: queries listings (evidence: `src/modules/businesses/controller.ts`)
- Business discovery → Review records: reads reviews (evidence: `src/modules/businesses/controller.ts`)
- Categories → Category records: reads and writes (evidence: `src/modules/categories/controller.ts`)
- Categories → Activity records: queries activities (evidence: `src/modules/categories/controller.ts`)
- Reviews → Review records: reads and writes (evidence: `src/modules/reviews/controller.ts`)
- Reviews → Activity records: uses activity (evidence: `src/modules/reviews/controller.ts`)
- Solicitations → Solicitation records: reads and writes (evidence: `src/modules/solicitations/controller.ts`)
- Authentication → User records: manages accounts (evidence: `src/modules/auth/controller.ts`)
- Authentication → Email delivery: sends messages (evidence: `src/modules/auth/controller.ts`)
- Administration → User records: administers users (evidence: `src/modules/admin/controller.ts`)
- Administration → Activity records: administers listings (evidence: `src/modules/admin/controller.ts`)
- Administration → Category records: manages categories (evidence: `src/modules/admin/controller.ts`)
- Administration → Review records: moderates reviews (evidence: `src/modules/admin/controller.ts`)
- Administration → Plan records: manages plans (evidence: `src/modules/admin/controller.ts`)
- Analytics → Activity records: aggregates activity (evidence: `src/modules/analytics/controller.ts`)
- Analytics → Business events: reads events (evidence: `src/modules/analytics/controller.ts`)
- Analytics → User records: aggregates users (evidence: `src/modules/analytics/controller.ts`)
- Plan catalog → Plan records: reads plans (evidence: `src/modules/plans/controller.ts`)
- Subscriptions → Payment providers: resolves and applies (evidence: `src/modules/subscriptions/controller.ts`)
- Subscriptions → Payment records: reads and creates (evidence: `src/modules/subscriptions/controller.ts`)
- Subscriptions → Plan records: reads plans (evidence: `src/modules/subscriptions/controller.ts`)
- Subscriptions → Subscription records: reads subscription (evidence: `src/modules/subscriptions/controller.ts`)
- Subscriptions → User records: reads user (evidence: `src/modules/subscriptions/controller.ts`)
- Payment handling → Payment providers: uses provider service (evidence: `src/modules/payments/controller.ts`)
- Payment handling → Payment records: uses payment records (evidence: `src/modules/payments/controller.ts`)
- Payment providers → Payment records: updates payments (evidence: `src/services/payments/index.ts`)
- Payment providers → Plan records: resolves plans (evidence: `src/services/payments/index.ts`)
- Payment providers → Subscription records: updates subscriptions (evidence: `src/services/payments/index.ts`)
