# lucaspinheirordc/uva-trabalho-f architecture

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

- Interactive diagram: https://gitdiagram.com/lucaspinheirordc/uva-trabalho-f
- Repository: https://github.com/lucaspinheirordc/uva-trabalho-f

## Overview

##### Project type and purpose
- This is a small monolithic PHP web application (LAMP-style) that provides basic CRUD functionality for “pedidos” (orders). It serves HTML pages, runs PHP scripts on the server, and stores data in a MySQL database (pedidos.sql).

##### File structure
- Top‐level files:
- HTML pages: index.html, about.html, pedido.html
- PHP endpoints: index.php, inserir.php (create), editar.php (read+form), atualizar.php (update), deletar.php (delete)
- conexao.php: centralizes the database connection logic
- pedidos.sql: database schema and seed data
- Static assets: style.css, style2.css, script.js, logo.jfif
- No separate frontend/backend directories—this is a simple monolith where PHP scripts both render views and perform business logic.

##### README
- Minimal description: “Versão final do trabalho, site upado.”
- No architectural notes, so we infer LAMP stack and CRUD flow from file names and SQL.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Tier
    subgraph "Client Tier"
        direction TB
        subgraph "Browser UI Pages"
            direction TB
            Page1["index.html"]:::client
            Page2["about.html"]:::client
            Page3["pedido.html"]:::client
        end
        subgraph "Static Assets"
            direction TB
            Asset1["style.css"]:::static
            Asset2["style2.css"]:::static
            Asset3["script.js"]:::static
            Asset4["logo.jfif"]:::static
        end
    end

    %% Server Tier
    subgraph "Server Tier"
        direction TB
        WS["Web Server + PHP Runtime"]:::server
        subgraph "PHP Controllers"
            direction TB
            Ctrl1["index.php"]:::server
            Ctrl2["inserir.php"]:::server
            Ctrl3["editar.php"]:::server
            Ctrl4["atualizar.php"]:::server
            Ctrl5["deletar.php"]:::server
        end
        Module["conexao.php"]:::module
    end

    %% Database
    DB["MySQL Database"]:::database
    Schema["pedidos.sql"]:::database

    %% Connections
    Page1 -->|"HTTP GET /index.php"| Ctrl1
    Page3 -->|"HTTP GET /pedido.html"| WS
    Page2 -->|"HTTP GET /about.html"| WS

    Asset1 -->|"GET style.css"| WS
    Asset2 -->|"GET style2.css"| WS
    Asset3 -->|"GET script.js"| WS
    Asset4 -->|"GET logo.jfif"| WS

    Ctrl1 -->|"include conexao.php"| Module
    Ctrl2 -->|"include conexao.php"| Module
    Ctrl3 -->|"include conexao.php"| Module
    Ctrl4 -->|"include conexao.php"| Module
    Ctrl5 -->|"include conexao.php"| Module

    Module -->|"SQL queries"| DB

    WS -->|"serves HTML/CSS/JS"| Page1
    WS -->|"serves HTML/CSS/JS"| Page2
    WS -->|"serves HTML/CSS/JS"| Page3
    WS -->|"serves assets"| Asset1
    WS -->|"serves assets"| Asset2
    WS -->|"serves assets"| Asset3
    WS -->|"serves assets"| Asset4

    Schema -.->|"DB schema & seeds"| DB

    %% Click Events
    click Page1 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/index.html"
    click Page2 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/about.html"
    click Page3 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/pedido.html"
    click Asset1 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/style.css"
    click Asset2 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/style2.css"
    click Asset3 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/script.js"
    click Asset4 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/logo.jfif"
    click Ctrl1 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/index.php"
    click Ctrl2 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/inserir.php"
    click Ctrl3 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/editar.php"
    click Ctrl4 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/atualizar.php"
    click Ctrl5 "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/deletar.php"
    click Module "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/conexao.php"
    click Schema "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/pedidos.sql"
    click WS "https://github.com/lucaspinheirordc/uva-trabalho-f/blob/main/README.md"

    %% Styles
    classDef client fill:#D0E6FF,stroke:#4A90E2,color:#000;
    classDef server fill:#DFFFE0,stroke:#3C763D,color:#000;
    classDef module fill:#EEEEEE,stroke:#888888,color:#000;
    classDef database fill:#FFE5B4,stroke:#FF8C00,color:#000;
    classDef static fill:#F0F0F0,stroke:#999999,color:#000;
```
