# sudokentucky/ipc2_proyecto3_20210106 architecture

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

- Interactive diagram: https://gitdiagram.com/sudokentucky/ipc2_proyecto3_20210106
- Repository: https://github.com/sudokentucky/ipc2_proyecto3_20210106

## Overview

##### Main Components

a. BackEnd Service:
- Located in the “BackEnd” directory.
- Contains an “app” folder with initialization files, a “data_storage.py” module, utility functions, and “views.py” which likely defines the API endpoints.
- A “models” directory holds domain-specific entities (Banco, Cliente, Factura, Pago) that represent the business logic/data model.
- The “run.py” script appears to be the entry point for starting the backend service (likely running on port 5000, as suggested by the READMEs API endpoint).

b. FrontEnd Application:
- Housed in the “FrontEnd” directory. Within that, there’s a separate “FrontEnd” project folder that includes standard Django files such as settings.py, urls.py, asgi.py, wsgi.py, and manage.py.
- Contains “templates” (various HTML files for different pages), “static” assets (CSS files), and custom views for handling requests.
- There is also a SQLite database (db.sqlite3) which indicates that the Django app is managing some local persistence.

c. Supporting/Documentation:

##### Understand the Relationships and Interactions

- The BackEnd exposes REST API endpoints (e.g., http://localhost:5000/api/consultarIngresos?fecha=03/2022) for client consumption. This service is responsible for handling business logic and data interactions using its model classes and data storage mechanisms.
- The FrontEnd, built with Django, serves web pages. It likely interacts with the backend API to fetch data (or in some configurations, might also incorporate business logic locally) and to render dynamic content via its templates.
- The FrontEnd also directly interacts with its local SQLite database for persistence.

##### Architectural Patterns

- For the BackEnd, there is a clear separation of concerns between “views” (which could be controller-like endpoints) and “models” (which define the domain). The “data_storage.py” might encapsulate data access logic, while “utils” contains helper functions.
- The Django FrontEnd follows the MVC (or more accurately, MTV) pattern where templates represent the view, URL patterns and views are the controller, and models (if any exist in this part) or the SQLite database is the data layer.

##### Relevant Technologies and Frameworks

- BackEnd: Likely a Python-based microservice framework (possibly Flask-like given the “run.py” and folder layout) that provides RESTful API endpoints.
- FrontEnd: A Django application (evident from settings.py, asgi.py, etc.) handling user interface rendering through HTML templates and static asset management.
- SQLite database: Employed by the Django app for data persistence.
- Communication is done via REST API calls (e.g., the “consultarIngresos” endpoint).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Initiation
    User("User"):::user

    %% FrontEnd Application Subgraph
    subgraph "FrontEnd Application"
        FE_Controller("Django Controller & Settings"):::frontend
        FE_Templates("Templates"):::frontend
        FE_Static("Static Assets"):::frontend
        FE_DB("SQLite DB (Persistence)"):::database
    end

    %% BackEnd API Service Subgraph
    subgraph "BackEnd API Service"
        BE_Run("run.py (Entry Point)"):::backend
        BE_Views("views.py (API Endpoints)"):::backend
        subgraph "Business Logic & Data Handling"
            BE_Storage("data_storage.py"):::backend
            BE_Utils("utils (Folder)"):::backend
        end
        subgraph "Domain Models"
            BE_Models("models (Domain Models)"):::backend
        end
    end

    %% Documentation Subgraph
    subgraph "Documentation"
        Doc("Project Documentation"):::doc
    end

    %% Relationships
    User -->|"accesses"| FE_Templates
    FE_Templates -->|"triggers"| FE_Controller
    FE_Controller -->|"persists_data"| FE_DB
    FE_Controller -->|"calls_API"| BE_Views
    BE_Views -->|"invokes_logic"| BE_Storage
    BE_Views -->|"utilizes"| BE_Utils
    BE_Storage -->|"manages"| BE_Models

    %% Styles
    classDef user fill:#f9d,stroke:#333,stroke-width:2px;
    classDef frontend fill:#bbf,stroke:#333,stroke-width:2px;
    classDef backend fill:#fbb,stroke:#333,stroke-width:2px;
    classDef database fill:#cfc,stroke:#333,stroke-width:2px;
    classDef doc fill:#ffe,stroke:#333,stroke-width:2px;

    %% Click Events
    click BE_Run "https://github.com/sudokentucky/ipc2_proyecto3_20210106/blob/main/BackEnd/run.py"
    click BE_Views "https://github.com/sudokentucky/ipc2_proyecto3_20210106/blob/main/BackEnd/app/views.py"
    click BE_Storage "https://github.com/sudokentucky/ipc2_proyecto3_20210106/blob/main/BackEnd/app/data_storage.py"
    click BE_Utils "https://github.com/sudokentucky/ipc2_proyecto3_20210106/tree/main/BackEnd/app/utils/"
    click BE_Models "https://github.com/sudokentucky/ipc2_proyecto3_20210106/tree/main/BackEnd/models/"
    click FE_Controller "https://github.com/sudokentucky/ipc2_proyecto3_20210106/tree/main/FrontEnd/FrontEnd/"
    click FE_Templates "https://github.com/sudokentucky/ipc2_proyecto3_20210106/tree/main/FrontEnd/FrontEnd/templates/"
    click FE_Static "https://github.com/sudokentucky/ipc2_proyecto3_20210106/tree/main/FrontEnd/FrontEnd/static/"
    click FE_DB "https://github.com/sudokentucky/ipc2_proyecto3_20210106/blob/main/FrontEnd/db.sqlite3"
    click Doc "https://github.com/sudokentucky/ipc2_proyecto3_20210106/tree/main/Documentacion/"
```
