# martromeros/r.d.a_front architecture

> Architecture diagram of the GitHub repository martromeros/r.d.a_front, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/martromeros/r.d.a_front
- Repository: https://github.com/martromeros/r.d.a_front

## Overview

##### Project type and purpose
- This is a single-page, full-front-end Angular application (Angular CLI v19).
- It implements UI components for authentication (login/registration/forgot password), user roles (admin, alumno), shared layout (header, perfil), routing, and communicates with a backend via HTTP services.

##### File structure
- Top-level:
– angular.json, tsconfig*.json, package.json (build/config)
– src/ (application code)
– public/ or assets/ (static assets)
- src/app/:
– app.module, app.component, app.routes, app.config (root module, root component, routing, environment/global config)
– components/: feature components organized by domain (auth, admin, alumno)
– services/: singleton services (AuthService, UserService)
– shared/: shared UI (header, perfil) and modules (GeneralModule)
- Tests: *.spec.ts are unit tests.

##### README
- Confirms it’s an Angular CLI–generated front end
- Details how to serve, build, and test the app

##### Main components & their interactions
a. UI Layer (Components)
– Auth Components (login, registro, forgot-password)
– Admin Components (admin dashboard, reportes → filtros, tablas)
– Alumno Component
– Shared Components (header, perfil)
b. Services Layer
– AuthServicesService (login/logout/token management) → issues HTTP calls to Backend Auth API
– UserService (fetch user profile, alumno/admin data) → HTTP calls to Backend User API
c. Configuration
– app.config.ts holds endpoints/base URLs
d. Routing
– app.routes.ts defines route guards based on AuthService and directs to feature modules
e. Feature Modules
– GeneralModule bundles shared pipes/directives, used by feature modules

##### Relationships & data flows
– User action in a Component → invokes Service method (via Angular Dependency Injection)
– Service sends HTTP request → Backend API
– HTTP response → Service returns Observable → Component subscribes → updates UI
– app.routes.ts uses AuthService to guard/admin only routes
– Shared header/perfil display data from UserService

##### Architectural patterns & design principles
– Component-based UI (Angular Components)
– Separation of concerns (Components vs. Services vs. Modules)
– Feature modules for encapsulation (shared, general)
– Dependency Injection for services
– Single-page routing (Angular Router)

- Labels: Component names (e.g. LoginComponent), Service names (AuthService), Module names
– UI Components (blue)
– Services (green)
– Modules/Config (orange)
– External Systems (gray)

