# elcerebrogris/front-hotel-managemnt architecture

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

- Interactive diagram: https://gitdiagram.com/elcerebrogris/front-hotel-managemnt
- Repository: https://github.com/elcerebrogris/front-hotel-managemnt

## Overview

##### Project Type Analysis
This is a single-page application (SPA) built with Angular 14, appearing to be an intranet system with features for user management, room management, reservations, and group management. The presence of Docker configuration suggests containerized deployment.

##### Main System Components

Frontend Architecture:
- Core Angular Application
- Feature Modules:
- Authentication (Login/Register)
- User Management
- Room Management (Quartos)
- Reservations (Reservas)
- Groups Management
- Services (Servicos)
- Payment/Recharges
- Shared Components:
- Header
- Dashboard
- Core Services Layer:
- Authentication Service
- General Service
- Room Service
- Security Layer:
- JWT Interceptor
- Auth Guard
- Response Interceptor

Infrastructure:
- Nginx Web Server (indicated by nginx.conf)
- Docker Container
- Browser Client

**[Client Browser Layer]**
- ↕
**[Nginx Reverse Proxy Layer]**
- ↕
**[Angular Application Container]**
- ↓
**[Core Application Components]**

**[Feature Modules] ←→ [Services Layer] ←→ [Security Layer]**
- ↕                   ↕               ↕
**[Shared Components] ←→ [State Management] ←→ [Interceptors]**

##### Component Relationship Details

- User authentication flow
- API request/response paths
- Component dependencies
- Data flow between modules

##### Technical Stack Indicators

- Angular 14
- TypeScript
- Bootstrap (indicated by CSS files)
- Chart.js and other visualization libraries
- Docker
- Nginx

Create distinct sections for:
a) Infrastructure Layer
b) Application Layer
c) Security Layer
d) Feature Modules
e) External Integrations

##### Additional Elements

Callouts for:
- Environment configurations
- Build/deployment flow
- Testing infrastructure
- Asset management
- Plugin system

Remember to highlight the modular nature of the Angular application and how the various services, interceptors, and guards work together to create a secure and functional intranet system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Layer"]
        Browser["Web Browser"]:::client
    end

    subgraph Infrastructure["Infrastructure Layer"]
        Nginx["Nginx Reverse Proxy"]:::infra
        Docker["Docker Container"]:::infra
    end

    subgraph Angular["Angular Application"]
        subgraph Security["Security Layer"]
            JWT["JWT Interceptor"]:::security
            AuthGuard["Auth Guard"]:::security
            ResponseInt["Response Interceptor"]:::security
        end

        subgraph Core["Core Services"]
            AuthService["Authentication Service"]:::service
            GeneralService["General Service"]:::service
            RoomService["Room Service"]:::service
        end

        subgraph Features["Feature Modules"]
            Auth["Authentication Module"]:::feature
            Users["User Management"]:::feature
            Rooms["Room Management"]:::feature
            Reservations["Reservations"]:::feature
            Groups["Groups Management"]:::feature
            Services["Services Module"]:::feature
            Payments["Payment/Recharges"]:::feature
        end

        subgraph Shared["Shared Components"]
            Header["Header Component"]:::component
            Dashboard["Dashboard Component"]:::component
        end

        subgraph Models["Data Models"]
            UserModel["User Model"]:::model
            RoomModel["Room Model"]:::model
            ReservationModel["Reservation Model"]:::model
            GroupModel["Group Model"]:::model
            PermissionModel["Permission Model"]:::model
        end
    end

    Browser --> Nginx
    Nginx --> Angular
    
    Auth --> Core
    Users --> Core
    Rooms --> Core
    Reservations --> Core
    Groups --> Core
    Services --> Core
    Payments --> Core
    
    Core --> Security
    Features --> Shared
    Core --> Models

    %% Click Events
    click JWT "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/helpers/JwtInterceptor.ts"
    click AuthGuard "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/helpers/auth.guard.ts"
    click ResponseInt "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/helpers/responseInterceptor.ts"
    click AuthService "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/services/auth.service.ts"
    click GeneralService "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/services/general.service.ts"
    click RoomService "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/services/room.service.ts"
    click Header "https://github.com/ElCerebroGris/front-hotel-managemnt/tree/main/src/app/components/header"
    click Dashboard "https://github.com/ElCerebroGris/front-hotel-managemnt/tree/main/src/app/components/dashboard"
    click Auth "https://github.com/ElCerebroGris/front-hotel-managemnt/tree/main/src/app/components/login"
    click Users "https://github.com/ElCerebroGris/front-hotel-managemnt/tree/main/src/app/components/users"
    click Rooms "https://github.com/ElCerebroGris/front-hotel-managemnt/tree/main/src/app/components/quartos"
    click Reservations "https://github.com/ElCerebroGris/front-hotel-managemnt/tree/main/src/app/components/reservas"
    click Groups "https://github.com/ElCerebroGris/front-hotel-managemnt/tree/main/src/app/components/groups"
    click Services "https://github.com/ElCerebroGris/front-hotel-managemnt/tree/main/src/app/components/servicos"
    click Payments "https://github.com/ElCerebroGris/front-hotel-managemnt/tree/main/src/app/components/recharges"
    click Nginx "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/docker/nginx/nginx.conf"
    click UserModel "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/models/utilizador.ts"
    click RoomModel "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/models/quarto.ts"
    click ReservationModel "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/models/reserva.ts"
    click GroupModel "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/models/group.ts"
    click PermissionModel "https://github.com/ElCerebroGris/front-hotel-managemnt/blob/main/src/app/models/permission.ts"

    %% Styling
    classDef client fill:#E1F5FE,stroke:#01579B
    classDef infra fill:#ECEFF1,stroke:#263238
    classDef security fill:#FFECB3,stroke:#FF6F00
    classDef service fill:#C8E6C9,stroke:#1B5E20
    classDef feature fill:#E3F2FD,stroke:#0D47A1
    classDef component fill:#E8EAF6,stroke:#1A237E
    classDef model fill:#F3E5F5,stroke:#4A148C
```
