# yae-sine/gustave-roussy architecture

> Architecture diagram of the GitHub repository yae-sine/gustave-roussy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yae-sine/gustave-roussy
- Repository: https://github.com/yae-sine/gustave-roussy

## Overview

##### Project type and purpose
- This is a full-stack web application called “Gustave-Roussey” for managing donations, subscriptions, and events.
- The backend is a monolithic Spring Boot REST API in Java 17.
- The frontend is a React 18 single-page application styled with Tailwind CSS and served via Nginx.
- Payments are processed through Stripe.
- The entire system is containerized and orchestrated with Docker Compose.

##### File structure
Top-level layout:
- Backend/ – Spring Boot project
– src/main/java/com/_com/JourneeMondiale/{controller, service, repository, model, dto, security, payload}
– application-properties, Dockerfile, pom.xml, Maven wrapper
- frontend/ – React project
– src/{components, pages, services, context, hooks}
– public/static assets, Tailwind config, Nginx config, Dockerfile
- docker-compose.yml – defines two services (backend & frontend), network, volumes
- .env.example – for Stripe keys and API URLs

Architectural patterns:
- Backend is layered (Controller → Service → Repository → H2 Database)
- JWT-based security filter chain in Spring Security
- RESTful endpoints for all user/admin actions
- React uses context for global user state and React Router for routing
- Nginx acts as reverse proxy and static file server

##### Extract insights from README
- REST API on port 8080, React app on port 80
- H2 file-based DB persisted via Docker volume
- Custom Docker network allows services to refer to each other by name
- Stripe integration for one-time donations and recurring subscriptions

