# julioherrera15/ipc2_proyecto3_202300850 architecture

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

- Interactive diagram: https://gitdiagram.com/julioherrera15/ipc2_proyecto3_202300850
- Repository: https://github.com/julioherrera15/ipc2_proyecto3_202300850

## Overview

##### Project Type and Purpose
- This is a monolithic, server‐rendered web application built with Django (Python).
- The top‐level “Proyecto3” folder contains the Django project settings, URLs, ASGI/WSGI entry points, and the SQLite database.
- The “app” folder is a single Django application module: it holds models, views, URLs, templates, migrations, forms, and a file‐based session store.

##### File Structure and Architectural Patterns
- Top‐Level
- manage.py – CLI entry for migrations, dev server, etc.
- Proyecto3/ – Django project settings & routers:
– settings.py, urls.py, asgi.py, wsgi.py
- db.sqlite3 – SQLite persistent store
- app/
- models.py – ORM definitions → maps to SQLite
- views.py & urls.py – Controller layer (Django’s MTV)
- templates/ – Jinja2/Markup views for client
- forms.py – Request‐validation layer
- migrations/ – Schema evolution
- flask_session/ – File‐based session store (configured in settings.py)
- Testing & Admin
- tests.py, admin.py

##### Key Components
a. Client Browser
– Sends HTTP(S) requests; receives HTML responses.
b. Web Server / Application Server
– ASGI or WSGI server (e.g., Daphne, Gunicorn) hosting the Django app.
c. Django Framework
– URL Dispatcher (Proyecto3/urls.py + app/urls.py)
– Middleware (session engine)
– Views (app/views.py)
– Forms & Validation (app/forms.py)
– Template Engine (app/templates)
– ORM & Models (app/models.py)
d. Data Stores
– SQLite Database (db.sqlite3)
– File‐based Session Store (app/flask_session/)
e. Management & Maintenance
– manage.py for running migrations & dev server
– Migrations subsystem (app/migrations/)

##### Component Relationships & Data Flows
- Browser → HTTP Request → ASGI/WSGI Server
- Server → Django URL Resolver → Matching app URL
- URL → View Function →
- If form data: pass through forms.py for validation
- Business logic in views → models via ORM
- Read/write session data in flask_session folder
- Query/update SQLite via Django ORM
- View → Render Template → HTML Response → Browser

##### Architectural Patterns & Design Principles
- Monolithic MVC (MTV in Django terms)
- Single codebase; shared database & session store
- Server‐side rendering; minimal client‐side logic
- File‐based sessions for stateful interactions

##### Technologies & Frameworks to Annotate
- Python 3 + Django
- ASGI/WSGI server (Daphne/Gunicorn)
- SQLite (built‐in)
- Django Template Language (DTL)
- Django ORM & Migrations
- File‐based Session Backend

##### Elements
- From Browser → ASGI/WSGI → URL Dispatcher → View → ORM → DB
- From View → Template Engine → Browser

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        Browser["Client Browser"] 
    end

    %% Application Layer
    subgraph "Application Layer"
        ASGI["ASGI Entry Point"]:::app
        WSGI["WSGI Entry Point"]:::app
        URLProject["Project Settings & URL Dispatcher"]:::app
        URLApp["App URL Dispatcher (app/urls.py)"]:::app
        AppConfig["Django App Configuration (app/apps.py)"]:::app
        Views["Controller Layer (app/views.py)"]:::app
        Forms["Request Validation & Forms (app/forms.py)"]:::app
        Templates["Template Engine (app/templates/)"]:::app
        ORM["ORM & Models (app/models.py)"]:::app
        Migrations["Schema Migrations (app/migrations/)"]:::app
        Sessions["Session Store (app/flask_session/)"]:::app
        Admin["Admin Interface (app/admin.py)"]:::app
        Tests["Automated Tests (app/tests.py)"]:::app
        Manage["Command-Line Management (manage.py)"]:::app
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        DB["SQLite Database (db.sqlite3)"]:::datastore
    end

    %% Request/Response Flow
    Browser -->|"HTTPS Request"| ASGI
    Browser -->|"HTTPS Request"| WSGI
    ASGI -->|"routes through"| URLProject
    WSGI -->|"routes through"| URLProject
    URLProject -->|"matches URL"| URLApp
    URLApp -->|"invokes"| Views
    Views -->|"validate"| Forms
    Views -->|"access ORM"| ORM
    Views -->|"use session store"| Sessions
    Views -->|"render"| Templates
    Templates -->|"HTML Response"| Browser
    ORM -->|"read/write"| DB

    %% Management & Migrations Flow
    Manage -->|"runs migrations"| Migrations
    Manage -->|"runs dev server"| ASGI
    Manage -->|"runs dev server"| WSGI

    %% Class Definitions
    classDef request stroke:blue, color:blue;
    classDef app fill:#fddc99,stroke:orange;
    classDef datastore fill:#cdf3cd,stroke:green;

    %% Apply classes
    class Browser,ASGI,WSGI,URLProject,URLApp,Views,Forms,Templates,ORM,Migrations,Sessions,Admin,Tests,Manage request;
    class DB datastore;

    %% Click Events
    click URLProject "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/Proyecto3/settings.py"
    click URLProject "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/Proyecto3/urls.py"
    click ASGI "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/Proyecto3/asgi.py"
    click WSGI "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/Proyecto3/wsgi.py"
    click Manage "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/manage.py"
    click AppConfig "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/app/apps.py"
    click ORM "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/app/models.py"
    click Migrations "https://github.com/julioherrera15/ipc2_proyecto3_202300850/tree/main/app/migrations/"
    click Views "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/app/views.py"
    click URLApp "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/app/urls.py"
    click Forms "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/app/forms.py"
    click Templates "https://github.com/julioherrera15/ipc2_proyecto3_202300850/tree/main/app/templates/"
    click Admin "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/app/admin.py"
    click Sessions "https://github.com/julioherrera15/ipc2_proyecto3_202300850/tree/main/app/flask_session/"
    click DB "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/db.sqlite3"
    click Tests "https://github.com/julioherrera15/ipc2_proyecto3_202300850/blob/main/app/tests.py"
```
