# shiross00/swp391_su25 architecture

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

- Interactive diagram: https://gitdiagram.com/shiross00/swp391_su25
- Repository: https://github.com/shiross00/swp391_su25

## Overview

##### Project type and purpose
- This is a full-stack “Blood Donation Support System” comprising a React+TypeScript front-end and a Java Spring Boot back-end.
- Purpose: manage donation events, registrations, donor profiles, blood requests/stock, health checks, notifications, blogs and achievements.

##### File structure
A. Top-level layout
- back-end/…/blood-donation-support-system: Spring Boot service
- front-end/: Vite-powered React application
B. back-end module
- pom.xml, Dockerfile, application.properties – build & config
- src/main/java/com/swp391/superapp/bloodsupport
– controller: REST API endpoints (EventAPI, etc.)
– entity: JPA domain models (Account, BloodDonationEvent, DonationRegistration, etc.)
– repository: Spring Data JPA interfaces for persistence
– service: business logic & email sender
– infra: JPA utility
- src/main/resources: application and meta-inf configs
C. front-end module
- package.json, tsconfig, tailwind.config.js, vite.config.ts – build & lint config
- public/index.html – single-page host
- src/
– App.tsx, main.tsx – entry points
– components/ (header, footer, button)
– pages/home.tsx – views
– utils/constants.tsx, types.ts – shared types & constants
– assets/ – images/styles

##### README insights
- Only placeholder title; no architecture details. Rely on file structure for patterns.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Layer"
        Browser["User's Browser"]:::external
    end

    subgraph "Front-end Layer"
        ReactSPA["React SPA"]:::frontend
        Components["React Components"]:::frontend
        HomePage["Home Page"]:::frontend
        App["App Component"]:::frontend
        Main["main.tsx"]:::frontend
        Constants["Constants"]:::frontend
        Types["Shared Types"]:::frontend
        BuildConfigs["Vite & Build Configs"]:::frontend

        Browser --> ReactSPA
        ReactSPA --> Components
        ReactSPA --> HomePage
        ReactSPA --> App
        App --> Main
        App --> Constants
        App --> Types
        ReactSPA --> BuildConfigs
    end

    ReactSPA -->|HTTP REST| APIGateway["API Gateway / Load Balancer"]:::external

    subgraph "Docker Network"
        subgraph "Back-end Microservice"
            MainJava["BloodDonationSupportSystemApplication"]:::infra
            Controllers["Controllers"]:::controller
            EventAPI["EventAPI Controller"]:::controller
            Services["Business Services"]:::service
            Repositories["Data Repositories"]:::repository
            Entities["JPA Entities"]:::entity
            Infra["JpaUtil"]:::infra

            MainJava --> Controllers
            Controllers --> EventAPI
            Controllers --> Services
            Services --> Repositories
            Services --> Infra
            Repositories --> Entities
        end

        DB["Relational Database"]:::db
    end

    APIGateway --> Controllers
    Repositories --> DB
    Services -->|SMTP| SMTP["SMTP Server"]:::external

    subgraph "Configuration Files"
        Pom["pom.xml"]:::infra
        Dockerfile["Dockerfile"]:::infra
        AppProps["application.properties"]:::infra
        META["META-INF configs"]:::infra
    end

    MainJava --> Pom
    MainJava --> Dockerfile
    MainJava --> AppProps
    MainJava --> META

    %% Click Events
    click ReactSPA "https://github.com/shiross00/swp391_su25/tree/main/front-end/src"
    click Components "https://github.com/shiross00/swp391_su25/tree/main/front-end/src/components"
    click HomePage "https://github.com/shiross00/swp391_su25/blob/main/front-end/src/pages/home.tsx"
    click App "https://github.com/shiross00/swp391_su25/blob/main/front-end/src/App.tsx"
    click Main "https://github.com/shiross00/swp391_su25/blob/main/front-end/src/main.tsx"
    click Constants "https://github.com/shiross00/swp391_su25/blob/main/front-end/src/utils/constants.tsx"
    click Types "https://github.com/shiross00/swp391_su25/blob/main/front-end/src/types.ts"
    click BuildConfigs "https://github.com/shiross00/swp391_su25/blob/main/front-end/vite.config.ts"
    click BuildConfigs "https://github.com/shiross00/swp391_su25/blob/main/front-end/package.json"
    click BuildConfigs "https://github.com/shiross00/swp391_su25/blob/main/front-end/tsconfig.json"
    click BuildConfigs "https://github.com/shiross00/swp391_su25/blob/main/front-end/tsconfig.app.json"
    click BuildConfigs "https://github.com/shiross00/swp391_su25/blob/main/front-end/tsconfig.node.json"
    click MainJava "https://github.com/shiross00/swp391_su25/blob/main/blood-donation-support-system/src/main/java/com/swp391/superapp/bloodsupport/BloodDonationSupportSystemApplication.java"
    click EventAPI "https://github.com/shiross00/swp391_su25/blob/main/blood-donation-support-system/src/main/java/com/swp391/superapp/bloodsupport/controller/EventAPI.java"
    click Entities "https://github.com/shiross00/swp391_su25/tree/main/blood-donation-support-system/src/main/java/com/swp391/superapp/bloodsupport/entity"
    click Repositories "https://github.com/shiross00/swp391_su25/tree/main/blood-donation-support-system/src/main/java/com/swp391/superapp/bloodsupport/repository"
    click Services "https://github.com/shiross00/swp391_su25/tree/main/blood-donation-support-system/src/main/java/com/swp391/superapp/bloodsupport/service"
    click Infra "https://github.com/shiross00/swp391_su25/blob/main/blood-donation-support-system/src/main/java/com/swp391/superapp/bloodsupport/infra/JpaUtil.java"
    click Pom "https://github.com/shiross00/swp391_su25/blob/main/back-end/blood-donation-support-system/pom.xml"
    click Dockerfile "https://github.com/shiross00/swp391_su25/tree/main/back-end/blood-donation-support-system/Dockerfile"
    click AppProps "https://github.com/shiross00/swp391_su25/blob/main/back-end/blood-donation-support-system/src/main/resources/application.properties"
    click META "https://github.com/shiross00/swp391_su25/blob/main/back-end/blood-donation-support-system/src/main/resources/META-INF/application.properties"

    classDef frontend fill:#cce5ff,stroke:#004085,color:#004085
    classDef controller fill:#d4edda,stroke:#155724,color:#155724
    classDef service fill:#d4edda,stroke:#155724,color:#155724
    classDef repository fill:#d4edda,stroke:#155724,color:#155724
    classDef entity fill:#d4edda,stroke:#155724,color:#155724
    classDef infra fill:#e2e3e5,stroke:#6c757d,color:#6c757d
    classDef db fill:#fff3cd,stroke:#856404,color:#856404
    classDef external fill:#f8d7da,stroke:#721c24,color:#721c24
```
