# baabaawassim8-ops/mini-projet-cloud22 architecture

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

- Interactive diagram: https://gitdiagram.com/baabaawassim8-ops/mini-projet-cloud22
- Repository: https://github.com/baabaawassim8-ops/mini-projet-cloud22

## Overview

PME Cloud is a Flask-based commercial management app for small artisan-product businesses. Users work through a browser dashboard: product and order actions pass through the frontend proxy to the relevant service, while the dashboard also presents sales indicators, recent orders, notifications, and service health. Orders coordinate stock changes, persistence, and recorded notifications. The README documents separate PostgreSQL stores for all three services. Relationships shown here are supported by the sampled source and README; the dashboard HTML and Compose wiring were not sampled, so those links are not expanded.

Main entry points: [`app-demo/app.py`](https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/app-demo/app.py) (Frontend API proxy), [`services/commandes/app.py`](https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/services/commandes/app.py) (Orders API), [`services/catalogue/app.py`](https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/services/catalogue/app.py) (Catalogue API), [`services/notifications/app.py`](https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/services/notifications/app.py) (Notification API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard"]
  node_browser["Dashboard UI<br/>[app.js]"]
  node_gateway["Frontend API proxy<br/>[app.py]"]
end

subgraph group_commerce["Commerce services"]
  node_catalogue["Catalogue API<br/>[app.py]"]
  node_orders["Orders API<br/>[app.py]"]
end

subgraph group_messaging["Notifications"]
  node_notifications["Notification API<br/>[app.py]"]
end

subgraph group_storage["Persistent data"]
  node_catalogue_db[("Catalogue PostgreSQL")]
  node_orders_db[("Orders PostgreSQL")]
  node_notifications_db[("Notifications PostgreSQL")]
end

node_user(("Business user"))

node_user -->|"uses"| node_browser
node_browser -->|"requests API"| node_gateway
node_gateway -->|"proxies requests"| node_catalogue
node_gateway -->|"proxies requests"| node_orders
node_gateway -->|"proxies requests"| node_notifications
node_gateway -->|"checks health"| node_catalogue
node_gateway -->|"checks health"| node_orders
node_gateway -->|"checks health"| node_notifications
node_orders -->|"adjusts stock"| node_catalogue
node_orders -->|"records alerts"| node_notifications
node_catalogue -->|"reads and writes"| node_catalogue_db
node_orders -->|"reads and writes"| node_orders_db
node_notifications -->|"reads and writes"| node_notifications_db

click node_browser "https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/app-demo/static/app.js"
click node_gateway "https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/app-demo/app.py"
click node_catalogue "https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/services/catalogue/app.py"
click node_orders "https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/services/commandes/app.py"
click node_notifications "https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/services/notifications/app.py"

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_browser,node_gateway,node_user toneBlue
class node_catalogue,node_orders toneAmber
class node_notifications toneMint
class node_catalogue_db,node_orders_db,node_notifications_db toneRose
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/app-demo/static/app.js): `app-demo/static/app.js`
- [Frontend API proxy](https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/app-demo/app.py): `app-demo/app.py`

### Commerce services

- [Catalogue API](https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/services/catalogue/app.py): `services/catalogue/app.py`
- [Orders API](https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/services/commandes/app.py): `services/commandes/app.py`

### Notifications

- [Notification API](https://github.com/baabaawassim8-ops/mini-projet-cloud22/blob/main/services/notifications/app.py): `services/notifications/app.py`

### Persistent data

- **Catalogue PostgreSQL**
- **Orders PostgreSQL**
- **Notifications PostgreSQL**

### Other components

- **Business user**

## Connections

- Business user → Dashboard UI: uses (evidence: `README.md`)
- Dashboard UI → Frontend API proxy: requests API (evidence: `app-demo/static/app.js`)
- Frontend API proxy → Catalogue API: proxies requests (evidence: `app-demo/app.py`)
- Frontend API proxy → Orders API: proxies requests (evidence: `app-demo/app.py`)
- Frontend API proxy → Notification API: proxies requests (evidence: `app-demo/app.py`)
- Frontend API proxy → Catalogue API: checks health (evidence: `app-demo/app.py`)
- Frontend API proxy → Orders API: checks health (evidence: `app-demo/app.py`)
- Frontend API proxy → Notification API: checks health (evidence: `app-demo/app.py`)
- Orders API → Catalogue API: adjusts stock (evidence: `services/commandes/app.py`)
- Orders API → Notification API: records alerts (evidence: `services/commandes/app.py`)
- Catalogue API → Catalogue PostgreSQL: reads and writes (evidence: `services/catalogue/app.py`)
- Orders API → Orders PostgreSQL: reads and writes (evidence: `services/commandes/app.py`)
- Notification API → Notifications PostgreSQL: reads and writes (evidence: `services/notifications/app.py`)
