# dpham123occ/frog_scheduler_latest architecture

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

- Interactive diagram: https://gitdiagram.com/dpham123occ/frog_scheduler_latest
- Repository: https://github.com/dpham123occ/frog_scheduler_latest

## Overview

##### Project Type and Purpose
- This project is a full‐stack web application that provides scheduling functionality, likely aimed at managing scheduling for “Superfrogs” (or similar entities) as well as handling customers, requests, and user authentication.
- The backend is implemented using Java (Spring Boot) while the frontend is built using Vue.js with Vite. Containerization is used, as shown by Dockerfiles in both the frontend and backend folders and an overall docker-compose file.

##### File Structure to Determine Architectural Layers
- Frontend (Vue.js):
- Contains the main index.html, Vue components (e.g., Login, Pricing, Request, SuperFrogDirector, SuperFrogStudent, etc.), views (step1.vue – step4.vue), router configuration, and styling.
- Likely communicates with the backend through REST APIs.

- Backend (Spring Boot):
- Organized in a standard Maven structure with separate packages for controllers, services, repositories, domain models, and utilities.
- Key modules include:
- Customer, Request, Superfrog, SpiritDirector, and User: Each module has its own Controller, Service, and Repository, following an MVC pattern.
- Security: Contains JWT-based authentication, custom entry points, CORS configuration, and authorization handlers.
- System: Initialization routines (DBDataInitializer), error handling (ExceptionHandlerAdvice), and status code definitions.
- Converters and DTOs: Convert objects to and from DTOs, ensuring proper separation between API and internal domain objects.
- A configuration file (application.yml) handles runtime settings.

- Infrastructure & Deployment:
- Docker and docker-compose are used to containerize both the frontend and the backend.
- There are Maven build scripts and various target directories which indicate compiled artifacts and test reports.

a. Main Components:
- Frontend Client (Vue.js):
- Notable UI modules such as Login, Request, Pricing, and the SuperFrogDirector and SuperFrogStudent dashboards.

- Backend API (Spring Boot Application):
▪ Business Logic Layer (Services): Highlight the CustomerService, RequestService, SuperfrogService, SpiritDirectorService, and SuperfrogUserService.
▪ Data Access Layer (Repositories): Show CustomerRepository, RequestRepository, SuperfrogRepository, and other related repositories.
▪ Security Module: Indicate the AuthController, AuthService, JWT provider, CORS configuration, and custom exception/denial handlers.
▪ Utility and Conversion Layer: Include the converters (for DTOs) showing how data is formatted for input/output.

- Database:
- Even though the specific DB isn’t detailed directly in the file tree, assume a relational database that the repositories talk to. Represent this as a “Database” component, connected to the backend.

- Containerization & Deployment:
- Docker containers that encapsulate the frontend and backend.
- Docker-compose orchestration if needed as a deployment layer.

b. Relationships and Data Flow:
- Interaction within the backend: UI calls Controller → Controller calls Service → Service calls Repository → Repository interacts with the Database.

c. Architectural Patterns & Design Principles:
- MVC structure on the backend by clearly separating Controllers, Services, and Repositories.
- Use of DTOs and converters that mediate between external API payloads and internal objects.
- Security design which integrates RESTful authentication using JWT and custom handlers.
- Use clear annotations for the layered architecture (Presentation, Business, Data).