Use this structure as your canvas. Lay out the UI components on the left, services in the middle, and the backend API on the right. Encapsulate shared modules around the components they serve. This will give stakeholders and new engineers a crystal-clear picture of RDAFront’s architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% App Root
    subgraph "App Root"
        AppModule["AppModule"]:::module
        AppComponent["AppComponent"]:::component
        AppConfig["app.config.ts"]:::config
        AppRoutes["app.routes.ts"]:::config
    end

    %% Feature Modules and Components
    subgraph "Auth Feature"
        LoginComponent["LoginComponent"]:::component
        RegistroComponent["RegistroComponent"]:::component
        ForgotPasswordComponent["ForgotPasswordComponent"]:::component
    end

    subgraph "Admin Feature"
        AdminComponent["AdminComponent"]:::component
        ReportesComponent["ReportesComponent"]:::component
        ReportesFiltrosComponent["ReportesFiltrosComponent"]:::component
        ReportesTablasComponent["ReportesTablasComponent"]:::component
        ReporteModel["ReporteModel"]:::model
    end

    subgraph "Alumno Feature"
        AlumnoComponent["AlumnoComponent"]:::component
    end

    subgraph "Shared Module"
        GeneralModule["GeneralModule"]:::module
        HeaderComponent["HeaderComponent"]:::component
        PerfilComponent["PerfilComponent"]:::component
    end

    %% Services Layer
    subgraph "Services"
        AuthServicesService["AuthServicesService"]:::service
        UserService["UserService"]:::service
    end

    %% External Backend
    BackendAPI["Backend API"]:::external

    %% Routing flow
    Browser["Browser Address Bar"]:::external -->|navigates| AppRoutes
    AppRoutes -->|initializes| AppModule
    AppModule -->|bootstrap| AppComponent
    AppComponent -->|renders router-outlet| LoginComponent

    %% Component to Service DI
    LoginComponent -->|injects| AuthServicesService
    RegistroComponent -->|injects| AuthServicesService
    ForgotPasswordComponent -->|injects| AuthServicesService
    AdminComponent -->|injects| UserService
    ReportesComponent -->|injects| UserService
    ReportesFiltrosComponent -->|injects| UserService
    ReportesTablasComponent -->|injects| UserService
    AlumnoComponent -->|injects| UserService
    HeaderComponent -->|injects| UserService
    PerfilComponent -->|injects| UserService

    %% Services to Backend (HTTP)
    AuthServicesService -.->|HTTP| BackendAPI
    UserService -.->|HTTP| BackendAPI

    %% Responses back to Components
    AuthServicesService -->|Observable| LoginComponent
    AuthServicesService -->|Observable| RegistroComponent
    AuthServicesService -->|Observable| ForgotPasswordComponent
    UserService -->|Observable| AdminComponent
    UserService -->|Observable| ReportesComponent
    UserService -->|Observable| ReportesFiltrosComponent
    UserService -->|Observable| ReportesTablasComponent
    UserService -->|Observable| AlumnoComponent
    UserService -->|Observable| HeaderComponent
    UserService -->|Observable| PerfilComponent

    %% Click Events
    click AppComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/app.component.ts"
    click AppConfig "https://github.com/martromeros/r.d.a_front/blob/master/src/app/app.config.ts"
    click AppRoutes "https://github.com/martromeros/r.d.a_front/blob/master/src/app/app.routes.ts"
    click LoginComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/components/auth/login/login.component.ts"
    click RegistroComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/components/auth/registro/registro.component.ts"
    click ForgotPasswordComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/components/auth/forgot-password/forgot-password.component.ts"
    click AdminComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/components/admin/admin.component.ts"
    click ReportesComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/components/admin/reportes/reportes.component.ts"
    click ReportesFiltrosComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/components/admin/reportes/reportes-filtos/reportes-filtos.component.ts"
    click ReportesTablasComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/components/admin/reportes/reportes-tablas/reportes-tablas.component.ts"
    click ReporteModel "https://github.com/martromeros/r.d.a_front/blob/master/src/app/components/admin/reportes/reportes-tablas/reporte.model.ts"
    click AlumnoComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/components/alumno/alumno.component.ts"
    click HeaderComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/shared/components/header/header.component.ts"
    click PerfilComponent "https://github.com/martromeros/r.d.a_front/blob/master/src/app/shared/components/perfil/perfil.component.ts"
    click GeneralModule "https://github.com/martromeros/r.d.a_front/blob/master/src/app/shared/modules/general/general.module.ts"
    click AuthServicesService "https://github.com/martromeros/r.d.a_front/blob/master/src/app/services/auth-services.service.ts"
    click UserService "https://github.com/martromeros/r.d.a_front/blob/master/src/app/services/user.service.ts"
    click LoginResponseModel "https://github.com/martromeros/r.d.a_front/blob/master/src/app/models/loginResponse.ts"

    %% Styles
    classDef component fill:#D0E8FF,stroke:#0366D6,stroke-width:1px
    classDef service fill:#DFFFE0,stroke:#28A745,stroke-width:1px
    classDef config fill:#FFEBCD,stroke:#D2691E,stroke-width:1px
    classDef module fill:#FFF5BA,stroke:#E0A800,stroke-width:1px
    classDef model fill:#F0F0F0,stroke:#6C757D,stroke-width:1px
    classDef external fill:#E8E8E8,stroke:#6C757D,stroke-width:1px,stroke-dasharray: 2 2
```
