# wilfried07-k/projet-cnps architecture

> Architecture diagram of the GitHub repository wilfried07-k/projet-cnps, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wilfried07-k/projet-cnps
- Repository: https://github.com/wilfried07-k/projet-cnps

## Overview

CNPS Order Manager is a procurement workflow application with a React client and Express API. Users can browse the service catalogue, create and track purchase requests, and access tendering, contract, budget, dispute, and administration capabilities. The backend exposes domain APIs and the sampled order controller reads and writes a shared store; its configured database behavior is not established by the excerpts. The frontend route map and backend entry point are sampled, but most feature-to-API wiring is not, so those links are omitted.

Main entry points: [`cnps-order-manager/src/App.tsx`](https://github.com/wilfried07-k/projet-cnps/blob/main/cnps-order-manager/src/App.tsx) (App routes), [`backend-cnps/src/routes/index.js`](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/routes/index.js) (API route index), [`backend-cnps/src/routes/commandesRoutes.js`](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/routes/commandesRoutes.js) (Order routes), [`backend-cnps/src/controllers/commandesController.js`](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/controllers/commandesController.js) (Order controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["App routes<br/>[App.tsx]"]
  node_authui["Sign-in pages"]
  node_dashboard["Role dashboards"]
end

subgraph group_procurement["Procurement workflows"]
  node_catalog["Service catalogue"]
  node_requests["Purchase requests"]
  node_tenders["Tendering and offers"]
  node_contracts["Contracts"]
end

subgraph group_operations["Operations and oversight"]
  node_budget["Budget tracking"]
  node_disputes["Dispute handling"]
  node_admin["Administration"]
  node_audit["Audit history"]
end

subgraph group_backend["Backend API"]
  node_backendapp["Express API app<br/>[app.js]"]
  node_api_routes["API route index<br/>[index.js]"]
  node_order_routes["Order routes<br/>[commandesRoutes.js]"]
  node_order_controller["Order controller"]
  node_tender_routes["Tender routes"]
  node_tender_controller["Tender controller"]
  node_store[("Shared data store<br/>[store.js]")]
  node_other_domains["Other domain APIs"]
end

node_user(("Staff or provider"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_requests
node_app -->|"routes to"| node_tenders
node_app -->|"routes to"| node_contracts
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_budget
node_app -->|"routes to"| node_disputes
node_app -->|"routes to"| node_admin
node_backendapp -->|"mounts API"| node_api_routes
node_api_routes -->|"routes orders"| node_order_routes
node_api_routes -->|"routes tenders"| node_tender_routes
node_order_routes -->|"dispatches"| node_order_controller
node_tender_routes -->|"dispatches"| node_tender_controller
node_order_controller -->|"reads and writes"| node_store
node_tender_controller -->|"reads and writes"| node_store

click node_app "https://github.com/wilfried07-k/projet-cnps/blob/main/cnps-order-manager/src/App.tsx"
click node_authui "https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/auth"
click node_dashboard "https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/dashboard"
click node_catalog "https://github.com/wilfried07-k/projet-cnps/blob/main/cnps-order-manager/src/pages/portail/CatalogueServicesPage.tsx"
click node_requests "https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/commandes"
click node_tenders "https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/appels-offres"
click node_contracts "https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/contrats"
click node_backendapp "https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/app.js"
click node_api_routes "https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/routes/index.js"
click node_order_routes "https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/routes/commandesRoutes.js"
click node_order_controller "https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/controllers/commandesController.js"
click node_tender_routes "https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/routes/appelsOffresRoutes.js"
click node_tender_controller "https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/controllers/appelsOffresController.js"
click node_store "https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/data/store.js"
click node_other_domains "https://github.com/wilfried07-k/projet-cnps/tree/main/backend-cnps/src/controllers"
click node_budget "https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/budget"
click node_disputes "https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/litiges"
click node_admin "https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/admin"
click node_audit "https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/controllers/historiqueController.js"

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_app,node_authui,node_dashboard toneBlue
class node_catalog,node_requests,node_tenders,node_contracts toneAmber
class node_budget,node_disputes,node_admin,node_audit toneMint
class node_backendapp,node_api_routes,node_order_routes,node_order_controller,node_tender_routes,node_tender_controller,node_store,node_other_domains toneRose
class node_user toneIndigo
```

## Components

### Web application

- [App routes](https://github.com/wilfried07-k/projet-cnps/blob/main/cnps-order-manager/src/App.tsx): `cnps-order-manager/src/App.tsx`
- [Sign-in pages](https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/auth): `cnps-order-manager/src/pages/auth`
- [Role dashboards](https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/dashboard): `cnps-order-manager/src/pages/dashboard`

### Procurement workflows

- [Service catalogue](https://github.com/wilfried07-k/projet-cnps/blob/main/cnps-order-manager/src/pages/portail/CatalogueServicesPage.tsx): `cnps-order-manager/src/pages/portail/CatalogueServicesPage.tsx`
- [Purchase requests](https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/commandes): `cnps-order-manager/src/pages/commandes`
- [Tendering and offers](https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/appels-offres): `cnps-order-manager/src/pages/appels-offres`
- [Contracts](https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/contrats): `cnps-order-manager/src/pages/contrats`

### Operations and oversight

- [Budget tracking](https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/budget): `cnps-order-manager/src/pages/budget`
- [Dispute handling](https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/litiges): `cnps-order-manager/src/pages/litiges`
- [Administration](https://github.com/wilfried07-k/projet-cnps/tree/main/cnps-order-manager/src/pages/admin): `cnps-order-manager/src/pages/admin`
- [Audit history](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/controllers/historiqueController.js): `backend-cnps/src/controllers/historiqueController.js`

### Backend API

- [Express API app](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/app.js): `backend-cnps/src/app.js`
- [API route index](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/routes/index.js): `backend-cnps/src/routes/index.js`
- [Order routes](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/routes/commandesRoutes.js): `backend-cnps/src/routes/commandesRoutes.js`
- [Order controller](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/controllers/commandesController.js): `backend-cnps/src/controllers/commandesController.js`
- [Tender routes](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/routes/appelsOffresRoutes.js): `backend-cnps/src/routes/appelsOffresRoutes.js`
- [Tender controller](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/controllers/appelsOffresController.js): `backend-cnps/src/controllers/appelsOffresController.js`
- [Shared data store](https://github.com/wilfried07-k/projet-cnps/blob/main/backend-cnps/src/data/store.js): `backend-cnps/src/data/store.js`
- [Other domain APIs](https://github.com/wilfried07-k/projet-cnps/tree/main/backend-cnps/src/controllers): `backend-cnps/src/controllers`

### Other components

- **Staff or provider**

## Connections

- Staff or provider → App routes: uses
- App routes → Sign-in pages: routes to
- App routes → Role dashboards: routes to
- App routes → Purchase requests: routes to
- App routes → Tendering and offers: routes to
- App routes → Contracts: routes to
- App routes → Service catalogue: routes to
- App routes → Budget tracking: routes to
- App routes → Dispute handling: routes to
- App routes → Administration: routes to
- Express API app → API route index: mounts API
- API route index → Order routes: routes orders
- API route index → Tender routes: routes tenders
- Order routes → Order controller: dispatches
- Tender routes → Tender controller: dispatches
- Order controller → Shared data store: reads and writes
- Tender controller → Shared data store: reads and writes
