# teo-information/sistema-de-gesti-n-educativa architecture

> Architecture diagram of the GitHub repository teo-information/sistema-de-gesti-n-educativa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/teo-information/sistema-de-gesti-n-educativa
- Repository: https://github.com/teo-information/sistema-de-gesti-n-educativa

## Overview

##### Project type and purpose
- This is a full-stack web application built with Django (an MVC/MVT framework).
- Purpose: manage students, courses, enrollments (matrículas) and grades (notas) in an educational institution.

##### Files and folder analysis
- Top-level Django project:
- `sistema_educativo/` – core settings, URLs, ASGI/WGSI entry points
- `manage.py` – Django CLI
- Django apps (each represents a bounded context):
- `estudiantes/` – student CRUD logic
- `cursos/` – course CRUD logic
- `matriculas/` – enrollment workflows
- `notas/` – grade tracking
- Templates and static assets:
- `templates/` – HTML views (per-app subfolders + base layout + auth)
- `static/` – CSS/JS (Bootstrap, custom)
- Deployment/configuration:
- `Dockerfile`, `docker-compose.yml`, `Procfile` (Heroku), `render.yaml` (Render.com)
- `requirements.txt`, `build.sh` for build steps

##### Key architectural patterns and technologies
- Django MVT: Models (in `models.py`) ↔ Views (in `views.py`) ↔ Templates (HTML)
- Central URL dispatcher (`sistema_educativo/urls.py`)
- Django ORM and relational database service (likely PostgreSQL defined in Docker Compose)
- Static file handling via Django’s staticfiles + Bootstrap 5 + Crispy Forms
- Authentication (login) via Django’s contrib auth + custom registration template
- Containerization (Docker), cloud deployment (Heroku/Render)

##### Main components
a. Client Browser
– Sends HTTP(S) requests (HTML, JSON)
– Renders HTML/CSS/JS (Bootstrap, custom JS)
b. Web Server / Application Layer
– Django application inside Docker container
– URL router → App Views → Templates or JSON
– Uses Django Crispy Forms for form rendering
c. Business Logic Modules (Django apps)
– estudiantes, cursos, matriculas, notas
– Each module: Models, Forms, Views, URLs, Templates
d. Database Layer
– Managed by Django ORM
– Postgres or SQLite (per `docker-compose.yml`)
e. Admin Interface
– Django Admin site for superusers
f. Deployment Infrastructure
– Docker Engine, Docker Compose
– Cloud Runner (Heroku/Render)

##### Component relationships and data flow
- Browser → (HTTP) → Load Balancer / Proxy (if any) → Docker container running Django
- Django URL Router → App-specific View → Query/Update DB via ORM → Render Template or Redirect → Response
- Static file requests → Served from Django staticfiles or CDN
- Admin user flows: same path but with `/admin/` URL
- CI/CD builds via `build.sh` → Docker image → Push to cloud

##### Architectural patterns and design principles
- Separation of concerns: MVT layers, modular apps
- Single responsibility per Django app (students, courses, enrollments, grades)
- Configuration-as-code: Dockerfiles, Compose, Procfile, Render manifests
- Reusability/DRY: shared base templates, Crispy Forms, common static assets

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer" 
        Browser["Client Browser"]:::frontend
        Templates["Templates (HTML)"]:::frontend
        StaticCSS["static/css/style.css"]:::frontend
        StaticJS["static/js/main.js"]:::frontend
    end

    %% Application Layer
    subgraph "Application Layer (Docker - Django 4.x)"
        subgraph "Django Core"
            Settings["settings.py"]:::application
            URLs["urls.py"]:::application
            ASGI["asgi.py"]:::application
            WSGI["wsgi.py"]:::application
            Manage["manage.py"]:::application
        end
        subgraph "URL Router"
            Router["Django URL Router"]:::application
        end
        subgraph "Django Apps"
            Estudiantes["estudiantes app"]:::application
            Cursos["cursos app"]:::application
            Matriculas["matriculas app"]:::application
            Notas["notas app"]:::application
        end
        Admin["Django Admin Interface"]:::application
    end

    %% Data Layer
    subgraph "Data Layer"
        DB["PostgreSQL Database"]:::data
    end

    %% Infrastructure Layer
    subgraph "Deployment Infrastructure"
        Docker["Docker & Docker Compose"]:::infra
        Proc["Procfile"]:::infra
        Render["render.yaml"]:::infra
        Build["build.sh"]:::infra
        Req["requirements.txt"]:::infra
    end

    %% Connections
    Browser -->|HTTP GET/POST| Router
    Browser -->|loads| Templates
    Browser -->|loads| StaticCSS
    Browser -->|loads| StaticJS

    Router -->|"calls view"| Estudiantes
    Router -->|"calls view"| Cursos
    Router -->|"calls view"| Matriculas
    Router -->|"calls view"| Notas
    Router -->|"admin path /admin/"| Admin

    Estudiantes -->|"ORM queries"| DB
    Cursos -->|"ORM queries"| DB
    Matriculas -->|"ORM queries"| DB
    Notas -->|"ORM queries"| DB
    Admin -->|"ORM queries"| DB

    Estudiantes -->|renders| Browser
    Cursos -->|renders| Browser
    Matriculas -->|renders| Browser
    Notas -->|renders| Browser
    Admin -->|renders| Browser

    Docker -->|runs| Router
    Docker -->|manages| DB
    Build -->|build image| Docker
    Req -->|defines deps| Docker
    Proc -->|deploy config| Docker
    Render -->|deploy config| Docker

    %% Click Events
    click Templates "https://github.com/teo-information/sistema-de-gesti-n-educativa/tree/master/templates/"
    click StaticCSS "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/static/css/style.css"
    click StaticJS "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/static/js/main.js"

    click Settings "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/sistema_educitivo/settings.py"
    click URLs "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/sistema_educativo/urls.py"
    click ASGI "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/sistema_educativo/asgi.py"
    click WSGI "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/sistema_educativo/wsgi.py"
    click Manage "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/manage.py"

    click Router "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/sistema_educativo/urls.py"

    click Estudiantes "https://github.com/teo-information/sistema-de-gesti-n-educativa/tree/master/estudiantes/"
    click Cursos "https://github.com/teo-information/sistema-de-gesti-n-educativa/tree/master/cursos/"
    click Matriculas "https://github.com/teo-information/sistema-de-gesti-n-educativa/tree/master/matriculas/"
    click Notas "https://github.com/teo-information/sistema-de-gesti-n-educativa/tree/master/notas/"

    click Admin "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/templates/registration/login.html"

    click DB "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/docker-compose.yml"

    click Docker "https://github.com/teo-information/sistema-de-gesti-n-educativa/tree/master/Dockerfile"
    click Proc "https://github.com/teo-information/sistema-de-gesti-n-educativa/tree/master/Procfile"
    click Render "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/render.yaml"
    click Build "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/build.sh"
    click Req "https://github.com/teo-information/sistema-de-gesti-n-educativa/blob/master/requirements.txt"

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#333,stroke-width:1px
    classDef application fill:#DFFFE0,stroke:#333,stroke-width:1px
    classDef data fill:#FFE8B2,stroke:#333,stroke-width:1px
    classDef infra fill:#DDDDDD,stroke:#333,stroke-width:1px
```
