# jonaaxsic/gestion-estudiantil architecture

> Architecture diagram of the GitHub repository jonaaxsic/gestion-estudiantil, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jonaaxsic/gestion-estudiantil
- Repository: https://github.com/jonaaxsic/gestion-estudiantil

## Overview

1. **System shape**
   - This repo is a three-tier academic management system: an **Angular frontend**, a **Django REST-style backend**, and an **edge/API worker layer** that sits between the browser and the backend in deployment.

2. **User-facing application**
   - The `Frontend/` workspace is the primary UI. It is an Angular 19 single-page app with distinct routes for **login**, **registration**, **admin**, **docente**, and **apoderado** dashboards.
   - The page structure suggests role-based experiences rather than a single generic dashboard.

3. **Frontend application boundaries**
   - Shared UI lives under `src/app/shared/components` and is reused across pages through cards, headers, and tabs.
   - Cross-cutting client logic is centralized in `src/app/core`, especially:
     - `auth.service.ts` for session/auth state,
     - `auth.interceptor.ts` for attaching request metadata such as auth tokens,
     - `admin.guard.ts` for route protection,
     - `storage.service.ts` for persistence,
     - `theme.service.ts` for UI theming.

4. **Frontend-to-API flow**
   - The frontend uses `api.service.ts` as the main data access layer, so components talk to services rather than directly to network endpoints.
   - The interceptor/guard split indicates a clear boundary: components render state, services fetch data, and guards prevent unauthorized navigation.

5. **Backend application boundary**
   - `Backend/` is a Django application organized around a single core app (`Backend/core`), which contains the domain layer:
     - `models.py` for persisted entities,
     - `serializers.py` for API payload shaping,
     - `views.py` for request handling,
     - `urls.py` for route registration.
   - This is the typical separation for a Django API-focused backend.

6. **Backend runtime and entrypoints**
   - The backend is prepared for both WSGI and ASGI execution via `wsgi.py` and `asgi.py`, which makes it compatible with traditional hosting and async-capable deployment targets.
   - `manage.py` and `settings.py` indicate a conventional Django project structure with a dedicated settings boundary.

7. **Database integration**
   - The backend has a dedicated `database.py` module and a management command `check_mongo.py`, which strongly suggests a MongoDB-backed persistence layer rather than Django’s default relational database path.
   - The README confirms **MongoDB Atlas** as the data store, so the backend likely acts as the application/API layer over a managed MongoDB cluster.

8. **Edge/API proxy layer**
   - `api-worker/` and `Frontend/functions/api.ts` indicate an edge function or worker-based proxy in front of the backend API.
   - In deployment, this likely handles API routing, origin abstraction, or platform-specific request forwarding between Cloudflare-hosted frontend assets and the Django backend.

9. **Deployment topology**
   - The repo contains Cloudflare and Render configuration: `Frontend/wrangler.toml`, `api-worker/wrangler.*`, `render.yaml`, and a `docker-compose.yml`.
   - The README describes the deployment split as **Cloudflare Pages** for the frontend and **Cloudflare Workers → Render** for the API/backend path.

10. **Domain features reflected in the UI**
   - The application is centered on institutional workflows: **attendance**, **evaluations**, **annotations**, **meetings**, and **role-based access** for **admin**, **docente**, and **apoderado**.
   - This implies the main domain data flows are CRUD-heavy and role-scoped rather than public content flows.

11. **Operational and maintenance concerns**
   - `.github/workflows/keep-alive.yml` suggests an operational concern for keeping a deployed service awake or reachable.
   - The presence of environment templates and multiple platform configs shows the project is designed for multi-environment deployment rather than a single-host monolith.

12. **How to draw the architecture**
   - A clean diagram would show: **end user → Angular SPA → auth/API service layer → Cloudflare Worker/API proxy → Django backend → MongoDB Atlas**.
   - Around that, show role-based UI routes on the frontend and Django core modules on the backend as the main internal boundaries.

