# lulwszabolcs/a-projekt architecture

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

- Interactive diagram: https://gitdiagram.com/lulwszabolcs/a-projekt
- Repository: https://github.com/lulwszabolcs/a-projekt

## Overview

##### Frontend (aiport_frontend)
- Developed with React and Vite.
- Contains components for login, home page, error management, vehicle and worker management, profile viewing, sidebar navigation, and support modules.
- Uses context providers for managing state (e.g., for images, notes, problems, vehicles, workers, etc.).
- Relies on CSS and Mui for styling.

##### Backend (airport_backend)
- Built on Spring Boot.
- Implements RESTful controllers for different modules (authentication, notes, problems, vehicles, workers, etc.).
- Follows a layered architecture, with clear separations:
– Controllers: Handle incoming HTTP requests (e.g., CheckPermissionController, NoteController, ProblemController, etc.).
– Services: Business logic is encapsulated here (e.g., EmailService, VehicleService, WorkerService, etc.).
– Repositories: Data access using JPA with MySQL (e.g., UserRepository, VehicleRepository, etc.).
– Models, DTOs, Converters, and Enumerations: Define domain entities, control data flows, and manage type safety.
– Security components: JWT token provider, filters, and configuration classes handle authentication and authorization.
– Exception Handlers: Exception handling classes that standardize error responses.
- Database migrations are handled via SQL scripts found under src/main/resources/db/changelog with a master.xml to orchestrate changes. This indicates an emphasis on managing the persistence schema carefully.

- Frontend Client
- React Application using components (Login, Homepage, Sidebar, etc.)
- Context Providers (state management for images, notes, problems, vehicles, workers)
- Backend Server
- REST Controllers handling distinct domains (Authentication; Image, Note, Problem, User, Vehicle, Worker management)
- Services layers that encapsulate business logic
- Data Access Layers (Repositories interfacing with the MySQL database)
- Security Modules (JWTTokenProvider, filters & configurations for auth)
- Exception and Converters modules
- Database
- MySQL database
- Migration scripts managed via Liquibase-style changelogs (SQL scripts and master.xml)
- DevOps & Configuration:
- Build scripts (mvnw, npm scripts)
- Environment configuration via application.yml/properties on backend and environment variable files on frontend.
- External Services and Libraries:
- Integration with a large language model (grok-2-vision-1212) as noted.
- Swagger documentation (SwaggerConfiguration class) for API documentation.

##### Architectural patterns and design principles
- Layered architecture (presentation/controller, service, repository) evident in the backend.
- Separation of concerns between the frontend and backend.
- Use of MVC/MVVM in the frontend’s component organization.
- Security best practices are implemented with JWT-based authentication and proper exception handling.

##### Additional deployment and integration aspects
- Build and startup instructions (node package installations, Vite development server, IntelliJ IDEA for Spring Boot) as part of the system flow if needed.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Frontend"
        FE1["Frontend Client – React App"]:::frontend
        FE2["UI Components (Login,Homepage,Sidebar,Errors,Vehicles,Workers,Profile,Support)"]:::frontend
        FE3["State Management (Context Providers)"]:::frontend
        FE1 --> FE2
        FE1 --> FE3
    end

    subgraph "Backend"
        BE1["REST Controllers"]:::backend
        BE2["Services"]:::backend
        BE3["Repositories"]:::backend
        BE4["Auth Modules"]:::security
        BE5["JWTTokenProvider"]:::security
        BE6["Exception Handlers"]:::backend
        BE7["Converters"]:::backend
        BE8["Swagger API Docs"]:::config
        BE9["Application Properties"]:::config
        BE10["Application YML"]:::config
        BE11["Migration Scripts"]:::backend

        BE1 --> BE2
        BE2 --> BE3
        BE3 -->|"CRUDoperations"| DB1["MySQL Database"]:::db

        BE1 --> BE4
        BE1 --> BE5
        BE2 --> BE6
        BE2 --> BE7
    end

    FE1 -->|"HTTPCalls"| BE1
    BE2 -->|"Integrates"| ES["External Service: grok-2-vision-1212"]:::backend

    BE1 --- BE8
    BE1 --- BE9
    BE1 --- BE10
    BE1 --- BE11

    DEV["Build&DeploymentScripts"]:::config
    FE1 --- DEV
    BE1 --- DEV

    click FE1 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_frontend/"
    click FE2 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_frontend/src/components/"
    click FE3 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_frontend/src/contexts/"
    click BE1 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_backend/src/main/java/com/example/airport/controller/"
    click BE2 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_backend/src/main/java/com/example/airport/service/"
    click BE3 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_backend/src/main/java/com/example/airport/repository/"
    click BE4 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_backend/src/main/java/com/example/airport/auth/"
    click BE5 "https://github.com/lulwszabolcs/a-projekt/blob/master/airport_backend/src/main/java/com/example/airport/token/JWTTokenProvider.java"
    click BE6 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_backend/src/main/java/com/example/airport/exception/"
    click BE7 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_backend/src/main/java/com/example/airport/converter/"
    click BE8 "https://github.com/lulwszabolcs/a-projekt/blob/master/airport_backend/src/main/java/com/example/airport/config/SwaggerConfiguration.java"
    click BE11 "https://github.com/lulwszabolcs/a-projekt/tree/master/airport_backend/src/main/resources/db/changelog/"
    click BE9 "https://github.com/lulwszabolcs/a-projekt/blob/master/airport_backend/src/main/resources/application.properties"
    click BE10 "https://github.com/lulwszabolcs/a-projekt/blob/master/airport_backend/src/main/resources/application.yml"

    classDef frontend fill:#cce5ff,stroke:#0066cc,stroke-width:2px;
    classDef backend fill:#f4cccc,stroke:#cc0000,stroke-width:2px;
    classDef db fill:#d9ead3,stroke:#38761d,stroke-width:2px;
    classDef security fill:#fff2cc,stroke:#e69138,stroke-width:2px;
    classDef config fill:#ead1dc,stroke:#b854a1,stroke-width:2px;
```
