# ranielcsar/angular_spring_loiane architecture

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

- Interactive diagram: https://gitdiagram.com/ranielcsar/angular_spring_loiane
- Repository: https://github.com/ranielcsar/angular_spring_loiane

## Overview

##### High-Level Architecture Overview

Frontend Layer:
- Angular application structure with the following components:
- Main Module (AppModule)
- Courses Feature Module
- Shared Module (containing reusable components)
- Services Layer for HTTP communication
- Material UI Components

Backend Layer:
- Spring Boot application with these components:
- Controllers Layer
- Service Layer
- Repository Layer
- Model Layer
- DTO Layer
- Database (H2)

##### Component Details

- Courses Module (main feature module)
- Components (courses-list, course-form)
- Services (courses.service)
- Models (course.ts, lesson.ts)
- Shared Components (error-dialog)
- Material UI Integration

- CourseController (REST endpoints)
- CourseService (business logic)
- CourseRepository (data access)
- DTOs (CourseDTO, LessonDTO)
- Entity Models (Course, Lesson)
- Enums (Category, Status)

##### Data Flow and Interactions

- HTTP requests from Angular services to Spring Boot endpoints
- Internal communication between layers
- Database operations
- DTO transformations

##### Technical Details to Note

Specific technical implementations:
- H2 Database connection
- Spring Boot configurations
- Angular Material theming
- API endpoints with methods (GET, POST, PUT, DELETE)

##### Error handling and validation mechanisms

Keep the abstraction level high enough to be understandable but detailed enough to show the important architectural decisions and patterns used in the project.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef frontend fill:#e1f5fe,stroke:#01579b
    classDef backend fill:#e8f5e9,stroke:#1b5e20
    classDef database fill:#ede7f6,stroke:#4527a0
    classDef service fill:#fff3e0,stroke:#ff6f00
    classDef component fill:#fbe9e7,stroke:#bf360c
    classDef shared fill:#f3e5f5,stroke:#7b1fa2

    %% Frontend Layer
    subgraph Frontend
        AppModule["App Module"]
        CoursesModule["Courses Module"]
        SharedModule["Shared Module"]
        MaterialUI["Material UI"]
        ErrorDialog["Error Dialog"]
        CourseService["Course Service"]
        CourseModels["Course Models"]
        CoursesList["Courses List"]
        CourseForm["Course Form"]
    end

    %% Backend Layer
    subgraph Backend
        Controller["Course Controller"]
        Service["Course Service"]
        Repository["Course Repository"]
        Models["Entity Models"]
        DTOs["DTOs"]
        Enums["Enums"]
        ExceptionHandler["Exception Handler"]
    end

    %% Database
    DB[(H2 Database)]:::database

    %% Frontend Relationships
    AppModule --> CoursesModule
    AppModule --> SharedModule
    SharedModule --> MaterialUI
    SharedModule --> ErrorDialog
    CoursesModule --> CourseService
    CoursesModule --> CourseModels
    CoursesModule --> CoursesList
    CoursesModule --> CourseForm
    CourseService --> Controller

    %% Backend Relationships
    Controller --> Service
    Service --> Repository
    Service --> DTOs
    Service --> Models
    Models --> Enums
    Controller --> ExceptionHandler
    Repository --> DB

    %% Click Events
    click AppModule "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-web/src/app/app.module.ts"
    click CoursesModule "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-web/src/app/courses/courses.module.ts"
    click SharedModule "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-web/src/app/shared/shared.module.ts"
    click MaterialUI "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-web/src/app/shared/app-material/app-material.module.ts"
    click ErrorDialog "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-web/src/app/shared/components/error-dialog/error-dialog.component.ts"
    click CourseService "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-web/src/app/courses/services/courses.service.ts"
    click CourseModels "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-web/src/app/courses/model/course.ts"
    click CoursesList "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-web/src/app/courses/components/courses-list/courses-list.component.ts"
    click CourseForm "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-web/src/app/courses/containers/course-form/course-form.component.ts"
    click Controller "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-spring/src/main/java/com/ranielcsar/crudspring/controller/CourseController.java"
    click Service "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-spring/src/main/java/com/ranielcsar/crudspring/service/CourseService.java"
    click Repository "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-spring/src/main/java/com/ranielcsar/crudspring/repository/CourseRepository.java"
    click Models "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-spring/src/main/java/com/ranielcsar/crudspring/model/Course.java"
    click DTOs "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-spring/src/main/java/com/ranielcsar/crudspring/dto/CourseDTO.java"
    click Enums "https://github.com/ranielcsar/angular_spring_loiane/tree/master/crud-spring/src/main/java/com/ranielcsar/crudspring/enums/"
    click ExceptionHandler "https://github.com/ranielcsar/angular_spring_loiane/blob/master/crud-spring/src/main/java/com/ranielcsar/crudspring/controller/ApplicationControllerAdvice.java"

    %% Style Applications
    class AppModule,CoursesModule,SharedModule,MaterialUI,ErrorDialog,CoursesList,CourseForm frontend
    class Controller,Service,Repository,Models,DTOs,Enums,ExceptionHandler backend
    class CourseService service
    class CourseModels component
```