d. Technologies and Frameworks:
- Frontend: Vue.js, Vite, JavaScript/HTML/CSS.
- Backend: Java, Spring Boot, Maven build system.
- Security: JWT-based authentication, Spring Security features.
- Containerization: Docker (with separate Dockerfiles), docker-compose for orchestration.
- Testing Frameworks: Indicate unit/integration tests present in the “src/test” directory of the backend.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer (Vue.js)"
      direction TB
      FrontendClient["Frontend (Vue.js)"]:::frontend
      LoginUI["Login"]:::frontend
      PricingUI["Pricing"]:::frontend
      RequestUI["Request"]:::frontend
      DirectorUI["SuperFrogDirector"]:::frontend
      StudentUI["SuperFrogStudent"]:::frontend
      FrontendClient --> LoginUI
      FrontendClient --> PricingUI
      FrontendClient --> RequestUI
      FrontendClient --> DirectorUI
      FrontendClient --> StudentUI
    end

    %% Backend Layer
    subgraph "Backend Layer (Spring Boot)"
      direction TB
      BackendEntry["SuperfrogSchedulerApplication"]:::backend
      
      subgraph "Controllers"
        direction TB
        CustomerController["CustomerController"]:::backend
        RequestController["RequestController"]:::backend
        SuperfrogController["SuperfrogController"]:::backend
        SpiritDirectorController["SpiritDirectorController"]:::backend
        SuperfrogUserController["SuperfrogUserController"]:::backend
        AuthController["AuthController"]:::security
      end
      
      subgraph "Services"
        direction TB
        CustomerService["CustomerService"]:::backend
        RequestService["RequestService"]:::backend
        SuperfrogService["SuperfrogService"]:::backend
        SpiritDirectorService["SpiritDirectorService"]:::backend
        SuperfrogUserService["SuperfrogUserService"]:::backend
        AuthService["AuthService"]:::security
      end
      
      subgraph "Repositories"
        direction TB
        CustomerRepository["CustomerRepository"]:::backend
        RequestRepository["RequestRepository"]:::backend
        SuperfrogRepository["SuperfrogRepository"]:::backend
        SpiritDirectorRepository["SpiritDirectorRepository"]:::backend
        SuperfrogUserRepository["SuperfrogUserRepository"]:::backend
      end

      SecurityModule["Security Module (JWT, CORS)"]:::security
      UtilityModule["Converters & DTOs/Utilities"]:::utility
      SystemModule["System Init & Exception Handling"]:::backend

      %% Flow within backend
      BackendEntry -->|"routes"| CustomerController
      BackendEntry -->|"routes"| RequestController
      BackendEntry -->|"routes"| SuperfrogController
      BackendEntry -->|"routes"| SpiritDirectorController
      BackendEntry -->|"routes"| SuperfrogUserController
      BackendEntry -->|"routes"| AuthController

      CustomerController -->|"calls"| CustomerService
      RequestController -->|"calls"| RequestService
      SuperfrogController -->|"calls"| SuperfrogService
      SpiritDirectorController -->|"calls"| SpiritDirectorService
      SuperfrogUserController -->|"calls"| SuperfrogUserService
      AuthController -->|"calls"| AuthService

      CustomerService -->|"calls"| CustomerRepository
      RequestService -->|"calls"| RequestRepository
      SuperfrogService -->|"calls"| SuperfrogRepository
      SpiritDirectorService -->|"calls"| SpiritDirectorRepository
      SuperfrogUserService -->|"calls"| SuperfrogUserRepository
      
      SecurityModule ---|"secures"| CustomerController
      SecurityModule ---|"secures"| RequestController
      SecurityModule ---|"secures"| SuperfrogController
      SecurityModule ---|"secures"| SpiritDirectorController
      SecurityModule ---|"secures"| SuperfrogUserController
      SecurityModule ---|"secures"| AuthController
      
      CustomerService ---|"converts"| UtilityModule
      RequestService ---|"converts"| UtilityModule
      SuperfrogService ---|"converts"| UtilityModule
      
      SystemModule ---|"handles"| BackendEntry
    end

    %% Database Component
    Database["Database"]:::database

    %% Connect Repositories to Database
    CustomerRepository -->|"queries"| Database
    RequestRepository -->|"queries"| Database
    SuperfrogRepository -->|"queries"| Database
    SpiritDirectorRepository -->|"queries"| Database
    SuperfrogUserRepository -->|"queries"| Database

    %% Interaction from Frontend to Backend
    FrontendClient -->|"HTTP_JSON"| CustomerController
    FrontendClient -->|"HTTP_JSON"| RequestController
    FrontendClient -->|"HTTP_JSON"| AuthController

    %% Deployment Layer
    subgraph "Deployment"
      direction TB
      FrontendDocker["Frontend Dockerfile"]:::container
      BackendDocker["Backend Dockerfile"]:::container
      Compose["docker-compose.yml"]:::container
    end

    Compose --> FrontendDocker
    Compose --> BackendDocker

    %% Click Events
    click FrontendClient "https://github.com/dpham123occ/frog_scheduler_latest/tree/main/frontend/"
    click LoginUI "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/frontend/src/components/Login/Login.vue"
    click PricingUI "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/frontend/src/components/Pricing/Pricing.vue"
    click RequestUI "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/frontend/src/components/Request/Request.vue"
    click DirectorUI "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/frontend/src/components/SuperFrogDirector/SuperFrogDirector.vue"
    click StudentUI "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/frontend/src/components/SuperFrogStudent/SuperFrogStudent.vue"
    
    click BackendEntry "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/SuperfrogSchedulerApplication.java"
    click CustomerController "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/customer/CustomerController.java"
    click RequestController "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/request/RequestController.java"
    click SuperfrogController "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/superfrog/SuperfrogController.java"
    click SpiritDirectorController "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/spiritDirector/SpiritDirectorController.java"
    click SuperfrogUserController "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/user/SuperfrogUserController.java"
    click AuthController "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/security/AuthController.java"
    
    click CustomerService "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/customer/CustomerService.java"
    click RequestService "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/request/RequestService.java"
    click SuperfrogService "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/superfrog/SuperfrogService.java"
    click SpiritDirectorService "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/spiritDirector/SpiritDirectorService.java"
    click SuperfrogUserService "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/user/SuperfrogUserService.java"
    click AuthService "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/security/AuthService.java"
    
    click CustomerRepository "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/customer/CustomerRepository.java"
    click RequestRepository "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/request/RequestRepository.java"
    click SuperfrogRepository "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/superfrog/SuperfrogRepository.java"
    click SpiritDirectorRepository "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/spiritDirector/SpiritDirectorRepository.java"
    click SuperfrogUserRepository "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/user/SuperfrogUserRepository.java"
    
    click SecurityModule "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/security/SecurityConfiguration.java"
    click UtilityModule "https://github.com/dpham123occ/frog_scheduler_latest/tree/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/utils/converter/"
    click SystemModule "https://github.com/dpham123occ/frog_scheduler_latest/tree/main/backend/src/main/java/edu/tcu/cs/superfrogscheduler/system/"
    
    click BackendDocker "https://github.com/dpham123occ/frog_scheduler_latest/tree/main/backend/Dockerfile"
    click FrontendDocker "https://github.com/dpham123occ/frog_scheduler_latest/tree/main/frontend/Dockerfile"
    click Compose "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/docker-compose.yml"
    click AppConfig "https://github.com/dpham123occ/frog_scheduler_latest/blob/main/backend/src/main/resources/application.yml"

    %% Styles
    classDef frontend fill:#85C1E9,stroke:#1F618D,stroke-width:2px;
    classDef backend fill:#82E0AA,stroke:#27AE60,stroke-width:2px;
    classDef database fill:#D5DBDB,stroke:#7B7D7D,stroke-width:2px;
    classDef container fill:#F7DC6F,stroke:#B7950B,stroke-width:2px;
    classDef security fill:#F1948A,stroke:#E74C3C,stroke-width:2px;
    classDef utility fill:#BB8FCE,stroke:#8E44AD,stroke-width:2px;
```