Main entry points: [`Frontend/src/app/app.routes.ts`](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/app.routes.ts) (App routes), [`Backend/core/apps.py`](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/apps.py) (Core app), [`api-worker/worker.js`](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/api-worker/worker.js) (API worker), [`Frontend/src/app/shared/components/shared-card.component.ts`](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/shared/components/shared-card.component.ts) (Shared UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular SPA"]
  node_frontend_app["Angular app<br/>spa<br/>[app.ts]"]
  node_frontend_routes["App routes<br/>routing<br/>[app.routes.ts]"]
  node_login_page["Login<br/>page<br/>[login.page.ts]"]
  node_registro_page["Registro<br/>page<br/>[registro.page.ts]"]
  node_admin_page["Admin<br/>page<br/>[admin.page.ts]"]
  node_docente_page["Docente<br/>page"]
  node_apoderado_page["Apoderado<br/>page"]
  node_shared_ui["Shared UI<br/>component kit"]
  node_auth_service["Auth service<br/>client auth<br/>[auth.service.ts]"]
  node_api_service["API service<br/>client data<br/>[api.service.ts]"]
  node_auth_interceptor["Auth interceptor<br/>http interceptor"]
  node_admin_guard["Admin guard<br/>route guard<br/>[admin.guard.ts]"]
end

subgraph group_edge["Edge/API"]
  node_edge_worker["API worker<br/>worker proxy<br/>[worker.js]"]
  node_worker_entry["Worker entry<br/>[index.js]"]
end

subgraph group_backend["Django API"]
  node_django_entry["Django entry<br/>backend entry<br/>[manage.py]"]
  node_core_domain["Core app<br/>django app<br/>[apps.py]"]
  node_domain_models["Models<br/>domain model<br/>[models.py]"]
  node_domain_serializers["Serializers<br/>api schema<br/>[serializers.py]"]
  node_domain_views["Views<br/>api handlers<br/>[views.py]"]
  node_domain_urls["URLs<br/>routing<br/>[urls.py]"]
  node_mongo_db[("MongoDB<br/>datastore<br/>[database.py]")]
end

subgraph group_infra["Deployment"]
  node_deploy_cloudflare["Cloudflare<br/>platform config<br/>[wrangler.toml]"]
  node_deploy_render["Render<br/>platform config<br/>[render.yaml]"]
  node_compose["Compose<br/>devops<br/>[docker-compose.yml]"]
end

node_user(("Users<br/>actor"))

node_user -->|"uses"| node_frontend_app
node_frontend_app -->|"navigates"| node_frontend_routes
node_frontend_routes -->|"maps"| node_login_page
node_frontend_routes -->|"maps"| node_registro_page
node_frontend_routes -->|"maps"| node_admin_page
node_frontend_routes -->|"maps"| node_docente_page
node_frontend_routes -->|"maps"| node_apoderado_page
node_login_page -->|"reuses"| node_shared_ui
node_registro_page -->|"reuses"| node_shared_ui
node_admin_page -->|"reuses"| node_shared_ui
node_docente_page -->|"reuses"| node_shared_ui
node_apoderado_page -->|"reuses"| node_shared_ui
node_login_page -->|"authenticates"| node_auth_service
node_frontend_app -->|"fetches"| node_api_service
node_api_service -->|"passes through"| node_auth_interceptor
node_admin_page -->|"protected by"| node_admin_guard
node_api_service -->|"calls"| node_edge_worker
node_edge_worker -->|"bootstraps"| node_worker_entry
node_edge_worker -->|"forwards to"| node_django_entry
node_django_entry -->|"loads"| node_core_domain
node_core_domain -->|"contains"| node_domain_models
node_core_domain -->|"contains"| node_domain_serializers
node_core_domain -->|"contains"| node_domain_views
node_core_domain -->|"contains"| node_domain_urls
node_domain_views -->|"reads/writes"| node_mongo_db
node_domain_serializers -->|"shapes"| node_domain_views
node_domain_urls -->|"routes to"| node_domain_views
node_deploy_cloudflare -.->|"deploys"| node_edge_worker
node_deploy_render -.->|"deploys"| node_django_entry
node_compose -.->|"orchestrates"| node_edge_worker
node_compose -.->|"orchestrates"| node_django_entry

click node_frontend_app "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/app.ts"
click node_frontend_routes "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/app.routes.ts"
click node_login_page "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/login/login.page.ts"
click node_registro_page "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/registro/registro.page.ts"
click node_admin_page "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/admin/admin.page.ts"
click node_docente_page "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/dashboard-docente/dashboard-docente.page.ts"
click node_apoderado_page "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/dashboard-apoderado/dashboard-apoderado.page.ts"
click node_shared_ui "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/shared/components/shared-card.component.ts"
click node_auth_service "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/core/services/auth.service.ts"
click node_api_service "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/core/services/api.service.ts"
click node_auth_interceptor "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/core/interceptors/auth.interceptor.ts"
click node_admin_guard "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/core/guards/admin.guard.ts"
click node_edge_worker "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/api-worker/worker.js"
click node_worker_entry "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/api-worker/index.js"
click node_django_entry "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/manage.py"
click node_core_domain "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/apps.py"
click node_domain_models "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/models.py"
click node_domain_serializers "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/serializers.py"
click node_domain_views "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/views.py"
click node_domain_urls "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/urls.py"
click node_mongo_db "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/database.py"
click node_deploy_cloudflare "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/wrangler.toml"
click node_deploy_render "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/render.yaml"
click node_compose "https://github.com/jonaaxsic/gestion-estudiantil/blob/main/docker-compose.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend_app,node_frontend_routes,node_login_page,node_registro_page,node_admin_page,node_docente_page,node_apoderado_page,node_shared_ui,node_auth_service,node_api_service,node_auth_interceptor,node_admin_guard toneBlue
class node_edge_worker,node_worker_entry toneAmber
class node_django_entry,node_core_domain,node_domain_models,node_domain_serializers,node_domain_views,node_domain_urls,node_mongo_db toneMint
class node_deploy_cloudflare,node_deploy_render,node_compose toneRose
class node_user toneNeutral
```

## Components

### Angular SPA

Browser application with role-based routes and shared client services.

- [Angular app](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/app.ts): spa · Primary single-page application shell and route host. · `Frontend/src/app/app.ts`
- [App routes](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/app.routes.ts): routing · Route definitions for login, registration, and role dashboards. · `Frontend/src/app/app.routes.ts`
- [Login](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/login/login.page.ts): page · Authentication entry screen. · `Frontend/src/app/pages/login/login.page.ts`
- [Registro](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/registro/registro.page.ts): page · User registration flow. · `Frontend/src/app/pages/registro/registro.page.ts`
- [Admin](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/admin/admin.page.ts): page · Administrative dashboard for management workflows. · `Frontend/src/app/pages/admin/admin.page.ts`
- [Docente](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/dashboard-docente/dashboard-docente.page.ts): page · Teacher dashboard and classroom workflows. · `Frontend/src/app/pages/dashboard-docente/dashboard-docente.page.ts`
- [Apoderado](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/pages/dashboard-apoderado/dashboard-apoderado.page.ts): page · Guardian dashboard and student-followup workflows. · `Frontend/src/app/pages/dashboard-apoderado/dashboard-apoderado.page.ts`
- [Shared UI](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/shared/components/shared-card.component.ts): component kit · Reusable cards, headers, and tabs used across pages. · `Frontend/src/app/shared/components/shared-card.component.ts`
- [Auth service](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/core/services/auth.service.ts): client auth · Session state and login/logout logic. · `Frontend/src/app/core/services/auth.service.ts`
- [API service](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/core/services/api.service.ts): client data · Main frontend data access layer. · `Frontend/src/app/core/services/api.service.ts`
- [Auth interceptor](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/core/interceptors/auth.interceptor.ts): http interceptor · Attaches auth metadata to outgoing requests. · `Frontend/src/app/core/interceptors/auth.interceptor.ts`
- [Admin guard](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/src/app/core/guards/admin.guard.ts): route guard · Protects restricted client routes. · `Frontend/src/app/core/guards/admin.guard.ts`

### Edge/API

Worker layer that proxies API traffic between frontend and backend.

- [API worker](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/api-worker/worker.js): worker proxy · Edge layer that forwards or routes API requests. · `api-worker/worker.js`
- [Worker entry](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/api-worker/index.js): worker entry · Worker bootstrap for deployment runtime. · `api-worker/index.js`

### Django API

Core backend application, domain logic, and MongoDB integration.

- [Django entry](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/manage.py): backend entry · ASGI/WSGI and management entrypoints for the backend. · `Backend/manage.py`
- [Core app](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/apps.py): django app · Main backend application package. · `Backend/core/apps.py`
- [Models](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/models.py): domain model · Persisted entities for academic workflows. · `Backend/core/models.py`
- [Serializers](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/serializers.py): api schema · Shapes backend payloads for the API. · `Backend/core/serializers.py`
- [Views](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/views.py): api handlers · HTTP request handling and orchestration. · `Backend/core/views.py`
- [URLs](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/urls.py): routing · Backend route registration. · `Backend/core/urls.py`
- [MongoDB](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Backend/core/database.py): datastore · Atlas-backed persistence layer used by the backend. · `Backend/core/database.py`

### Deployment

Platform and operational configuration across environments.

- [Cloudflare](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/Frontend/wrangler.toml): platform config · Frontend and worker deployment configuration. · `Frontend/wrangler.toml`
- [Render](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/render.yaml): platform config · Backend deployment configuration. · `render.yaml`
- [Compose](https://github.com/jonaaxsic/gestion-estudiantil/blob/main/docker-compose.yml): devops · Local multi-service orchestration. · `docker-compose.yml`

### Other components

- **Users**: actor · Students, staff, and guardians using the system.

## Connections

- Users → Angular app: uses · Users access the Angular application.
- Angular app → App routes: navigates · The app shell loads route-based pages.
- App routes → Login: maps · Route to login screen.
- App routes → Registro: maps · Route to registration screen.
- App routes → Admin: maps · Route to admin dashboard.
- App routes → Docente: maps · Route to teacher dashboard.
- App routes → Apoderado: maps · Route to guardian dashboard.
- Login → Shared UI: reuses · Pages share common presentation components.
- Registro → Shared UI: reuses · Pages share common presentation components.
- Admin → Shared UI: reuses · Pages share common presentation components.
- Docente → Shared UI: reuses · Pages share common presentation components.
- Apoderado → Shared UI: reuses · Pages share common presentation components.
- Login → Auth service: authenticates · Login flow delegates session logic to auth service.
- Angular app → API service: fetches · Application features load data through the API service.
- API service → Auth interceptor: passes through · Outgoing requests are decorated by the interceptor.
- Admin → Admin guard: protected by · Restricted navigation is guarded on the client.
- API service → API worker: calls · Frontend API traffic is routed through the worker layer.
- API worker → Worker entry: bootstraps · Worker runtime entry starts the proxy logic.
- API worker → Django entry: forwards to · Proxy layer forwards requests to the backend API.
- Django entry → Core app: loads · Backend entrypoint initializes the Django app.
- Core app → Models: contains · Domain package defines persisted entities.
- Core app → Serializers: contains · Domain package defines payload shaping.
- Core app → Views: contains · Domain package handles HTTP requests.
- Core app → URLs: contains · Domain package registers routes.
- Views → MongoDB: reads/writes · Backend persists and retrieves academic data from MongoDB.
- Serializers → Views: shapes · Serializers support request and response handling.
- URLs → Views: routes to · URLs dispatch to API handlers.
- Cloudflare → API worker: deploys · Cloudflare configuration hosts the frontend and worker.
- Render → Django entry: deploys · Render configuration hosts the Django backend.
- Compose → API worker: orchestrates · Local compose setup can include the proxy path.
- Compose → Django entry: orchestrates · Local compose setup can include the backend service.
