# danielleiva1/tareasitu architecture

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

- Interactive diagram: https://gitdiagram.com/danielleiva1/tareasitu
- Repository: https://github.com/danielleiva1/tareasitu

## Overview

##### Project type and purpose
- This is a full-stack web application built on the Django framework.
- It serves HTML pages (templates) with dynamic data stored in a SQLite database, packaged via Docker.

##### File structure
- Top level
- Dockerfile – builds a container image for the app
- manage.py – Django’s command-line utility
- requirements.txt – Python dependencies
- sonar-project.properties – code-analysis configuration
- db.sqlite3 – the embedded database file
- ProyectoSITU/ProyectoSITU
- settings.py, urls.py, wsgi.py, asgi.py – Django project configuration & entrypoints
- ProyectoSITU/appSITUweb
- models.py – data schema
- views.py, forms.py – request handling and form definitions
- admin.py – Django admin integration
- migrations/ – database schema history
- tests.py, test_models.py – unit tests
- templates/ – Jinja-style HTML templates (base.html, index.html, etc.)
- templates/static – CSS and other static assets

##### README
- The README only includes a title (“TareaSitu”), so all architectural insight comes from the structure above.

##### Main components and interactions
a. Components
1. Client (Browser)
2. Docker container
- Nginx (optional reverse-proxy) or direct Gunicorn/ASGI server
- Django application
3. Django subsystems
- URL Dispatcher (urls.py)
- View layer (views.py, forms.py)
- Model layer (models.py + migrations)
- Template Engine (templates/)
4. Database (SQLite – db.sqlite3)
5. Static files server (templates/static)
6. CI/Code analysis (SonarQube via sonar-project.properties)
b. Relationships & data flow
- Browser → HTTP request → (Nginx/gunicorn) → Django URL dispatcher
- URL dispatcher → appropriate view → may use forms for input validation
- View → ORM → SQLite database → returns QuerySet or object
- View → Template Engine → HTML response → Browser
- Static assets requested → static file handler
- Tests & migrations are developer operations, invoked via manage.py
c. Architectural patterns
- Monolithic MVC (Model-View-Template) layered structure within Django
- Containerized deployment with Dockerfile
- Optional code-quality gate via SonarQube
d. Key technologies
- Python 3.x, Django
- SQLite (development) – could be swapped for Postgres in production
- Docker
- (Optional) Gunicorn or Uvicorn for ASGI
- HTML/CSS templates

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser"]:::external

    subgraph "Docker Container"
        server["Nginx/Gunicorn/ASGI"]:::server

        Dockerfile["Dockerfile"]:::file
        managePy["manage.py"]:::file
        requirements["requirements.txt"]:::file
        sonar["sonar-project.properties"]:::file

        subgraph "Django App"
            settings["settings.py"]:::config
            urls["urls.py"]:::config
            wsgi["wsgi.py"]:::config
            asgi["asgi.py"]:::config

            models["models.py"]:::component
            migrations["migrations/"]:::folder
            views["views.py"]:::component
            forms["forms.py"]:::component
            adminpy["admin.py"]:::component
            apps["apps.py"]:::component
            tests["tests.py"]:::test
            testModels["test_models.py"]:::test

            templateEngine["Template Engine"]:::component
        end

        subgraph "Templates & Static"
            base["base.html"]:::template
            index["index.html"]:::template
            pasajeros["pasajeros.html"]:::template
            pasajerosEdit["pasajerosEdit.html"]:::template
            css["login.css"]:::staticfile
        end

        db["SQLite DB (db.sqlite3)"]:::database
        img["img/"]:::folder
    end

    Browser -->|"HTTP Request"| server
    server -->|"WSGI/ASGI"| urls
    urls -->|"dispatch"| views
    views -->|"validate"| forms
    views -->|"query"| models
    models -->|"read/write"| db
    views -->|"render"| templateEngine
    templateEngine -->|"load templates"| base
    templateEngine -->|"load templates"| index
    templateEngine -->|"load templates"| pasajeros
    templateEngine -->|"load templates"| pasajerosEdit
    templateEngine -->|"serve static"| css
    templateEngine -->|"response"| Browser
    Browser -->|"GET static"| css

    managePy -->|"migrate/tests"| migrations
    managePy -->|"run tests"| tests
    managePy -->|"run tests"| testModels
    sonar -->|"analyze code"| managePy

    classDef external fill:#f9f,stroke:#333,stroke-width:2px
    classDef container fill:#eef,stroke:#333,stroke-width:2px
    classDef server fill:#cfc,stroke:#393,stroke-width:2px
    classDef config fill:#ffc,stroke:#993,stroke-width:2px
    classDef component fill:#ccf,stroke:#339,stroke-width:2px
    classDef database fill:#fcf,stroke:#933,stroke-width:2px
    classDef template fill:#cff,stroke:#393,stroke-width:2px
    classDef staticfile fill:#cff,stroke:#393,stroke-width:2px
    classDef folder fill:#ddd,stroke:#666,stroke-width:1px,stroke-dasharray: 5 5
    classDef file fill:#ffd,stroke:#aa3,stroke-width:1px
    classDef test fill:#fdd,stroke:#d33,stroke-width:2px

    click Dockerfile "https://github.com/danielleiva1/tareasitu/tree/main/ProyectoSITU/Dockerfile"
    click managePy "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/manage.py"
    click requirements "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/requirements.txt"
    click sonar "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/sonar-project.properties"
    click settings "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/ProyectoSITU/settings.py"
    click urls "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/ProyectoSITU/urls.py"
    click wsgi "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/ProyectoSITU/wsgi.py"
    click asgi "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/ProyectoSITU/asgi.py"
    click models "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/appSITUweb/models.py"
    click migrations "https://github.com/danielleiva1/tareasitu/tree/main/ProyectoSITU/appSITUweb/migrations/"
    click views "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/appSITUweb/views.py"
    click forms "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/appSITUweb/forms.py"
    click adminpy "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/appSITUweb/admin.py"
    click apps "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/appSITUweb/apps.py"
    click tests "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/appSITUweb/tests.py"
    click testModels "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/appSITUweb/test_models.py"
    click base "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/templates/base.html"
    click index "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/templates/index.html"
    click pasajeros "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/templates/pasajeros.html"
    click pasajerosEdit "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/templates/pasajerosEdit.html"
    click css "https://github.com/danielleiva1/tareasitu/blob/main/ProyectoSITU/templates/static/login.css"
    click img "https://github.com/danielleiva1/tareasitu/tree/main/ProyectoSITU/img/"
```
