# falclop/celiahelp architecture

> Architecture diagram of the GitHub repository falclop/celiahelp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/falclop/celiahelp
- Repository: https://github.com/falclop/celiahelp

## Overview

##### Project type and purpose
- This is a full-stack web application (“CeliaHelp”) for managing incidents.
- Backend: Java 21 + Spring Boot REST API (authentication, role/ user management, incident CRUD, logging).
- Frontend: static HTML/CSS/JS pages consuming the API.
- Data store: MySQL 8.0 with Spring Data JPA/Hibernate.
- Containers: Docker Compose orchestrates MySQL, phpMyAdmin, backend and frontend.

##### File structure
- Top-level:
- backend/ – Dockerfile + startup scripts (wait-for-it).
- frontend/ – Dockerfile + compiled static assets (dist/).
- src/main/java/com/celiahelp/… – Spring Boot code broken into controller, service(+impl), repository, model, dto, mapper, exception, security, config.
- src/main/resources/application.properties – DB and JWT settings.
- compose.yml – Docker Compose definition (services: mysql, phpmyadmin, backend, frontend).
- SQL scripts (01-init.sql, 02-data.sql) for initial schema and seed data.
- Tests under src/test.
- Build: Maven wrapper (mvnw) + pom.xml.

##### README for additional insights
- Describes REST endpoints and user flows.
- Notes Docker Compose usage and service URLs.

## Diagram (Mermaid)

