# camilo4re/reducar architecture

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

- Interactive diagram: https://gitdiagram.com/camilo4re/reducar
- Repository: https://github.com/camilo4re/reducar

## Overview

##### Project type and purpose
- This is a full-stack web application built on the Laravel PHP framework.
- By examining controllers like AlumnoController, AsistenciaController, NotaController, and models like Curso, Materia, Asistencia, Nota, User and RegistrationCode, we can see it’s a school management system handling users (students, teachers, directors), courses, subjects, attendance, grades, content, and registration codes.

##### File structure
- Top-level directories:
- app/ contains your MVC business logic (Controllers, Models, Middleware, Requests, View Components).
- resources/views/ contains Blade templates for UI.
- public/ holds the web root (CSS, JS, index.php).
- database/ holds migrations, seeders, and factories.
- routes/ defines web and auth routes.
- config/, bootstrap/, storage/, vendor/ (not shown) and tests/ complete the standard Laravel layout.
- Key patterns:
- MVC (Controllers ↔ Models ↔ Views)
- Role-based middleware (RoleMiddleware) guarding route access
- Eloquent ORM for database interactions
- RESTful controllers (index, create, edit, show, store, update, destroy)

##### Readme insights
- The README is the stock Laravel README, confirming framework features (routing, DI, ORM, migrations, queues, broadcasting).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        Browser["Browser"]:::external
        CSS["CSS Assets"]:::ui
        JS["JS Assets"]:::ui
        Views["Blade Views"]:::ui
    end

    %% Application Layer
    subgraph "Application Layer"
        Entry["public/index.php"]:::server
        subgraph Routing
            WebRoutes["routes/web.php"]:::server
            AuthRoutes["routes/auth.php"]:::server
        end
        Middleware["RoleMiddleware"]:::service
        subgraph "Controllers"
            AlumnoCtrl["AlumnoController"]:::service
            AsistenciaCtrl["AsistenciaController"]:::service
            NotaCtrl["NotaController"]:::service
            ContenidoCtrl["ContenidoController"]:::service
            MateriaCtrl["MateriaController"]:::service
            DirectivoCtrl["DirectivoController"]:::service
            ProfesorCtrl["ProfesorController"]:::service
        end
        subgraph "Auth Controllers"
            AuthRegs["RegisteredUserController"]:::service
            AuthSess["AuthenticatedSessionController"]:::service
        end
        subgraph "Request Validation"
            LoginReq["LoginRequest"]:::service
            ProfileReq["ProfileUpdateRequest"]:::service
        end
        Provider["AppServiceProvider"]:::service
    end

    %% Domain Layer
    subgraph "Domain Layer"
        subgraph "Models"
            UserModel["User"]:::model
            CursoModel["Curso"]:::model
            MateriaModel["Materia"]:::model
            AsistenciaModel["Asistencia"]:::model
            NotaModel["Nota"]:::model
            ContenidoModel["Contenido"]:::model
            RegCodeModel["RegistrationCode"]:::model
        end
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        DB[(Database)]:::db
        Migrations["Migrations"]:::db
        Seeders["Seeders & Factories"]:::db
        Storage["Storage & Cache"]:::db
        Configs["Config Files"]:::db
    end

    %% External Services
    subgraph "External Services"
        Mail["Mail Service"]:::external
        Queue["Queue Worker"]:::external
    end

    %% Testing
    subgraph "Testing"
        FeatureTests["tests/Feature"]:::test
        UnitTests["tests/Unit"]:::test
    end

    %% Connections
    Browser --> CSS
    Browser --> JS
    Browser --> Views
    Browser --> Entry
    Entry --> WebRoutes
    Entry --> AuthRoutes
    WebRoutes --> Middleware
    AuthRoutes --> Middleware
    Middleware --> AlumnoCtrl
    Middleware --> AsistenciaCtrl
    Middleware --> NotaCtrl
    Middleware --> ContenidoCtrl
    Middleware --> MateriaCtrl
    Middleware --> DirectivoCtrl
    Middleware --> ProfesorCtrl
    WebRoutes --> AuthRegs
    AuthRoutes --> AuthSess
    AlumnoCtrl --> UserModel
    AsistenciaCtrl --> AsistenciaModel
    NotaCtrl --> NotaModel
    ContenidoCtrl --> ContenidoModel
    MateriaCtrl --> MateriaModel
    DirectivoCtrl --> CursoModel
    ProfesorCtrl --> CursoModel
    AuthRegs --> UserModel
    AuthSess --> UserModel
    AlumnoCtrl --> Views
    AsistenciaCtrl --> Views
    NotaCtrl --> Views
    ContenidoCtrl --> Views
    MateriaCtrl --> Views
    DirectivoCtrl --> Views
    ProfesorCtrl --> Views
    LoginReq --> AuthRegs
    ProfileReq --> AlumnoCtrl
    Provider --> Middleware
    Provider --> Controllers
    UserModel --> DB
    CursoModel --> DB
    MateriaModel --> DB
    AsistenciaModel --> DB
    NotaModel --> DB
    ContenidoModel --> DB
    RegCodeModel --> DB
    Migrations --> DB
    Seeders --> DB
    Storage --> UserModel
    Storage --> Views
    Storage --> Logs["Logs"]:::db
    Configs --> Mail
    Configs --> Queue
    AlumnoCtrl --> Queue
    AuthRegs --> Mail
    AuthSess --> Mail
    FeatureTests --> Controllers
    FeatureTests --> Models
    UnitTests --> Models

    %% Click Events
    click CSS "https://github.com/camilo4re/reducar/blob/main/resources/css/app.css"
    click JS "https://github.com/camilo4re/reducar/blob/main/resources/js/app.js"
    click Views "https://github.com/camilo4re/reducar/tree/main/resources/views"
    click Entry "https://github.com/camilo4re/reducar/blob/main/public/index.php"
    click WebRoutes "https://github.com/camilo4re/reducar/blob/main/routes/web.php"
    click AuthRoutes "https://github.com/camilo4re/reducar/blob/main/routes/auth.php"
    click AlumnoCtrl "https://github.com/camilo4re/reducar/blob/main/app/Http/Controllers/AlumnoController.php"
    click AsistenciaCtrl "https://github.com/camilo4re/reducar/blob/main/app/Http/Controllers/AsistenciaController.php"
    click NotaCtrl "https://github.com/camilo4re/reducar/blob/main/app/Http/Controllers/NotaController.php"
    click ContenidoCtrl "https://github.com/camilo4re/reducar/blob/main/app/Http/Controllers/ContenidoController.php"
    click MateriaCtrl "https://github.com/camilo4re/reducar/blob/main/app/Http/Controllers/MateriaController.php"
    click DirectivoCtrl "https://github.com/camilo4re/reducar/blob/main/app/Http/Controllers/DirectivoController.php"
    click ProfesorCtrl "https://github.com/camilo4re/reducar/blob/main/app/Http/Controllers/ProfesorController.php"
    click AuthRegs "https://github.com/camilo4re/reducar/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
    click AuthSess "https://github.com/camilo4re/reducar/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
    click Middleware "https://github.com/camilo4re/reducar/blob/main/app/Http/Middleware/RoleMiddleware.php"
    click LoginReq "https://github.com/camilo4re/reducar/blob/main/app/Http/Requests/Auth/LoginRequest.php"
    click ProfileReq "https://github.com/camilo4re/reducar/blob/main/app/Http/Requests/ProfileUpdateRequest.php"
    click Provider "https://github.com/camilo4re/reducar/blob/main/app/Providers/AppServiceProvider.php"
    click UserModel "https://github.com/camilo4re/reducar/blob/main/app/Models/User.php"
    click CursoModel "https://github.com/camilo4re/reducar/blob/main/app/Models/Curso.php"
    click MateriaModel "https://github.com/camilo4re/reducar/blob/main/app/Models/Materia.php"
    click AsistenciaModel "https://github.com/camilo4re/reducar/blob/main/app/Models/Asistencia.php"
    click NotaModel "https://github.com/camilo4re/reducar/blob/main/app/Models/Nota.php"
    click ContenidoModel "https://github.com/camilo4re/reducar/blob/main/app/Models/Contenido.php"
    click RegCodeModel "https://github.com/camilo4re/reducar/blob/main/app/Models/RegistrationCode.php"
    click Migrations "https://github.com/camilo4re/reducar/tree/main/database/migrations"
    click Seeders "https://github.com/camilo4re/reducar/blob/main/database/seeders/DatabaseSeeder.php"
    click FeatureTests "https://github.com/camilo4re/reducar/tree/main/tests/Feature"
    click UnitTests "https://github.com/camilo4re/reducar/tree/main/tests/Unit"

    %% Styles
    classDef ui fill:#D0E6FF,stroke:#0366D6,stroke-width:1px
    classDef server fill:#FFE8CC,stroke:#E69A00,stroke-width:1px
    classDef service fill:#FFD8CC,stroke:#D04E00,stroke-width:1px
    classDef model fill:#E8FFDD,stroke:#0D9E00,stroke-width:1px
    classDef db fill:#DCEFFF,stroke:#0057B7,stroke-width:1px
    classDef external fill:#F0F0F0,stroke:#7A7A7A,stroke-width:1px
    classDef test fill:#F9D5F9,stroke:#C024B6,stroke-width:1px
```
