# balloprotel/projet_collab26 architecture

> Architecture diagram of the GitHub repository balloprotel/projet_collab26, 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/balloprotel/projet_collab26
- Repository: https://github.com/balloprotel/projet_collab26

## Overview

Collector.shop is a peer-to-peer collectibles marketplace, represented here by a working prototype plus documented V1 capabilities. The implemented workflow is visitor browsing the public catalog, authenticating through Keycloak, then creating a listing or testing role-restricted administration; the API reads and writes listing data in PostgreSQL. Other README capabilities are documented scope, not verified runtime features, so they are shown as planned domains without invented connections. Source sampling was limited to the listed API and web files.

Main entry points: [`apps/api/src/server.js`](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/server.js) (Marketplace API), [`apps/web/src/main.js`](https://github.com/balloprotel/projet_collab26/blob/main/apps/web/src/main.js) (Web application), [`apps/api/src/db.js`](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/db.js) (Listings database), [`apps/api/src/auth.js`](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/auth.js) (JWT authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web prototype"]
  node_webapp["Web application<br/>[main.js]"]
end

subgraph group_api["API and access"]
  node_api["Marketplace API<br/>[server.js]"]
  node_auth["JWT authentication<br/>[auth.js]"]
  node_roles["Role policy<br/>[roles.js]"]
end

subgraph group_state["Identity and data"]
  node_dbinit["Database initialization<br/>[db.js]"]
  node_postgres[("Listings database<br/>[db.js]")]
  node_keycloak["Keycloak identity"]
end

subgraph group_scope["Documented marketplace scope"]
  node_catalog["Public catalog<br/>[server.js]"]
  node_listing["Listing creation<br/>[server.js]"]
  node_adminstats["Admin statistics<br/>[server.js]"]
  node_marketplace["Shops and moderation"]
  node_messaging["Buyer-seller chat"]
  node_payments["Card payments"]
  node_engagement["Alerts and recommendations"]
  node_fraud["Fraud detection"]
  node_accessibility["Accessibility and languages"]
end

node_visitor(("Visitor / buyer / seller"))
node_admin(("Administrator"))

node_visitor -->|"uses"| node_webapp
node_admin -->|"uses"| node_webapp
node_webapp -->|"authenticates"| node_keycloak
node_webapp -->|"requests catalog"| node_api
node_webapp -->|"submits listing"| node_api
node_webapp -->|"requests admin stats"| node_api
node_api -->|"serves"| node_catalog
node_api -->|"creates"| node_listing
node_api -->|"serves"| node_adminstats
node_api -->|"guards private routes"| node_auth
node_auth -->|"verifies JWT"| node_keycloak
node_auth -->|"checks role"| node_roles
node_api -->|"gets user roles"| node_roles
node_api -->|"queries listings"| node_postgres
node_dbinit -->|"initializes"| node_postgres
node_catalog -->|"reads listings"| node_postgres
node_listing -->|"inserts listing"| node_postgres
node_adminstats -->|"counts listings"| node_postgres

click node_webapp "https://github.com/balloprotel/projet_collab26/blob/main/apps/web/src/main.js"
click node_api "https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/server.js"
click node_auth "https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/auth.js"
click node_roles "https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/roles.js"
click node_dbinit "https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/db.js"
click node_postgres "https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/db.js"
click node_keycloak "https://github.com/balloprotel/projet_collab26/blob/main/infra/keycloak/collector-realm.json"
click node_catalog "https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/server.js"
click node_listing "https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/server.js"
click node_adminstats "https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/server.js"
click node_marketplace "https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md"
click node_messaging "https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md"
click node_payments "https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md"
click node_engagement "https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md"
click node_fraud "https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md"
click node_accessibility "https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md"

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_webapp toneBlue
class node_api,node_auth,node_roles toneAmber
class node_dbinit,node_postgres,node_keycloak toneMint
class node_catalog,node_listing,node_adminstats,node_marketplace,node_messaging,node_payments,node_engagement,node_fraud,node_accessibility toneRose
class node_visitor,node_admin toneIndigo
```

## Components

### Web prototype

- [Web application](https://github.com/balloprotel/projet_collab26/blob/main/apps/web/src/main.js): `apps/web/src/main.js`

### API and access

- [Marketplace API](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/server.js): `apps/api/src/server.js`
- [JWT authentication](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/auth.js): `apps/api/src/auth.js`
- [Role policy](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/roles.js): `apps/api/src/roles.js`

### Identity and data

- [Database initialization](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/db.js): `apps/api/src/db.js`
- [Listings database](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/db.js): `apps/api/src/db.js`
- [Keycloak identity](https://github.com/balloprotel/projet_collab26/blob/main/infra/keycloak/collector-realm.json): `infra/keycloak/collector-realm.json`

### Documented marketplace scope

- [Public catalog](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/server.js): `apps/api/src/server.js`
- [Listing creation](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/server.js): `apps/api/src/server.js`
- [Admin statistics](https://github.com/balloprotel/projet_collab26/blob/main/apps/api/src/server.js): `apps/api/src/server.js`
- [Shops and moderation](https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md): `docs/01-product-owner/backlog-fonctionnel.md`
- [Buyer-seller chat](https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md): `docs/01-product-owner/backlog-fonctionnel.md`
- [Card payments](https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md): `docs/01-product-owner/backlog-fonctionnel.md`
- [Alerts and recommendations](https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md): `docs/01-product-owner/backlog-fonctionnel.md`
- [Fraud detection](https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md): `docs/01-product-owner/backlog-fonctionnel.md`
- [Accessibility and languages](https://github.com/balloprotel/projet_collab26/blob/main/docs/01-product-owner/backlog-fonctionnel.md): `docs/01-product-owner/backlog-fonctionnel.md`

### Other components

- **Visitor / buyer / seller**
- **Administrator**

## Connections

- Visitor / buyer / seller → Web application: uses
- Administrator → Web application: uses
- Web application → Keycloak identity: authenticates
- Web application → Marketplace API: requests catalog
- Web application → Marketplace API: submits listing
- Web application → Marketplace API: requests admin stats
- Marketplace API → Public catalog: serves
- Marketplace API → Listing creation: creates
- Marketplace API → Admin statistics: serves
- Marketplace API → JWT authentication: guards private routes
- JWT authentication → Keycloak identity: verifies JWT
- JWT authentication → Role policy: checks role
- Marketplace API → Role policy: gets user roles
- Marketplace API → Listings database: queries listings
- Database initialization → Listings database: initializes
- Public catalog → Listings database: reads listings
- Listing creation → Listings database: inserts listing
- Admin statistics → Listings database: counts listings
