# balloprotel/projet_indiv26-espace-com-troc-don architecture

> Architecture diagram of the GitHub repository balloprotel/projet_indiv26-espace-com-troc-don, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/balloprotel/projet_indiv26-espace-com-troc-don
- Repository: https://github.com/balloprotel/projet_indiv26-espace-com-troc-don
- Video tour (about a minute): https://gitdiagram.com/balloprotel/projet_indiv26-espace-com-troc-don/video

## Overview

This repository implements a community donation-and-barter marketplace: members publish listings and images, moderators approve them, and members propose exchanges or donations through completion. The web client reaches services through a URL-preserving gateway; Catalog owns listing data, Marketplace owns proposals and transactions, and Notification consumes events. The README documents Keycloak, MinIO, PostgreSQL, and RabbitMQ roles. Edges below rely on README statements and the shown controller/module references; unsampled service internals and runtime wiring are not asserted.

Main entry points: [`apps/gateway/src/proxy.ts`](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/gateway/src/proxy.ts) (API Gateway), [`apps/marketplace-service/src/proposals/proposals.controller.ts`](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/proposals/proposals.controller.ts) (Proposals), [`apps/catalog-service/src/listings`](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/tree/main/apps/catalog-service/src/listings) (Listings and moderation), [`apps/marketplace-service/src/catalog/catalog-client.service.ts`](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/catalog/catalog-client.service.ts) (Catalog client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_web["Marketplace UI"]
end

subgraph group_edge["API edge"]
  node_gateway["API Gateway<br/>[proxy.ts]"]
  node_legacy["Legacy API fallback"]
end

subgraph group_catalog["Catalog service"]
  node_catalog_api["Listings and moderation"]
  node_catalog_images["Image management"]
  node_object_storage[("Image object storage")]
  node_catalog_internal["Internal listing API"]
  node_catalog_db[("Catalog PostgreSQL<br/>[prisma.service.ts]")]
end

subgraph group_market["Marketplace service"]
  node_market_api["Proposals"]
  node_transactions["Transactions"]
  node_catalog_client["Catalog client"]
  node_market_db[("Marketplace PostgreSQL<br/>[prisma.service.ts]")]
  node_event_publisher["Event publisher and outbox"]
end

subgraph group_notify["Notifications"]
  node_rabbit["RabbitMQ"]
  node_consumer["Event consumer"]
  node_notification_store[("Notification inbox")]
  node_notification_api["Recent notifications"]
end

node_visitor(("Visitor or member"))
node_keycloak["Keycloak OIDC"]
node_minio[("MinIO")]

node_visitor -->|"uses"| node_web
node_web -->|"calls API"| node_gateway
node_gateway -->|"routes requests"| node_catalog_api
node_gateway -->|"routes requests"| node_market_api
node_gateway -.->|"fallback routes"| node_legacy
node_catalog_api -.->|"reads and writes"| node_catalog_db
node_catalog_images -.->|"stores images"| node_object_storage
node_object_storage -->|"uses"| node_minio
node_market_api -.->|"persists proposals"| node_market_db
node_transactions -.->|"persists transactions"| node_market_db
node_market_api -.->|"checks listing"| node_catalog_client
node_transactions -.->|"checks listing"| node_catalog_client
node_catalog_client -->|"requests listing"| node_catalog_internal
node_catalog_internal -.->|"reads listings"| node_catalog_api
node_event_publisher -->|"records outbox"| node_market_db
node_event_publisher -->|"publishes events"| node_rabbit
node_rabbit -->|"delivers events"| node_consumer
node_consumer -->|"stores and deduplicates"| node_notification_store
node_notification_api -->|"reads recent"| node_notification_store
node_visitor -->|"authenticates"| node_keycloak

click node_web "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/tree/main/apps/web"
click node_gateway "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/gateway/src/proxy.ts"
click node_legacy "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/tree/main/apps/api/src"
click node_catalog_api "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/tree/main/apps/catalog-service/src/listings"
click node_catalog_images "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/catalog-service/src/listings/listing-images.service.ts"
click node_object_storage "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/catalog-service/src/storage/object-storage.service.ts"
click node_catalog_internal "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/catalog-service/src/internal/internal-listings.controller.ts"
click node_catalog_db "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/catalog-service/src/prisma/prisma.service.ts"
click node_market_api "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/proposals/proposals.controller.ts"
click node_transactions "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/transactions/transactions.controller.ts"
click node_catalog_client "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/catalog/catalog-client.service.ts"
click node_market_db "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/prisma/prisma.service.ts"
click node_event_publisher "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/events/event-publisher.service.ts"
click node_consumer "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/notification-service/src/rabbitmq/rabbitmq.consumer.ts"
click node_notification_store "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/notification-service/src/notifications/notification.store.ts"
click node_notification_api "https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/notification-service/src/notifications/notifications.controller.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_web toneBlue
class node_gateway,node_legacy,node_minio toneAmber
class node_catalog_api,node_catalog_images,node_object_storage,node_catalog_internal,node_catalog_db toneMint
class node_market_api,node_transactions,node_catalog_client,node_market_db,node_event_publisher toneRose
class node_rabbit,node_consumer,node_notification_store,node_notification_api,node_visitor,node_keycloak toneIndigo
```

## Components

### Web experience

- [Marketplace UI](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/tree/main/apps/web): `apps/web`

### API edge

- [API Gateway](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/gateway/src/proxy.ts): `apps/gateway/src/proxy.ts`
- [Legacy API fallback](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/tree/main/apps/api/src): `apps/api/src`

### Catalog service

- [Listings and moderation](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/tree/main/apps/catalog-service/src/listings): `apps/catalog-service/src/listings`
- [Image management](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/catalog-service/src/listings/listing-images.service.ts): `apps/catalog-service/src/listings/listing-images.service.ts`
- [Image object storage](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/catalog-service/src/storage/object-storage.service.ts): `apps/catalog-service/src/storage/object-storage.service.ts`
- [Internal listing API](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/catalog-service/src/internal/internal-listings.controller.ts): `apps/catalog-service/src/internal/internal-listings.controller.ts`
- [Catalog PostgreSQL](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/catalog-service/src/prisma/prisma.service.ts): `apps/catalog-service/src/prisma/prisma.service.ts`

### Marketplace service

- [Proposals](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/proposals/proposals.controller.ts): `apps/marketplace-service/src/proposals/proposals.controller.ts`
- [Transactions](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/transactions/transactions.controller.ts): `apps/marketplace-service/src/transactions/transactions.controller.ts`
- [Catalog client](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/catalog/catalog-client.service.ts): `apps/marketplace-service/src/catalog/catalog-client.service.ts`
- [Marketplace PostgreSQL](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/prisma/prisma.service.ts): `apps/marketplace-service/src/prisma/prisma.service.ts`
- [Event publisher and outbox](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/marketplace-service/src/events/event-publisher.service.ts): `apps/marketplace-service/src/events/event-publisher.service.ts`

### Notifications

- **RabbitMQ**
- [Event consumer](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/notification-service/src/rabbitmq/rabbitmq.consumer.ts): `apps/notification-service/src/rabbitmq/rabbitmq.consumer.ts`
- [Notification inbox](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/notification-service/src/notifications/notification.store.ts): `apps/notification-service/src/notifications/notification.store.ts`
- [Recent notifications](https://github.com/balloprotel/projet_indiv26-espace-com-troc-don/blob/main/apps/notification-service/src/notifications/notifications.controller.ts): `apps/notification-service/src/notifications/notifications.controller.ts`

### Other components

- **Visitor or member**
- **Keycloak OIDC**
- **MinIO**

## Connections

- Visitor or member → Marketplace UI: uses (evidence: `README.md`)
- Marketplace UI → API Gateway: calls API (evidence: `README.md`)
- API Gateway → Listings and moderation: routes requests (evidence: `README.md`)
- API Gateway → Proposals: routes requests (evidence: `README.md`)
- API Gateway → Legacy API fallback: fallback routes (evidence: `README.md`)
- Listings and moderation → Catalog PostgreSQL: reads and writes
- Image management → Image object storage: stores images
- Image object storage → MinIO: uses (evidence: `README.md`)
- Proposals → Marketplace PostgreSQL: persists proposals
- Transactions → Marketplace PostgreSQL: persists transactions
- Proposals → Catalog client: checks listing
- Transactions → Catalog client: checks listing
- Catalog client → Internal listing API: requests listing (evidence: `README.md`)
- Internal listing API → Listings and moderation: reads listings
- Event publisher and outbox → Marketplace PostgreSQL: records outbox (evidence: `README.md`)
- Event publisher and outbox → RabbitMQ: publishes events (evidence: `README.md`)
- RabbitMQ → Event consumer: delivers events (evidence: `README.md`)
- Event consumer → Notification inbox: stores and deduplicates (evidence: `README.md`)
- Recent notifications → Notification inbox: reads recent (evidence: `apps/notification-service/src/notifications/notifications.controller.ts`)
- Visitor or member → Keycloak OIDC: authenticates (evidence: `README.md`)
