# iuriavil4/projeto-site-orcamento architecture

> Architecture diagram of the GitHub repository iuriavil4/projeto-site-orcamento, 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/iuriavil4/projeto-site-orcamento
- Repository: https://github.com/iuriavil4/projeto-site-orcamento

## Overview

- Sending an email notification to a personal address
- Storing the entered data in an Oracle Database via a PL/SQL procedure

##### Main Components
- Client / Browser Interface: This is the front end. The user interacts with HTML pages styled with CSS and Bootstrap. The key page, for example, “orcamento/home.html”, is rendered as part of the client’s experience.
- Django Web Server: This is the heart of the back end. It involves several modules:
- URL Routing (projeto_orcamento/urls.py) to direct client requests.
- Views (app_orcamento/views.py) that process incoming requests and call appropriate logic.
- Forms (app_orcamento/forms.py) handling client submission.
- Models (app_orcamento/models.py) representing data structures (although persistence is offloaded to Oracle through a procedure).
- Utility modules (app_orcamento/email_utils.py) for sending emails.
- Oracle Database: Although Django typically supports several database engines, here it connects to an Oracle DB where client data is inserted via a PL/SQL stored procedure (illustrated in the README).
- PL/SQL Procedure: The add_cliente procedure acts as the interface for inserting the data into the database.
- Email Sending Mechanism: Triggered as part of the Django view’s workflow upon receiving a form submission.

##### Relationships & Data Flow
- The submission is handled by a Django View (in app_orcamento/views.py), which:
- Validates the input (potentially using app_orcamento/forms.py)
- Invokes the email utility to send an email notification.
- Connects to the Oracle Database and calls the PL/SQL stored procedure (add_cliente) to insert the client’s data.
- The Email Service (you might simply show “Email Utility Module” that abstracts the SMTP/Email service).
- The Oracle Database (depicting the PL/SQL procedure call).

##### Architectural Patterns & Design Principles
- Front-end (Templates, Static Assets for HTML/CSS/Bootstrap)
- Application logic (Views, Forms, URL Routing)
- Back-end services (Database interactions and Email utilities)
- That the integration with Oracle is done outside the typical Django ORM pattern by the explicit use of a procedure – thus, emphasize the custom flow for data persistence.

##### Relevant Technologies and Tools
- Back end: Python and Django as the framework for the web server.
- Database: Oracle Database with PL/SQL for data insertion.
- Front end: HTML, CSS, and Bootstrap for user interface presentation.
- Any middleware (if applicable) for handling database connections or email sending.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Frontend Layer
    subgraph "Frontend Layer"
        CB["Client Browser (HTML/CSS/Bootstrap)"]:::frontend
    end

    %% Django Application Layer
    subgraph "Django Application Layer"
        UR["URL Routing"]:::backend
        V["Views (Request Processing)"]:::backend
        F["Forms (Input Handling)"]:::backend
        M["Models (Data Structures)"]:::backend
        EU["Email Utility Module"]:::backend
        DA["Django Admin Interface"]:::backend
    end

    %% External Services
    subgraph "External Services"
        ES["Email Service"]:::external
        PP["PL/SQL Procedure (add_cliente)"]:::external
        ODB["Oracle Database"]:::external
    end

    %% Data Flow Connections
    CB -->|"HTTP_Request"| UR
    UR -->|"Dispatch_Request"| V
    V -->|"Validates_Input"| F
    V -->|"Utilizes_Models"| M
    V -->|"Triggers_Email"| EU
    EU -->|"Sends_Notification"| ES
    V -->|"Calls_Procedure"| PP
    PP -->|"Inserts_Data"| ODB

    %% Click Events for Component Mapping
    click CB "https://github.com/iuriavil4/projeto-site-orcamento/blob/main/app_orcamento/templates/orcamento/home.html"
    click UR "https://github.com/iuriavil4/projeto-site-orcamento/blob/main/projeto_orcamento/urls.py"
    click V "https://github.com/iuriavil4/projeto-site-orcamento/blob/main/app_orcamento/views.py"
    click F "https://github.com/iuriavil4/projeto-site-orcamento/blob/main/app_orcamento/forms.py"
    click M "https://github.com/iuriavil4/projeto-site-orcamento/blob/main/app_orcamento/models.py"
    click EU "https://github.com/iuriavil4/projeto-site-orcamento/blob/main/app_orcamento/email_utils.py"

    %% Styles
    classDef frontend fill:#FFDDCC,stroke:#D2691E,stroke-width:2px;
    classDef backend fill:#CCEEFF,stroke:#1E90FF,stroke-width:2px;
    classDef external fill:#DFFFD6,stroke:#32CD32,stroke-width:2px;
```
