# domork/scheduler architecture

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

- Interactive diagram: https://gitdiagram.com/domork/scheduler
- Repository: https://github.com/domork/scheduler

## Overview

##### Main Components

a) Frontend Layer (Angular):
- Authentication Module
- Management Module
- Scheduler Module
- User Interface Components
- Service Layer for API Communication

b) Backend Layer (Spring Boot):
- Security Layer (JWT Authentication)
- REST Controllers (Endpoints)
- Service Layer
- Data Access Layer
- Domain Models

c) Database Layer (implied from SQL files)
- User Management
- Management
- Schedule Management

##### Key Architectural Elements

- Clear separation of concerns (Frontend/Backend/Database)
- MVC pattern in the backend
- Component-based architecture in Angular frontend
- JWT-based security implementation
- Service-oriented architecture for business logic

**[Frontend (Angular)] ←→ [Backend (Spring Boot)] ←→ [Database]**

##### Detailed Component Breakdown

Frontend Section:
- Auth Components
- Login
- Signup
- Token Storage
- Group Management
- Create Group
- Join Group
- Group Details
- Scheduler Interface
- Calendar View
- Time Interval Management
- Services
- Auth Service
- Group Service
- Notification Service

Backend Section:
- Security Layer
- JWT Provider
- Auth Filter
- Security Config
- Controllers
- App Endpoint
- Group Endpoint
- Services
- Group Service
- User Service
- Data Access
- Group DAO
- User DAO

##### Flow Representations

- User authentication flow
- Management operations
- Schedule creation and updates
- Real-time notifications
- Data persistence operations

##### Technical Details

- Angular 12+ (based on configuration)
- Spring Boot framework
- JWT Authentication
- RESTful API endpoints
- SQL Database
- Maven build system

##### Interaction Patterns

How the following flows work:
- User authentication and authorization
- Creation and joining
- Time interval management
- Schedule coordination
- Real-time updates

Remember to emphasize the unique features of this system:
- Time interval matching logic
- Management capabilities
- Real-time schedule updates
- User preference management

This will create a comprehensive yet clear representation of the system's architecture that accurately reflects its implementation while remaining accessible to other developers.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef security fill:#f1c40f,stroke:#f39c12,color:black
    classDef database fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef service fill:#e74c3c,stroke:#c0392b,color:white

    %% Frontend Layer
    subgraph Frontend
        AuthModule["Authentication Module"]:::frontend
        GroupModule["Group Management Module"]:::frontend
        SchedulerUI["Scheduler Interface"]:::frontend
        
        subgraph FrontendServices
            AuthService["Auth Service"]:::service
            GroupService["Group Service"]:::service
            NotifService["Notification Service"]:::service
        end

        %% Frontend Components
        AuthModule --> |uses| AuthService
        GroupModule --> |uses| GroupService
        SchedulerUI --> |uses| GroupService
        NotifService --> |updates| SchedulerUI
    end

    %% Backend Layer
    subgraph Backend
        SecurityLayer["Security Layer"]:::security
        
        subgraph Controllers
            AppEndpoint["App Endpoint"]:::backend
            GroupEndpoint["Group Endpoint"]:::backend
        end
        
        subgraph Services
            BackendGroupService["Group Service"]:::backend
            UserService["User Service"]:::backend
        end
        
        subgraph DataAccess
            GroupDAO["Group DAO"]:::backend
            UserDAO["User DAO"]:::backend
        end

        subgraph Utils
            IntervalManager["Interval Management"]:::backend
        end
    end

    %% Database Layer
    subgraph Database
        UserDB[(User DB)]:::database
        GroupDB[(Group DB)]:::database
        ScheduleDB[(Schedule DB)]:::database
    end

    %% Cross-layer connections
    AuthService --> |JWT| SecurityLayer
    GroupService --> |REST| GroupEndpoint
    NotifService --> |WebSocket| AppEndpoint

    SecurityLayer --> Controllers
    Controllers --> Services
    Services --> DataAccess
    Services --> IntervalManager
    
    DataAccess --> UserDB
    DataAccess --> GroupDB
    DataAccess --> ScheduleDB

    %% Click events for component mapping
    click AuthModule "https://github.com/domork/Scheduler/tree/main/frontend/src/app/auth"
    click GroupModule "https://github.com/domork/Scheduler/tree/main/frontend/src/app/forms/create-group"
    click SchedulerUI "https://github.com/domork/Scheduler/tree/main/frontend/src/app/page/scheduler"
    click AuthService "https://github.com/domork/Scheduler/blob/main/frontend/src/app/service/auth.service.ts"
    click GroupService "https://github.com/domork/Scheduler/blob/main/frontend/src/app/service/group.service.ts"
    click NotifService "https://github.com/domork/Scheduler/blob/main/frontend/src/app/service/notification.service.ts"
    click SecurityLayer "https://github.com/domork/Scheduler/tree/main/backend/src/main/java/domork/MySchedule/security"
    click AppEndpoint "https://github.com/domork/Scheduler/blob/main/backend/src/main/java/domork/MySchedule/endpoint/AppEndpoint.java"
    click GroupEndpoint "https://github.com/domork/Scheduler/blob/main/backend/src/main/java/domork/MySchedule/endpoint/GroupEndpoint.java"
    click BackendGroupService "https://github.com/domork/Scheduler/blob/main/backend/src/main/java/domork/MySchedule/service/GroupService.java"
    click UserService "https://github.com/domork/Scheduler/blob/main/backend/src/main/java/domork/MySchedule/service/UserService.java"
    click GroupDAO "https://github.com/domork/Scheduler/blob/main/backend/src/main/java/domork/MySchedule/persistance/GroupDAO.java"
    click UserDAO "https://github.com/domork/Scheduler/blob/main/backend/src/main/java/domork/MySchedule/persistance/UserDAO.java"
    click IntervalManager "https://github.com/domork/Scheduler/tree/main/backend/src/main/java/domork/MySchedule/util/interval"
```