##### Detail without over-complicating
- Every major Spring Boot module alongside the React service modules.
- Network boundaries (Docker network) and data persistence boundary (H2 volume).
- Surface security boundary: highlight JWT filter before reaching controllers.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Tier
    subgraph "Client Tier"
        direction TB
        Browser["User & Admin Browser"]:::frontend
        Nginx["Nginx Reverse Proxy & Static Server"]:::infra
        ReactContainer["React Frontend Container"]:::frontend
    end

    %% Frontend Components
    subgraph "React Application"    
        direction TB
        ReactEntry["SPA Entry Point\nindex.jsx"]:::frontend
        AppComp["App Root & Routing\nApp.jsx"]:::frontend
        UserContext["Global User State Context"]:::frontend
        withAuth["Authentication HOC\nwithAuth.jsx"]:::frontend
        AdminRoute["Admin Route Guard\nAdminRoute.jsx"]:::frontend
        FrontServices["Frontend Service Modules"]:::frontend
        ReactPages["React Pages"]:::frontend
        Tailwind["Tailwind CSS Config"]:::frontend
        FEEnv["Frontend Env Example"]:::frontend
    end

    %% Server Tier
    subgraph "Server Tier"
        direction TB
        BackendContainer["Spring Boot Backend Container"]:::backend
        BuildConfig["Backend Build Configuration"]:::backend
        PomXML["pom.xml"]:::backend
        MvnDir[".mvn & mvnw wrappers"]:::backend
        Entry["Application Entry Point\nJourneeMondialeApplication.java"]:::backend
        Security["Security Config & JWT Filters"]:::backend
        Controllers["REST Controllers Layer"]:::backend
        Services["Service Layer"]:::backend
        Repositories["Repository Layer"]:::backend
        ModelsDTOs["Domain Models & DTOs"]:::backend
        H2["H2 Database\n(persistent volume)"]:::infra
    end

    %% External Services & Infrastructure
    Stripe["Stripe API"]:::external
    DockerCompose["Docker Compose Orchestration"]:::infra
    BEEnv["Backend Env Example"]:::infra
    TestSuite["Backend Test Suite"]:::backend

    %% Connections - Client Tier
    Browser --> Nginx
    Nginx --> ReactContainer
    ReactContainer --> ReactEntry
    ReactEntry --> AppComp
    AppComp --> UserContext
    UserContext --> withAuth
    withAuth --> AdminRoute
    AppComp --> FrontServices
    AppComp --> ReactPages
    ReactContainer --> Tailwind
    ReactContainer --> FEEnv

    %% Nginx Proxy to Backend
    Browser -->|"/api/*"| Nginx
    Nginx -->|Proxy API| BackendContainer

    %% Backend Build and Config
    BackendContainer --> BuildConfig
    BuildConfig --> PomXML
    BuildConfig --> MvnDir
    BackendContainer --> Entry
    BackendContainer --> BEEnv
    BackendContainer --> TestSuite

    %% Backend Security & Layers
    BackendContainer --> Security
    BackendContainer --> Controllers
    Security --> Controllers
    Controllers --> Services
    Services --> Repositories
    Repositories --> ModelsDTOs
    ModelsDTOs --> H2

    %% Stripe Integration
    Controllers -->|uses| Services
    Services -->|calls| Stripe
    Controllers -->|Stripe endpoints| Stripe

    %% Docker Compose network & volume
    DockerCompose -->|volume| H2
    DockerCompose -->|network| Nginx
    DockerCompose -->|network| BackendContainer
    DockerCompose -->|network| ReactContainer

    %% External
    Browser -->|payments| Stripe

    %% Click Events
    click BackendContainer "https://github.com/yae-sine/gustave-roussy/tree/main/Backend/Dockerfile"
    click PomXML "https://github.com/yae-sine/gustave-roussy/blob/main/Backend/pom.xml"
    click MvnDir "https://github.com/yae-sine/gustave-roussy/tree/main/Backend/.mvn/"
    click MvnDir "https://github.com/yae-sine/gustave-roussy/tree/main/Backend/mvnw"
    click MvnDir "https://github.com/yae-sine/gustave-roussy/blob/main/Backend/mvnw.cmd"
    click Entry "https://github.com/yae-sine/gustave-roussy/blob/main/Backend/src/main/java/com/_com/JourneeMondiale/JourneeMondialeApplication.java"
    click Security "https://github.com/yae-sine/gustave-roussy/tree/main/Backend/src/main/java/com/_com/JourneeMondiale/security/"
    click Controllers "https://github.com/yae-sine/gustave-roussy/tree/main/Backend/src/main/java/com/_com/JourneeMondiale/controller/"
    click Services "https://github.com/yae-sine/gustave-roussy/tree/main/Backend/src/main/java/com/_com/JourneeMondiale/service/"
    click Repositories "https://github.com/yae-sine/gustave-roussy/tree/main/Backend/src/main/java/com/_com/JourneeMondiale/repository/"
    click ModelsDTOs "https://github.com/yae-sine/gustave-roussy/tree/main/Backend/src/main/java/com/_com/JourneeMondiale/model/"
    click ModelsDTOs "https://github.com/yae-sine/gustave-roussy/tree/main/Backend/src/main/java/com/_com/JourneeMondiale/dto/"
    click Services "https://github.com/yae-sine/gustave-roussy/blob/main/Backend/src/main/java/com/_com/JourneeMondiale/service/StripeService.java"
    click Controllers "https://github.com/yae-sine/gustave-roussy/blob/main/Backend/src/main/java/com/_com/JourneeMondiale/controller/StripeController.java"
    click BuildConfig "https://github.com/yae-sine/gustave-roussy/blob/main/Backend/src/main/resources/application-docker.properties.example"
    click DockerCompose "https://github.com/yae-sine/gustave-roussy/blob/main/docker-compose.yml"
    click ReactContainer "https://github.com/yae-sine/gustave-roussy/tree/main/frontend/Dockerfile"
    click Nginx "https://github.com/yae-sine/gustave-roussy/blob/main/frontend/nginx.conf"
    click ReactEntry "https://github.com/yae-sine/gustave-roussy/blob/main/frontend/src/index.jsx"
    click AppComp "https://github.com/yae-sine/gustave-roussy/blob/main/frontend/src/App.jsx"
    click UserContext "https://github.com/yae-sine/gustave-roussy/blob/main/frontend/src/context/UserContext.jsx"
    click withAuth "https://github.com/yae-sine/gustave-roussy/blob/main/frontend/src/components/auth/withAuth.jsx"
    click AdminRoute "https://github.com/yae-sine/gustave-roussy/blob/main/frontend/src/components/admin/AdminRoute.jsx"
    click FrontServices "https://github.com/yae-sine/gustave-roussy/tree/main/frontend/src/services/"
    click ReactPages "https://github.com/yae-sine/gustave-roussy/tree/main/frontend/src/pages/"
    click Tailwind "https://github.com/yae-sine/gustave-roussy/blob/main/frontend/tailwind.config.js"
    click FEEnv "https://github.com/yae-sine/gustave-roussy/blob/main/frontend/.env.exemple"
    click BEEnv "https://github.com/yae-sine/gustave-roussy/blob/main/.env.example"
    click TestSuite "https://github.com/yae-sine/gustave-roussy/blob/main/Backend/src/test/java/com/_com/JourneeMondiale/JourneeMondialeApplicationTests.java"

    %% Styles
    classDef frontend fill:#bbdefb,stroke:#1e88e5,color:#1e88e5;
    classDef backend fill:#c8e6c9,stroke:#388e3c,color:#388e3c;
    classDef external fill:#ffe0b2,stroke:#f57c00,color:#f57c00;
    classDef infra fill:#eeeeee,stroke:#757575,color:#424242;
```
