# booz974/kartie-react-apple architecture

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

- Interactive diagram: https://gitdiagram.com/booz974/kartie-react-apple
- Repository: https://github.com/booz974/kartie-react-apple

## Overview

Kartie est une application de participation citoyenne et de vie de quartier. Le parcours principal va de la navigation vers un quartier à la consultation de ses informations, échanges et initiatives locales; la plateforme couvre aussi associations, contenus, démocratie participative et messagerie. Les routes et le flux d’administration des documents RAG sont directement visibles dans les extraits. Les autres connexions internes aux API et aux services sont peu documentées ici : elles ne sont donc pas détaillées.

Main entry points: [`src/app/router.tsx`](https://github.com/booz974/kartie-react-apple/blob/main/src/app/router.tsx) (Routes), [`src/api/chatRag.ts`](https://github.com/booz974/kartie-react-apple/blob/main/src/api/chatRag.ts) (API RAG), [`src/app/main.tsx`](https://github.com/booz974/kartie-react-apple/blob/main/src/app/main.tsx) (Démarrage), [`src/features/admin/views/AdminRagView.tsx`](https://github.com/booz974/kartie-react-apple/blob/main/src/features/admin/views/AdminRagView.tsx) (Gestion documents RAG)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application"]
  node_bootstrap["Démarrage<br/>[main.tsx]"]
  node_providers["Fournisseurs applicatifs<br/>[providers.tsx]"]
  node_router["Routes<br/>[router.tsx]"]
  node_shell["Coquille<br/>[AppShell.tsx]"]
end

subgraph group_territory["Quartiers"]
  node_home["Accueil<br/>[HomeView.tsx]"]
  node_districts["Quartiers"]
  node_districtdata["Infos quartier"]
end

subgraph group_community["Vie locale"]
  node_feed["Fil de quartier"]
  node_chat["Messagerie<br/>[ChatView.tsx]"]
  node_associations["Associations"]
  node_content["Actualités et événements"]
end

subgraph group_democracy["Participation"]
  node_democracy["Pétitions et consultations"]
end

subgraph group_operations["Administration et IA"]
  node_admin["Administration"]
  node_ragadmin["Gestion documents RAG<br/>[AdminRagView.tsx]"]
  node_ragqueries["Requêtes RAG<br/>[chatRag.ts]"]
  node_ragapi["API RAG<br/>[chatRag.ts]"]
  node_edgeauth["Jetons Edge"]
end

node_resident(("Habitant"))
node_administrator(("Administrateur"))
node_edgefunction{{"Fonction chat-rag"}}
node_supabase[("Supabase")]

node_bootstrap -->|"initialise"| node_providers
node_bootstrap -->|"monte"| node_router
node_bootstrap -->|"attend la session"| node_resident
node_router -->|"affiche"| node_shell
node_router -->|"route"| node_home
node_router -->|"route"| node_districts
node_router -->|"route"| node_districtdata
node_router -->|"route"| node_feed
node_router -->|"route"| node_chat
node_router -->|"route"| node_associations
node_router -->|"route"| node_content
node_router -->|"route"| node_democracy
node_router -->|"route"| node_admin
node_resident -->|"navigue"| node_router
node_administrator -->|"accède"| node_router
node_ragadmin -->|"utilise"| node_ragqueries
node_ragadmin -->|"encode le fichier"| node_ragapi
node_ragqueries -->|"appelle"| node_ragapi
node_ragapi -->|"obtient un jeton"| node_edgeauth
node_ragapi -->|"envoie les requêtes"| node_edgefunction
node_ragapi -->|"lit la session"| node_supabase

click node_bootstrap "https://github.com/booz974/kartie-react-apple/blob/main/src/app/main.tsx"
click node_providers "https://github.com/booz974/kartie-react-apple/blob/main/src/app/providers.tsx"
click node_router "https://github.com/booz974/kartie-react-apple/blob/main/src/app/router.tsx"
click node_shell "https://github.com/booz974/kartie-react-apple/blob/main/src/app/AppShell.tsx"
click node_home "https://github.com/booz974/kartie-react-apple/blob/main/src/features/core/views/HomeView.tsx"
click node_districts "https://github.com/booz974/kartie-react-apple/tree/main/src/features/territory/views"
click node_districtdata "https://github.com/booz974/kartie-react-apple/tree/main/src/features/territory/components"
click node_feed "https://github.com/booz974/kartie-react-apple/blob/main/src/features/social/views/QuartierFeedView.tsx"
click node_chat "https://github.com/booz974/kartie-react-apple/blob/main/src/features/social/views/ChatView.tsx"
click node_associations "https://github.com/booz974/kartie-react-apple/tree/main/src/features/associations/views"
click node_content "https://github.com/booz974/kartie-react-apple/tree/main/src/features/content/views"
click node_democracy "https://github.com/booz974/kartie-react-apple/tree/main/src/features/democracy/views"
click node_admin "https://github.com/booz974/kartie-react-apple/tree/main/src/features/admin/views"
click node_ragadmin "https://github.com/booz974/kartie-react-apple/blob/main/src/features/admin/views/AdminRagView.tsx"
click node_ragqueries "https://github.com/booz974/kartie-react-apple/blob/main/src/queries/chatRag.ts"
click node_ragapi "https://github.com/booz974/kartie-react-apple/blob/main/src/api/chatRag.ts"
click node_edgeauth "https://github.com/booz974/kartie-react-apple/blob/main/src/api/edgeFunctionAuth.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_bootstrap,node_providers,node_router,node_shell toneBlue
class node_home,node_districts,node_districtdata,node_supabase toneAmber
class node_feed,node_chat,node_associations,node_content toneMint
class node_democracy toneRose
class node_admin,node_ragadmin,node_ragqueries,node_ragapi,node_edgeauth,node_resident,node_administrator,node_edgefunction toneIndigo
```

## Components

### Application

- [Démarrage](https://github.com/booz974/kartie-react-apple/blob/main/src/app/main.tsx): `src/app/main.tsx`
- [Fournisseurs applicatifs](https://github.com/booz974/kartie-react-apple/blob/main/src/app/providers.tsx): `src/app/providers.tsx`
- [Routes](https://github.com/booz974/kartie-react-apple/blob/main/src/app/router.tsx): `src/app/router.tsx`
- [Coquille](https://github.com/booz974/kartie-react-apple/blob/main/src/app/AppShell.tsx): `src/app/AppShell.tsx`

### Quartiers

- [Accueil](https://github.com/booz974/kartie-react-apple/blob/main/src/features/core/views/HomeView.tsx): `src/features/core/views/HomeView.tsx`
- [Quartiers](https://github.com/booz974/kartie-react-apple/tree/main/src/features/territory/views): `src/features/territory/views`
- [Infos quartier](https://github.com/booz974/kartie-react-apple/tree/main/src/features/territory/components): `src/features/territory/components`

### Vie locale

- [Fil de quartier](https://github.com/booz974/kartie-react-apple/blob/main/src/features/social/views/QuartierFeedView.tsx): `src/features/social/views/QuartierFeedView.tsx`
- [Messagerie](https://github.com/booz974/kartie-react-apple/blob/main/src/features/social/views/ChatView.tsx): `src/features/social/views/ChatView.tsx`
- [Associations](https://github.com/booz974/kartie-react-apple/tree/main/src/features/associations/views): `src/features/associations/views`
- [Actualités et événements](https://github.com/booz974/kartie-react-apple/tree/main/src/features/content/views): `src/features/content/views`

### Participation

- [Pétitions et consultations](https://github.com/booz974/kartie-react-apple/tree/main/src/features/democracy/views): `src/features/democracy/views`

### Administration et IA

- [Administration](https://github.com/booz974/kartie-react-apple/tree/main/src/features/admin/views): `src/features/admin/views`
- [Gestion documents RAG](https://github.com/booz974/kartie-react-apple/blob/main/src/features/admin/views/AdminRagView.tsx): `src/features/admin/views/AdminRagView.tsx`
- [Requêtes RAG](https://github.com/booz974/kartie-react-apple/blob/main/src/queries/chatRag.ts): `src/queries/chatRag.ts`
- [API RAG](https://github.com/booz974/kartie-react-apple/blob/main/src/api/chatRag.ts): `src/api/chatRag.ts`
- [Jetons Edge](https://github.com/booz974/kartie-react-apple/blob/main/src/api/edgeFunctionAuth.ts): `src/api/edgeFunctionAuth.ts`

### Other components

- **Habitant**
- **Administrateur**
- **Fonction chat-rag**
- **Supabase**

## Connections

- Démarrage → Fournisseurs applicatifs: initialise
- Démarrage → Routes: monte
- Démarrage → Habitant: attend la session
- Routes → Coquille: affiche
- Routes → Accueil: route
- Routes → Quartiers: route
- Routes → Infos quartier: route
- Routes → Fil de quartier: route
- Routes → Messagerie: route
- Routes → Associations: route
- Routes → Actualités et événements: route
- Routes → Pétitions et consultations: route
- Routes → Administration: route
- Habitant → Routes: navigue
- Administrateur → Routes: accède
- Gestion documents RAG → Requêtes RAG: utilise
- Gestion documents RAG → API RAG: encode le fichier
- Requêtes RAG → API RAG: appelle
- API RAG → Jetons Edge: obtient un jeton
- API RAG → Fonction chat-rag: envoie les requêtes
- API RAG → Supabase: lit la session
