# wall966/project-humankind architecture

> Architecture diagram of the GitHub repository wall966/project-humankind, 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/wall966/project-humankind
- Repository: https://github.com/wall966/project-humankind
- Video tour (about a minute): https://gitdiagram.com/wall966/project-humankind/video

## Overview

HUMANKIND is a people-to-people activity platform: users browse categorized offers and requests, create listings, and request participation; listing creators approve or reject requests. The React interface is marked in development, while the Laravel API implements authentication, listing/category browsing, and participation management. Listing creation delegates description embedding to a Python service and selects a category by cosine similarity. README documents PostgreSQL persistence and the broader architecture; source excerpts show controller/service calls, but not database configuration at runtime.

Main entry points: [`humankind/routes/api.php`](https://github.com/wall966/project-humankind/blob/main/humankind/routes/api.php) (API routes), [`front-end/src/App.jsx`](https://github.com/wall966/project-humankind/blob/main/front-end/src/App.jsx) (React application), [`humankind/app/Http/Controllers/ParticipationController.php`](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/ParticipationController.php) (Participation workflow), [`humankind/app/Http/Controllers/AuthController.php`](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/AuthController.php) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React interface"]
  node_spa["React application<br/>[App.jsx]"]
  node_welcome["Welcome screen<br/>[Welcome.jsx]"]
  node_login["Login form<br/>[Login.jsx]"]
  node_listingform["Listing form<br/>[Formulaire.jsx]"]
end

subgraph group_api["Laravel API"]
  node_routes["API routes<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_loginvalidation["Login validation<br/>[LoginRequest.php]"]
  node_registervalidation["Registration validation"]
  node_listingcontroller["Listing operations"]
  node_categorycontroller["Category browsing"]
  node_participationcontroller["Participation workflow"]
  node_participatevalidation["Join validation"]
  node_updatevalidation["Decision validation"]
end

subgraph group_categorization["AI categorization"]
  node_embeddinglogic["Embedding and similarity"]
  node_embeddingservice["Text embedding service<br/>[main.py]"]
end

subgraph group_domain["Activity domain"]
  node_user["User account<br/>[User.php]"]
  node_listing["Activity listing<br/>[Listing.php]"]
  node_category["Activity category<br/>[Category.php]"]
  node_participation["Participation record<br/>[Participation.php]"]
end

node_person(("User"))
node_postgres[("PostgreSQL")]

node_person -->|"uses"| node_spa
node_spa -->|"routes to"| node_welcome
node_spa -->|"routes to"| node_login
node_spa -->|"routes to"| node_listingform
node_spa -.->|"consumes API"| node_routes
node_routes -->|"dispatches"| node_auth
node_routes -->|"dispatches"| node_listingcontroller
node_routes -->|"dispatches"| node_categorycontroller
node_routes -->|"dispatches"| node_participationcontroller
node_auth -->|"validates login"| node_loginvalidation
node_auth -->|"validates signup"| node_registervalidation
node_auth -->|"creates account"| node_user
node_listingcontroller -->|"requests embedding"| node_embeddinglogic
node_embeddinglogic -->|"sends description"| node_embeddingservice
node_listingcontroller -->|"loads categories"| node_category
node_embeddinglogic -->|"compares embeddings"| node_category
node_listingcontroller -->|"creates and reads"| node_listing
node_categorycontroller -->|"browses categories"| node_category
node_participationcontroller -->|"validates request"| node_participatevalidation
node_participationcontroller -->|"validates decision"| node_updatevalidation
node_participationcontroller -->|"checks listing"| node_listing
node_participationcontroller -->|"creates and updates"| node_participation
node_user -->|"has participations"| node_participation
node_listing -->|"belongs to"| node_category
node_listing -->|"has participations"| node_participation
node_routes -.->|"persists domain data"| node_postgres

click node_spa "https://github.com/wall966/project-humankind/blob/main/front-end/src/App.jsx"
click node_welcome "https://github.com/wall966/project-humankind/blob/main/front-end/src/Welcome.jsx"
click node_login "https://github.com/wall966/project-humankind/blob/main/front-end/src/Login.jsx"
click node_listingform "https://github.com/wall966/project-humankind/blob/main/front-end/src/Formulaire.jsx"
click node_routes "https://github.com/wall966/project-humankind/blob/main/humankind/routes/api.php"
click node_auth "https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/AuthController.php"
click node_loginvalidation "https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Requests/Auth/LoginRequest.php"
click node_registervalidation "https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Requests/Auth/RegisterRequest.php"
click node_listingcontroller "https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/ListingController.php"
click node_categorycontroller "https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/CategoryController.php"
click node_participationcontroller "https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/ParticipationController.php"
click node_participatevalidation "https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Requests/ParticipateRequest.php"
click node_updatevalidation "https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Requests/UpdateParticipationRequest.php"
click node_embeddinglogic "https://github.com/wall966/project-humankind/blob/main/humankind/app/Services/EmbeddingService.php"
click node_embeddingservice "https://github.com/wall966/project-humankind/blob/main/embedding-service/main.py"
click node_user "https://github.com/wall966/project-humankind/blob/main/humankind/app/Models/User.php"
click node_listing "https://github.com/wall966/project-humankind/blob/main/humankind/app/Models/Listing.php"
click node_category "https://github.com/wall966/project-humankind/blob/main/humankind/app/Models/Category.php"
click node_participation "https://github.com/wall966/project-humankind/blob/main/humankind/app/Models/Participation.php"

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_spa,node_welcome,node_login,node_listingform,node_person toneBlue
class node_routes,node_auth,node_loginvalidation,node_registervalidation,node_listingcontroller,node_categorycontroller,node_participationcontroller,node_participatevalidation,node_updatevalidation,node_postgres toneAmber
class node_embeddinglogic,node_embeddingservice toneMint
class node_user,node_listing,node_category,node_participation toneRose
```

## Components

### React interface

- [React application](https://github.com/wall966/project-humankind/blob/main/front-end/src/App.jsx): `front-end/src/App.jsx`
- [Welcome screen](https://github.com/wall966/project-humankind/blob/main/front-end/src/Welcome.jsx): `front-end/src/Welcome.jsx`
- [Login form](https://github.com/wall966/project-humankind/blob/main/front-end/src/Login.jsx): `front-end/src/Login.jsx`
- [Listing form](https://github.com/wall966/project-humankind/blob/main/front-end/src/Formulaire.jsx): `front-end/src/Formulaire.jsx`

### Laravel API

- [API routes](https://github.com/wall966/project-humankind/blob/main/humankind/routes/api.php): `humankind/routes/api.php`
- [Authentication](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/AuthController.php): `humankind/app/Http/Controllers/AuthController.php`
- [Login validation](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Requests/Auth/LoginRequest.php): `humankind/app/Http/Requests/Auth/LoginRequest.php`
- [Registration validation](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Requests/Auth/RegisterRequest.php): `humankind/app/Http/Requests/Auth/RegisterRequest.php`
- [Listing operations](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/ListingController.php): `humankind/app/Http/Controllers/ListingController.php`
- [Category browsing](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/CategoryController.php): `humankind/app/Http/Controllers/CategoryController.php`
- [Participation workflow](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Controllers/ParticipationController.php): `humankind/app/Http/Controllers/ParticipationController.php`
- [Join validation](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Requests/ParticipateRequest.php): `humankind/app/Http/Requests/ParticipateRequest.php`
- [Decision validation](https://github.com/wall966/project-humankind/blob/main/humankind/app/Http/Requests/UpdateParticipationRequest.php): `humankind/app/Http/Requests/UpdateParticipationRequest.php`

### AI categorization

- [Embedding and similarity](https://github.com/wall966/project-humankind/blob/main/humankind/app/Services/EmbeddingService.php): `humankind/app/Services/EmbeddingService.php`
- [Text embedding service](https://github.com/wall966/project-humankind/blob/main/embedding-service/main.py): `embedding-service/main.py`

### Activity domain

- [User account](https://github.com/wall966/project-humankind/blob/main/humankind/app/Models/User.php): `humankind/app/Models/User.php`
- [Activity listing](https://github.com/wall966/project-humankind/blob/main/humankind/app/Models/Listing.php): `humankind/app/Models/Listing.php`
- [Activity category](https://github.com/wall966/project-humankind/blob/main/humankind/app/Models/Category.php): `humankind/app/Models/Category.php`
- [Participation record](https://github.com/wall966/project-humankind/blob/main/humankind/app/Models/Participation.php): `humankind/app/Models/Participation.php`

### Other components

- **User**
- **PostgreSQL**

## Connections

- User → React application: uses
- React application → Welcome screen: routes to (evidence: `front-end/src/App.jsx`)
- React application → Login form: routes to (evidence: `front-end/src/App.jsx`)
- React application → Listing form: routes to (evidence: `front-end/src/App.jsx`)
- React application → API routes: consumes API
- API routes → Authentication: dispatches (evidence: `humankind/routes/api.php`)
- API routes → Listing operations: dispatches (evidence: `humankind/routes/api.php`)
- API routes → Category browsing: dispatches (evidence: `humankind/routes/api.php`)
- API routes → Participation workflow: dispatches (evidence: `humankind/routes/api.php`)
- Authentication → Login validation: validates login (evidence: `humankind/app/Http/Controllers/AuthController.php`)
- Authentication → Registration validation: validates signup (evidence: `humankind/app/Http/Controllers/AuthController.php`)
- Authentication → User account: creates account (evidence: `humankind/app/Http/Controllers/AuthController.php`)
- Listing operations → Embedding and similarity: requests embedding (evidence: `humankind/app/Http/Controllers/ListingController.php`)
- Embedding and similarity → Text embedding service: sends description (evidence: `humankind/app/Services/EmbeddingService.php`)
- Listing operations → Activity category: loads categories (evidence: `humankind/app/Http/Controllers/ListingController.php`)
- Embedding and similarity → Activity category: compares embeddings (evidence: `humankind/app/Services/EmbeddingService.php`)
- Listing operations → Activity listing: creates and reads (evidence: `humankind/app/Http/Controllers/ListingController.php`)
- Category browsing → Activity category: browses categories (evidence: `humankind/app/Http/Controllers/CategoryController.php`)
- Participation workflow → Join validation: validates request (evidence: `humankind/app/Http/Controllers/ParticipationController.php`)
- Participation workflow → Decision validation: validates decision (evidence: `humankind/app/Http/Controllers/ParticipationController.php`)
- Participation workflow → Activity listing: checks listing (evidence: `humankind/app/Http/Controllers/ParticipationController.php`)
- Participation workflow → Participation record: creates and updates (evidence: `humankind/app/Http/Controllers/ParticipationController.php`)
- User account → Participation record: has participations (evidence: `humankind/app/Models/User.php`)
- Activity listing → Activity category: belongs to (evidence: `humankind/app/Models/Listing.php`)
- Activity listing → Participation record: has participations (evidence: `humankind/app/Models/Listing.php`)
- API routes → PostgreSQL: persists domain data
