# ilyesbelahsen/btp-project architecture

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

- Interactive diagram: https://gitdiagram.com/ilyesbelahsen/btp-project
- Repository: https://github.com/ilyesbelahsen/btp-project

## Overview

This is a construction-project operations suite: mobile workers record and submit time against assigned jobs, while web staff manage projects, workers, costs, billing, payroll, and reporting. The NestJS API exposes role-protected domain operations backed by Prisma; sampled controllers show the time-entry and administration routes delegating to services. Web/mobile-to-API links are shown as unverified because the excerpts do not establish their HTTP wiring. The README is empty, so capability coverage is based on the repository tree and sampled source.

Main entry points: [`apps/web/src/app/(dashboard)/dashboard/page.tsx`](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/web/src/app/(dashboard)/dashboard/page.tsx) (Staff web app), [`apps/api/src/modules/prisma/prisma.service.ts`](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/prisma/prisma.service.ts) (Prisma data access), [`apps/mobile/app/(tabs)/pointage.tsx`](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/mobile/app/(tabs)/pointage.tsx) (Worker mobile app), [`apps/api/src/modules/pointage/pointage.service.ts`](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/pointage/pointage.service.ts) (Time entry and review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Web and mobile clients"]
  node_mobile["Worker mobile app<br/>[pointage.tsx]"]
  node_web["Staff web app<br/>[page.tsx]"]
  node_mobile_auth["Mobile sign-in<br/>[auth.service.ts]"]
  node_web_auth["Web sign-in<br/>[auth.service.ts]"]
end

subgraph group_identity["Identity and access"]
  node_auth_api["Authentication API<br/>[auth.service.ts]"]
  node_user_api["Worker accounts<br/>[users.service.ts]"]
  node_redis[("Token blacklist<br/>[redis.service.ts]")]
end

subgraph group_operations["Project operations"]
  node_jobs_api["Construction sites"]
  node_tasks_api["Site task plans"]
  node_time_api["Time entry and review"]
end

subgraph group_finance["Finance and insight"]
  node_cost_api["Site expenses"]
  node_billing_api["Situations and invoicing"]
  node_payroll_api["Payroll and allowances<br/>[paie.controller.ts]"]
  node_reports_api["Reporting<br/>[rapport.service.ts]"]
  node_zones_api["Zone premiums<br/>[zone.service.ts]"]
end

subgraph group_persistence["API and persistence"]
  node_prisma["Prisma data access<br/>[prisma.service.ts]"]
  node_database[("Application database")]
end

node_worker(("Worker"))
node_manager(("Company staff"))

node_worker -->|"records time"| node_mobile
node_manager -->|"manages operations"| node_web
node_mobile -.->|"signs in"| node_mobile_auth
node_web -.->|"signs in"| node_web_auth
node_mobile -.->|"submits entries"| node_time_api
node_mobile -.->|"views assigned sites"| node_jobs_api
node_web -.->|"manages sites"| node_jobs_api
node_web -.->|"manages tasks"| node_tasks_api
node_web -.->|"reviews expenses"| node_cost_api
node_web -.->|"manages billing"| node_billing_api
node_web -.->|"previews payroll"| node_payroll_api
node_web -.->|"views reports"| node_reports_api
node_auth_api -->|"looks up users"| node_user_api
node_auth_api -->|"blacklists tokens"| node_redis
node_jobs_api -->|"queries data"| node_prisma
node_user_api -->|"queries data"| node_prisma
node_time_api -.->|"persists entries"| node_prisma
node_cost_api -.->|"persists expenses"| node_prisma
node_billing_api -.->|"persists billing"| node_prisma
node_payroll_api -.->|"reads payroll data"| node_prisma
node_reports_api -.->|"reads aggregates"| node_prisma
node_zones_api -.->|"persists premiums"| node_prisma
node_prisma -.->|"reads and writes"| node_database
node_time_api -.->|"checks site assignment"| node_jobs_api
node_payroll_api -.->|"uses approved time"| node_time_api

click node_mobile "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/mobile/app/(tabs)/pointage.tsx"
click node_web "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/web/src/app/(dashboard)/dashboard/page.tsx"
click node_mobile_auth "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/mobile/src/services/auth.service.ts"
click node_web_auth "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/web/src/features/auth/services/auth.service.ts"
click node_auth_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/auth/auth.service.ts"
click node_user_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/users/users.service.ts"
click node_redis "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/redis/redis.service.ts"
click node_jobs_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/chantier/chantier.service.ts"
click node_tasks_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/tache-chantier/tache-chantier.controller.ts"
click node_time_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/pointage/pointage.service.ts"
click node_cost_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/depense/depense.controller.ts"
click node_billing_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/facturation/facturation.controller.ts"
click node_payroll_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/paie/paie.controller.ts"
click node_reports_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/rapport/rapport.service.ts"
click node_zones_api "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/zone/zone.service.ts"
click node_prisma "https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/prisma/prisma.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_mobile,node_web,node_mobile_auth,node_web_auth toneBlue
class node_auth_api,node_user_api,node_redis toneAmber
class node_jobs_api,node_tasks_api,node_time_api toneMint
class node_cost_api,node_billing_api,node_payroll_api,node_reports_api,node_zones_api,node_worker toneRose
class node_prisma,node_database,node_manager toneIndigo
```

## Components

### Web and mobile clients

- [Worker mobile app](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/mobile/app/(tabs)/pointage.tsx): `apps/mobile/app/(tabs)/pointage.tsx`
- [Staff web app](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/web/src/app/(dashboard)/dashboard/page.tsx): `apps/web/src/app/(dashboard)/dashboard/page.tsx`
- [Mobile sign-in](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/mobile/src/services/auth.service.ts): `apps/mobile/src/services/auth.service.ts`
- [Web sign-in](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/web/src/features/auth/services/auth.service.ts): `apps/web/src/features/auth/services/auth.service.ts`

### Identity and access

- [Authentication API](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/auth/auth.service.ts): `apps/api/src/modules/auth/auth.service.ts`
- [Worker accounts](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/users/users.service.ts): `apps/api/src/modules/users/users.service.ts`
- [Token blacklist](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/redis/redis.service.ts): `apps/api/src/modules/redis/redis.service.ts`

### Project operations

- [Construction sites](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/chantier/chantier.service.ts): `apps/api/src/modules/chantier/chantier.service.ts`
- [Site task plans](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/tache-chantier/tache-chantier.controller.ts): `apps/api/src/modules/tache-chantier/tache-chantier.controller.ts`
- [Time entry and review](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/pointage/pointage.service.ts): `apps/api/src/modules/pointage/pointage.service.ts`

### Finance and insight

- [Site expenses](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/depense/depense.controller.ts): `apps/api/src/modules/depense/depense.controller.ts`
- [Situations and invoicing](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/facturation/facturation.controller.ts): `apps/api/src/modules/facturation/facturation.controller.ts`
- [Payroll and allowances](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/paie/paie.controller.ts): `apps/api/src/modules/paie/paie.controller.ts`
- [Reporting](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/rapport/rapport.service.ts): `apps/api/src/modules/rapport/rapport.service.ts`
- [Zone premiums](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/zone/zone.service.ts): `apps/api/src/modules/zone/zone.service.ts`

### API and persistence

- [Prisma data access](https://github.com/ilyesbelahsen/btp-project/blob/main/apps/api/src/modules/prisma/prisma.service.ts): `apps/api/src/modules/prisma/prisma.service.ts`
- **Application database**

### Other components

- **Worker**
- **Company staff**

## Connections

- Worker → Worker mobile app: records time
- Company staff → Staff web app: manages operations
- Worker mobile app → Mobile sign-in: signs in
- Staff web app → Web sign-in: signs in
- Worker mobile app → Time entry and review: submits entries
- Worker mobile app → Construction sites: views assigned sites
- Staff web app → Construction sites: manages sites
- Staff web app → Site task plans: manages tasks
- Staff web app → Site expenses: reviews expenses
- Staff web app → Situations and invoicing: manages billing
- Staff web app → Payroll and allowances: previews payroll
- Staff web app → Reporting: views reports
- Authentication API → Worker accounts: looks up users (evidence: `apps/api/src/modules/auth/auth.service.ts`)
- Authentication API → Token blacklist: blacklists tokens (evidence: `apps/api/src/modules/auth/auth.service.ts`)
- Construction sites → Prisma data access: queries data (evidence: `apps/api/src/modules/chantier/chantier.service.ts`)
- Worker accounts → Prisma data access: queries data (evidence: `apps/api/src/modules/users/users.service.ts`)
- Time entry and review → Prisma data access: persists entries
- Site expenses → Prisma data access: persists expenses
- Situations and invoicing → Prisma data access: persists billing
- Payroll and allowances → Prisma data access: reads payroll data
- Reporting → Prisma data access: reads aggregates
- Zone premiums → Prisma data access: persists premiums
- Prisma data access → Application database: reads and writes
- Time entry and review → Construction sites: checks site assignment
- Payroll and allowances → Time entry and review: uses approved time
