# jorghee/project-management architecture

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

- Interactive diagram: https://gitdiagram.com/jorghee/project-management
- Repository: https://github.com/jorghee/project-management

## Overview

##### Project Type and Purpose
- This is a full-stack web application called “Project Management.”
- Frontend: register-ui (React + Vite) as a single-page application for user interaction.
- Backend: projectmanagement-api (Spring Boot) exposing REST endpoints to manage projects, tasks, clients, etc.
- Purpose: allow CRUD operations on various project management entities (clients, tasks, priorities, time/utility factors, etc.) via a web interface.

##### File Structure Analysis
- Top level:
- projectmanagement-api/
- register-ui/
- projectmanagement-api (Java/Spring Boot):
- config, controller, service, repository, model, dto, mapper, exception layers → classic layered MVC + service + repository pattern.
- pom.xml, application.properties → Maven build & configuration.
- register-ui (React/Vite):
- src/pages → route-based pages for each entity.
- src/components/common → reusable UI components.
- src/api/apiService.js → HTTP client to call backend.
- src/context → NotificationContext for app-wide alerts.

##### Key Architectural Insights from README
- RESTful API with endpoints under `/api/*` for each resource.
- Standard HTTP methods (GET, POST, PUT, DELETE).
- Response model: JSON payloads matching DTOs in backend.

##### Main Components and Interactions (to include
a. Frontend SPA (register-ui)
- Technologies: React, Vite, pnpm, Axios/fetch in apiService.js, Context API.
- Pages/components call apiService → send HTTP requests.
b. API Layer (projectmanagement-api)
- Controllers (`*Controller.java`) receive HTTP requests.
- Service layer (`*Service.java`) contains business logic.
- Repository layer (`*Repository.java`) interacts with relational DB via Spring Data JPA.
- Mapper layer converts between Entities (model) and DTOs.
c. Database
- A relational DB (e.g., PostgreSQL/MySQL) configured in application.properties.
d. External Services (if any)
- CORS configuration allows cross-origin calls from frontend.
- No other external microservices in this project.

##### Relationships & Data Flows
- Browser/User → Frontend (React SPA)
- Frontend → HTTP request → Backend Controller
- Controller → Service → Repository → Database
- Database → Repository → Service → Controller → Frontend
- Frontend uses Context to dispatch notifications on success/failure.

##### Architectural Patterns & Principles
- Layered Architecture (Presentation → API Controller → Service → Repository → Database).
- DTO Pattern with dedicated Mapper classes.
- RESTful API design.
- Single-Page App on frontend with route‐based code organization.

[React SPA] —————→ [Spring Boot API] —————→ [Relational DB]
- Controllers (controllers/*Controller.java)
- Services (service/*.java)
- Repositories (repository/*.java)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend (React SPA)"
        direction TB
        ReactEntry["Main Entry: src/main.jsx"]:::frontend
        Pages["Pages: src/pages/"]:::frontend
        Common["Common UI Components: src/components/common/"]:::frontend
        ApiService["HTTP Client: src/api/apiService.js"]:::frontend
        Notification["Notification Context: src/context/NotificationContext.jsx"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend (Spring Boot API)"
        direction TB
        ApiEntry["Application Entry: ProjectmanagementApiApplication.java"]:::backend
        Cors["CORS Config: CorsConfig.java"]:::backend
        Controllers["Controllers: controller/"]:::backend
        Services["Services: service/"]:::backend
        Repositories["Repositories: repository/"]:::backend
        Mappers["Mappers: mapper/"]:::backend
        DTOs["DTOs: dto/"]:::backend
        Models["Entities: model/"]:::backend
        Config["Application Config: application.properties"]:::backend
        Pom["Build File: pom.xml"]:::backend
    end

    %% Database
    DB["Relational DB (PostgreSQL/MySQL)"]:::db

    %% Frontend Interactions
    ReactEntry -->|loads| Pages
    ReactEntry -->|initializes| Notification
    Pages -->|uses| Common
    Pages -->|calls| ApiService
    Common -->|calls| ApiService
    Notification -->|dispatches| Pages

    %% HTTP Flow
    ApiService -->|HTTP/JSON| Controllers
    ReactEntry -. CORS .-> Cors

    %% Backend Internal Flow
    Controllers -->|calls| Services
    Services -->|uses| Repositories
    Repositories -->|queries| DB
    DB -->|returns data| Repositories
    Controllers -->|maps via| Mappers
    Mappers -->|transforms| DTOs
    Mappers -->|transforms| Models
    DTOs -->|sent as JSON| Controllers
    Models -->|persisted| Repositories

    %% Config & Build
    Config -->|loaded by| ApiEntry
    Pom -->|builds| ApiEntry

    %% Click Events
    click ReactEntry "https://github.com/jorghee/project-management/blob/main/register-ui/src/main.jsx"
    click Pages "https://github.com/jorghee/project-management/tree/main/register-ui/src/pages/"
    click Common "https://github.com/jorghee/project-management/tree/main/register-ui/src/components/common/"
    click ApiService "https://github.com/jorghee/project-management/blob/main/register-ui/src/api/apiService.js"
    click Notification "https://github.com/jorghee/project-management/blob/main/register-ui/src/context/NotificationContext.jsx"
    click ApiEntry "https://github.com/jorghee/project-management/blob/main/projectmanagement-api/src/main/java/com/cyacompany/projectmanagement_api/ProjectmanagementApiApplication.java"
    click Cors "https://github.com/jorghee/project-management/blob/main/projectmanagement-api/src/main/java/com/cyacompany/projectmanagement_api/config/CorsConfig.java"
    click Controllers "https://github.com/jorghee/project-management/tree/main/projectmanagement-api/src/main/java/com/cyacompany/projectmanagement_api/controller/"
    click Services "https://github.com/jorghee/project-management/tree/main/projectmanagement-api/src/main/java/com/cyacompany/projectmanagement_api/service/"
    click Repositories "https://github.com/jorghee/project-management/tree/main/projectmanagement-api/src/main/java/com/cyacompany/projectmanagement_api/repository/"
    click Mappers "https://github.com/jorghee/project-management/tree/main/projectmanagement-api/src/main/java/com/cyacompany/projectmanagement_api/mapper/"
    click DTOs "https://github.com/jorghee/project-management/tree/main/projectmanagement-api/src/main/java/com/cyacompany/projectmanagement_api/dto/"
    click Models "https://github.com/jorghee/project-management/tree/main/projectmanagement-api/src/main/java/com/cyacompany/projectmanagement_api/model/"
    click Config "https://github.com/jorghee/project-management/blob/main/projectmanagement-api/src/main/resources/application.properties"
    click Pom "https://github.com/jorghee/project-management/blob/main/projectmanagement-api/pom.xml"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef backend fill:#D0FFD8,stroke:#333,stroke-width:1px
    classDef db fill:#FFE0B2,stroke:#333,stroke-width:1px
```