```mermaid
graph TB
    Browser["Web Browser / Client"]:::external
    Compose["Docker Compose"]:::infra
    subgraph "Docker Compose Network"
        direction TB
        FRT["Frontend Container"]:::frontend
        BCK["Backend Container\n(Spring Boot API)"]:::backend
        SQL["MySQL 8.0 Database"]:::db
        PHA["phpMyAdmin UI"]:::admin
    end

    Browser -->|"HTTP"| FRT
    FRT -->|"AJAX/Fetch /api/*"| BCK
    BCK -->|"JDBC/MySQL"| SQL
    BCK -.->|"optional HTTP"| PHA

    Compose --> FRT
    Compose --> BCK
    Compose --> SQL
    Compose --> PHA

    %% Backend internal architecture
    subgraph "Backend Container\nInternal Modules"
        direction TB
        Entry["CeliahelpApplication.java"]:::config
        AppProp["application.properties"]:::config
        SecurityConfig["SecurityConfig.java"]:::config
        JwtDecoderConfig["JwtDecoderConfig.java"]:::config
        AuthF["JwtAuthenticationFilter"]:::security
        Controllers["Controllers"]:::component
        subgraph Controllers
            direction TB
            AuthController["AuthController"]:::controller
            HealthController["HealthController"]:::controller
            IncidenciaController["IncidenciaController"]:::controller
            LogController["LogController"]:::controller
            RolController["RolController"]:::controller
            UsuarioController["UsuarioController"]:::controller
        end
        ServicesI["Service Interfaces"]:::component
        ServicesImpl["Service Implementations"]:::component
        Repo["Data Repositories"]:::component
        DTO["DTO Definitions"]:::component
        AuthDTO["Authentication DTOs"]:::component
        Model["Domain Models"]:::component
        Mapper["DTO Mappers"]:::component
        Exception["Exception Handling"]:::component
        JwtTokenProvider["JwtTokenProvider"]:::security
        JwtAuthEntryPoint["JwtAuthenticationEntryPoint"]:::security
        UserDetailsService["UserDetailsServiceImpl"]:::security
        UnitTests["Unit Tests"]:::test
        Build["Maven Build Config"]:::infra
        ScriptSync["wait-for-it.sh"]:::script

        Entry --> AppProp
        AppProp --> SecurityConfig
        SecurityConfig --> JwtDecoderConfig
        JwtDecoderConfig --> AuthF
        AuthF --> Controllers
        Controllers --> ServicesI
        ServicesI --> ServicesImpl
        ServicesImpl --> Repo
        Repo --> SQL
        DTO --> Mapper
        Model --> Repo
        ServicesImpl --> Model
        Controllers --> AuthDTO
        UnitTests --> Entry
        Build --> Entry
        ScriptSync --> SQL
    end

    %% Click events
    click Browser "https://github.com/falclop/celiahelp/tree/main/frontend/dist/"
    click FRT "https://github.com/falclop/celiahelp/tree/main/frontend/Dockerfile"
    click BCK "https://github.com/falclop/celiahelp/tree/main/backend/Dockerfile"
    click Compose "https://github.com/falclop/celiahelp/blob/main/compose.yml"
    click ScriptSync "https://github.com/falclop/celiahelp/blob/main/backend/scripts/wait-for-it.sh"
    click Entry "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/CeliahelpApplication.java"
    click AppProp "https://github.com/falclop/celiahelp/blob/main/src/main/resources/application.properties"
    click SecurityConfig "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/config/SecurityConfig.java"
    click JwtDecoderConfig "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/config/JwtDecoderConfig.java"
    click AuthController "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/controller/AuthController.java"
    click HealthController "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/controller/HealthController.java"
    click IncidenciaController "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/controller/IncidenciaController.java"
    click LogController "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/controller/LogController.java"
    click RolController "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/controller/RolController.java"
    click UsuarioController "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/controller/UsuarioController.java"
    click DTO "https://github.com/falclop/celiahelp/tree/main/src/main/java/com/celiahelp/dto/"
    click AuthDTO "https://github.com/falclop/celiahelp/tree/main/src/main/java/com/celiahelp/dto/auth/"
    click Model "https://github.com/falclop/celiahelp/tree/main/src/main/java/com/celiahelp/model/"
    click Repo "https://github.com/falclop/celiahelp/tree/main/src/main/java/com/celiahelp/repository/"
    click ServicesI "https://github.com/falclop/celiahelp/tree/main/src/main/java/com/celiahelp/service/"
    click ServicesImpl "https://github.com/falclop/celiahelp/tree/main/src/main/java/com/celiahelp/service/impl/"
    click Mapper "https://github.com/falclop/celiahelp/tree/main/src/main/java/com/celiahelp/mapper/"
    click Exception "https://github.com/falclop/celiahelp/tree/main/src/main/java/com/celiahelp/exception/"
    click AuthF "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/security/JwtAuthenticationFilter.java"
    click JwtTokenProvider "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/security/JwtTokenProvider.java"
    click JwtAuthEntryPoint "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/security/JwtAuthenticationEntryPoint.java"
    click UserDetailsService "https://github.com/falclop/celiahelp/blob/main/src/main/java/com/celiahelp/security/UserDetailsServiceImpl.java"
    click UnitTests "https://github.com/falclop/celiahelp/blob/main/src/test/java/com/celiahelp/CeliahelpApplicationTests.java"
    click Build "https://github.com/falclop/celiahelp/blob/main/pom.xml"

    %% Styles
    classDef external fill:#D5E8D4,stroke:#82B366
    classDef infra fill:#FFF2CC,stroke:#D6B656
    classDef frontend fill:#DAE8FC,stroke:#6C8EBF
    classDef backend fill:#F8CECC,stroke:#B85450
    classDef db fill:#FFE6CC,stroke:#D79B00
    classDef admin fill:#E1D5E7,stroke:#9673A6,stroke-dasharray: 5 5
    classDef config fill:#F5F5F5,stroke:#AAAAAA
    classDef security fill:#FCE5CD,stroke:#E69138
    classDef controller fill:#FFFFFF,stroke:#333333
    classDef component fill:#EBF1DE,stroke:#4F6228
    classDef script fill:#E1F5FE,stroke:#039BE5
    classDef test fill:#E8F4FD,stroke:#0E62AC
```
