# dcc-cc4401/2024-1-cc4401-1-grupo-6 architecture

> Architecture diagram of the GitHub repository dcc-cc4401/2024-1-cc4401-1-grupo-6, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dcc-cc4401/2024-1-cc4401-1-grupo-6
- Repository: https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6

## Overview

##### Main Components Identification
- Django Project Core: The folder "aprende_beauchef/aprende_beauchef" contains core configuration files such as settings.py, asgi.py, urls.py, and wsgi.py. These files manage global settings, URL routing, and server interfaces.
- Django App ("baseapp"): This is where the core business logic exists. It has model definitions (models.py), views (views.py), forms (forms.py), an admin interface (admin.py), migrations (for database schema evolution), and tests.
- Frontend Resources: Inside "baseapp/static" you have separation into CSS, JavaScript, images, and HTML templates (located in "static/templates"). These provide the user interface and client-side functionality.
- Database: The project utilizes an SQLite database (db.sqlite3) configured via Django settings and updated with migration files.
- Testing: The tests directory and test files in "baseapp/tests" support model testing to verify backend functionality.

##### Relationships and Interactions
- Client/Browser: Users interact with the application via a web browser. They request pages that are rendered through templates.
- Django View Layer: Incoming HTTP requests are routed via the main URLs (from “aprende_beauchef/aprende_beauchef/urls.py” and “baseapp/urls.py”) to specific view functions in "baseapp/views.py". These views handle the business logic.
- Templates and Static Files: The views render responses using HTML templates and augment them with CSS and JavaScript assets. This ensures the user interface is dynamic and responsive.
- Data Persistence: Models in "baseapp/models.py" represent entities (tutors, students, tutoring sessions, etc.) and interact with the SQLite database via Django’s ORM, supported by migrations.
- Admin and Management: The Django admin interface (configured in "baseapp/admin.py") allows administrative operations including managing users and data entries.
- Tests: The test files ensure that the models and other backend functionalities behave as expected.

##### Architectural Patterns
- MVC/MVT Pattern: Django follows the Model-View-Template (MVT) architecture. The models handle data and business rules, views process requests and business logic, while templates manage the presentation layer.
- Separation of Concerns: There is a clear division between configuration (settings), business logic (models and views), and presentation (templates and static assets).

##### Relevant Technologies and Libraries
- Django 5.0.4 is the framework used for building the application.
- SQLite is the database solution for data persistence.
- Standard web technologies (HTML, CSS, JavaScript) are used for the frontend.
- The project might utilize Django’s default packages for authentication, session management, and the admin panel.

##### Elements
- Clear labels for each component (e.g., “Django Settings”, “URL Router”, “Views”, “Models/ORM”, “Database (SQLite)”, “Static Assets”, “Templates”, “Admin Panel”).
- From Client/Browser → URL router → Views.
- From Views → Models (for CRUD operations) and vice versa.
- From Views → Templates → Client/Browser (rendering output).
- From Django framework to the Database.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        Browser("Client/Browser"):::client
    end

    %% Django Project Core
    subgraph "Django Project Core"
        Settings("Django Settings"):::core
        URLCore("URL Routing (aprende_beauchef/aprende_beauchef/urls.py)"):::core
        ASGI("ASGI Interface (aprende_beauchef/aprende_beauchef/asgi.py)"):::core
        WSGI("WSGI Interface (aprende_beauchef/aprende_beauchef/wsgi.py)"):::core
    end

    %% Django Base App
    subgraph "Django Base App"
        URLApp("App URL Routing (aprende_beauchef/baseapp/urls.py)"):::core
        Views("Django Views (aprende_beauchef/baseapp/views.py)"):::backend
        Forms("Forms (aprende_beauchef/baseapp/forms.py)"):::backend
        Models("Models (aprende_beauchef/baseapp/models.py)"):::backend
        Admin("Admin Panel (aprende_beauchef/baseapp/admin.py)"):::backend
        Tests("Testing (aprende_beauchef/baseapp/tests)"):::backend
    end

    %% Frontend Resources
    subgraph "Frontend Resources"
        Templates("HTML Templates (aprende_beauchef/baseapp/static/templates)"):::frontend
        CSS("CSS (aprende_beauchef/baseapp/static/css)"):::frontend
        JS("JavaScript (aprende_beauchef/baseapp/static/js)"):::frontend
        Images("Images (aprende_beauchef/baseapp/static/images)"):::frontend
    end

    %% Data Persistence Layer
    subgraph "Data Persistence"
        DB("SQLite Database (aprende_beauchef/db.sqlite3)"):::database
    end

    %% Connections
    Browser -->|"HTTP_request"| URLCore
    Settings -->|"configures"| URLCore
    ASGI -->|"interfaces"| URLCore
    WSGI -->|"interfaces"| URLCore
    URLCore -->|"routes_to"| URLApp
    URLApp -->|"calls"| Views
    Views -->|"processes"| Forms
    Views -->|"interacts_with"| Models
    Models -->|"CRUD"| DB
    Views -->|"renders"| Templates
    Templates -->|"includes"| CSS
    Templates -->|"includes"| JS
    Templates -->|"includes"| Images
    Templates -->|"rendered_page"| Browser
    Admin -->|"manages"| Models
    Admin -->|"updates"| DB
    Tests -->|"verifies"| Models
    Tests -->|"tests"| Views

    %% Click Events
    click Settings "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/aprende_beauchef/settings.py"
    click URLCore "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/aprende_beauchef/urls.py"
    click ASGI "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/aprende_beauchef/asgi.py"
    click WSGI "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/aprende_beauchef/wsgi.py"
    click URLApp "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/baseapp/urls.py"
    click Views "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/baseapp/views.py"
    click Forms "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/baseapp/forms.py"
    click Models "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/baseapp/models.py"
    click Admin "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/baseapp/admin.py"
    click Tests "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/tree/develop/aprende_beauchef/baseapp/tests"
    click Templates "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/tree/develop/aprende_beauchef/baseapp/static/templates"
    click CSS "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/tree/develop/aprende_beauchef/baseapp/static/css"
    click JS "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/tree/develop/aprende_beauchef/baseapp/static/js"
    click Images "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/tree/develop/aprende_beauchef/baseapp/static/images"
    click DB "https://github.com/dcc-cc4401/2024-1-cc4401-1-grupo-6/blob/develop/aprende_beauchef/db.sqlite3"

    %% Styles
    classDef client fill:#ffe0b2,stroke:#bf360c,stroke-width:2px;
    classDef core fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef backend fill:#ffcdd2,stroke:#b71c1c,stroke-width:2px;
    classDef frontend fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px;
    classDef database fill:#fff9c4,stroke:#f57f17,stroke-width:2px;
```
