# theuniver0/wakatnet architecture

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

- Interactive diagram: https://gitdiagram.com/theuniver0/wakatnet
- Repository: https://github.com/theuniver0/wakatnet

## Overview

WAKATNET is a MikroTik hotspot billing and management product. Its main workflow is to configure sites and routers, enroll routers, offer captive-portal access and plans, process and reconcile payments, then manage tickets and sales from a role-based dashboard. The API also covers authentication, imports, administration, reporting, and operational tasks. Source excerpts show API route registration and several service calls; some listed subsystems were not sampled, so their internal connections are omitted.

Main entry points: [`apps/api/src/app.ts`](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/app.ts) (API application), [`apps/api/src/paiement.ts`](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/paiement.ts) (Payment service), [`apps/dashboard/src/App.tsx`](https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/App.tsx) (Dashboard app), [`apps/dashboard/src`](https://github.com/theuniver0/wakatnet/tree/main/apps/dashboard/src) (Management screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and services"]
  node_api_app["API application<br/>[app.ts]"]
  node_auth["Accounts and auth<br/>[auth.ts]"]
  node_tenant_db["Tenant data access<br/>[base.ts]"]
  node_exploitation["Plans and tickets<br/>[exploitation.ts]"]
  node_imports["Data imports<br/>[import.ts]"]
  node_admin["Administration<br/>[admin.ts]"]
  node_reporting["Reports and status<br/>[tableau.ts]"]
  node_payouts["Payouts<br/>[reversements.ts]"]
  node_health["Health checks<br/>[sante.ts]"]
  node_tasks["Background tasks<br/>[taches.ts]"]
end

subgraph group_dashboard["Management dashboard"]
  node_dashboard_app["Dashboard app<br/>[App.tsx]"]
  node_dashboard_api["Dashboard API client<br/>[api.ts]"]
  node_dashboard_pages["Management screens"]
  node_dashboard_ui["Shared UI<br/>[ui.tsx]"]
  node_format["Display formatting<br/>[format.ts]"]
  node_dashboard_router["Client navigation<br/>[routeur.ts]"]
end

subgraph group_payments["Payment integrations"]
  node_payment_routes["Payment routes<br/>[routes-paiement.ts]"]
  node_payment_service["Payment service<br/>[paiement.ts]"]
  node_providers["Payment providers<br/>[fournisseurs.ts]"]
  node_payment_package["Payment provider package<br/>[fournisseur.ts]"]
end

subgraph group_network["Hotspot network"]
  node_enrollment["Router enrollment<br/>[enrolement.ts]"]
  node_routeros["RouterOS scripts<br/>[routeros.ts]"]
  node_portal["Captive portal<br/>[portail.ts]"]
end

node_operator(("Owner or staff"))
node_database[("PostgreSQL")]

node_operator -->|"uses"| node_dashboard_app
node_dashboard_app -->|"routes to"| node_dashboard_pages
node_dashboard_app -->|"calls"| node_dashboard_api
node_dashboard_app -->|"navigates with"| node_dashboard_router
node_dashboard_pages -->|"calls"| node_dashboard_api
node_dashboard_pages -->|"uses"| node_dashboard_ui
node_dashboard_pages -->|"formats with"| node_format
node_dashboard_api -.->|"HTTP requests"| node_api_app
node_api_app -->|"registers"| node_auth
node_api_app -->|"registers"| node_enrollment
node_api_app -->|"registers"| node_imports
node_api_app -->|"registers"| node_payment_routes
node_api_app -->|"registers"| node_exploitation
node_api_app -->|"registers"| node_admin
node_api_app -->|"registers"| node_portal
node_api_app -->|"creates"| node_payment_service
node_payment_routes -->|"invokes"| node_payment_service
node_payment_service -->|"creates provider"| node_providers
node_payment_service -->|"uses"| node_payment_package
node_portal -->|"uses"| node_payment_service
node_enrollment -->|"generates scripts"| node_routeros
node_auth -->|"uses"| node_tenant_db
node_exploitation -->|"queries"| node_tenant_db
node_imports -->|"uses"| node_tenant_db
node_tenant_db -->|"queries"| node_database
node_api_app -.->|"registers"| node_reporting
node_api_app -.->|"uses"| node_payouts
node_api_app -.->|"uses"| node_health
node_api_app -.->|"uses"| node_tasks

click node_api_app "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/app.ts"
click node_auth "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/auth.ts"
click node_tenant_db "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/base.ts"
click node_enrollment "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/enrolement.ts"
click node_routeros "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/routeros.ts"
click node_portal "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/portail.ts"
click node_exploitation "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/exploitation.ts"
click node_imports "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/import.ts"
click node_admin "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/admin.ts"
click node_payment_routes "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/routes-paiement.ts"
click node_payment_service "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/paiement.ts"
click node_providers "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/fournisseurs.ts"
click node_payment_package "https://github.com/theuniver0/wakatnet/blob/main/packages/payments/src/fournisseur.ts"
click node_reporting "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/tableau.ts"
click node_payouts "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/reversements.ts"
click node_health "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/sante.ts"
click node_tasks "https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/taches.ts"
click node_dashboard_app "https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/App.tsx"
click node_dashboard_api "https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/api.ts"
click node_dashboard_pages "https://github.com/theuniver0/wakatnet/tree/main/apps/dashboard/src"
click node_dashboard_ui "https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/ui.tsx"
click node_format "https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/format.ts"
click node_dashboard_router "https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/routeur.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_app,node_auth,node_tenant_db,node_exploitation,node_imports,node_admin,node_reporting,node_payouts,node_health,node_tasks toneBlue
class node_dashboard_app,node_dashboard_api,node_dashboard_pages,node_dashboard_ui,node_format,node_dashboard_router,node_database toneAmber
class node_payment_routes,node_payment_service,node_providers,node_payment_package toneMint
class node_enrollment,node_routeros,node_portal toneRose
class node_operator toneIndigo
```

## Components

### API and services

- [API application](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Accounts and auth](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/auth.ts): `apps/api/src/auth.ts`
- [Tenant data access](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/base.ts): `apps/api/src/base.ts`
- [Plans and tickets](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/exploitation.ts): `apps/api/src/exploitation.ts`
- [Data imports](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/import.ts): `apps/api/src/import.ts`
- [Administration](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/admin.ts): `apps/api/src/admin.ts`
- [Reports and status](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/tableau.ts): `apps/api/src/tableau.ts`
- [Payouts](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/reversements.ts): `apps/api/src/reversements.ts`
- [Health checks](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/sante.ts): `apps/api/src/sante.ts`
- [Background tasks](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/taches.ts): `apps/api/src/taches.ts`

### Management dashboard

- [Dashboard app](https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/App.tsx): `apps/dashboard/src/App.tsx`
- [Dashboard API client](https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/api.ts): `apps/dashboard/src/api.ts`
- [Management screens](https://github.com/theuniver0/wakatnet/tree/main/apps/dashboard/src): `apps/dashboard/src`
- [Shared UI](https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/ui.tsx): `apps/dashboard/src/ui.tsx`
- [Display formatting](https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/format.ts): `apps/dashboard/src/format.ts`
- [Client navigation](https://github.com/theuniver0/wakatnet/blob/main/apps/dashboard/src/routeur.ts): `apps/dashboard/src/routeur.ts`

### Payment integrations

- [Payment routes](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/routes-paiement.ts): `apps/api/src/routes-paiement.ts`
- [Payment service](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/paiement.ts): `apps/api/src/paiement.ts`
- [Payment providers](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/fournisseurs.ts): `apps/api/src/fournisseurs.ts`
- [Payment provider package](https://github.com/theuniver0/wakatnet/blob/main/packages/payments/src/fournisseur.ts): `packages/payments/src/fournisseur.ts`

### Hotspot network

- [Router enrollment](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/enrolement.ts): `apps/api/src/enrolement.ts`
- [RouterOS scripts](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/routeros.ts): `apps/api/src/routeros.ts`
- [Captive portal](https://github.com/theuniver0/wakatnet/blob/main/apps/api/src/portail.ts): `apps/api/src/portail.ts`

### Other components

- **Owner or staff**
- **PostgreSQL**

## Connections

- Owner or staff → Dashboard app: uses (evidence: `apps/dashboard/src/App.tsx`)
- Dashboard app → Management screens: routes to (evidence: `apps/dashboard/src/App.tsx`)
- Dashboard app → Dashboard API client: calls (evidence: `apps/dashboard/src/App.tsx`)
- Dashboard app → Client navigation: navigates with (evidence: `apps/dashboard/src/App.tsx`)
- Management screens → Dashboard API client: calls (evidence: `apps/dashboard/src/Forfaits.tsx`)
- Management screens → Shared UI: uses (evidence: `apps/dashboard/src/Forfaits.tsx`)
- Management screens → Display formatting: formats with (evidence: `apps/dashboard/src/Forfaits.tsx`)
- Dashboard API client → API application: HTTP requests
- API application → Accounts and auth: registers (evidence: `apps/api/src/app.ts`)
- API application → Router enrollment: registers (evidence: `apps/api/src/app.ts`)
- API application → Data imports: registers (evidence: `apps/api/src/app.ts`)
- API application → Payment routes: registers (evidence: `apps/api/src/app.ts`)
- API application → Plans and tickets: registers (evidence: `apps/api/src/app.ts`)
- API application → Administration: registers (evidence: `apps/api/src/app.ts`)
- API application → Captive portal: registers (evidence: `apps/api/src/app.ts`)
- API application → Payment service: creates (evidence: `apps/api/src/app.ts`)
- Payment routes → Payment service: invokes (evidence: `apps/api/src/routes-paiement.ts`)
- Payment service → Payment providers: creates provider (evidence: `apps/api/src/paiement.ts`)
- Payment service → Payment provider package: uses (evidence: `apps/api/src/paiement.ts`)
- Captive portal → Payment service: uses (evidence: `apps/api/src/portail.ts`)
- Router enrollment → RouterOS scripts: generates scripts (evidence: `apps/api/src/enrolement.ts`)
- Accounts and auth → Tenant data access: uses (evidence: `apps/api/src/auth.ts`)
- Plans and tickets → Tenant data access: queries (evidence: `apps/api/src/exploitation.ts`)
- Data imports → Tenant data access: uses (evidence: `apps/api/src/import.ts`)
- Tenant data access → PostgreSQL: queries (evidence: `apps/api/src/base.ts`)
- API application → Reports and status: registers (evidence: `apps/api/src/app.ts`)
- API application → Payouts: uses
- API application → Health checks: uses
- API application → Background tasks: uses
