# bryanmn0305/parkinglotcci architecture

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

- Interactive diagram: https://gitdiagram.com/bryanmn0305/parkinglotcci
- Repository: https://github.com/bryanmn0305/parkinglotcci

## Overview

##### Project Type and Purpose
- This is a monolithic full-stack web application (“ParkingLotCCI”) for managing parking entries/exits, user roles (Admin/Employee), and beneficiary reports.
- The presence of main.py suggests a Python-based HTTP server (likely Flask or similar). Static assets (HTML/CSS/JS) form the frontend.

##### File Structure
- Top-level:
- main.py – Python application entry point (routes & controllers)
- bd.sql – database schema or seed script (likely MySQL/SQLite)
- index.html – landing page
- Directories:
- html/ – role-specific HTML templates (Admin & Employee dashboards, reports, registration forms)
- css/ – Bootstrap + custom styles
- js/ – application logic (login, CRUD operations, chatbot, alerts)
- img/ – static images
- __pycache__/ – compiled Python files
- No separate “backend” folder—Python code and static assets coexist.

##### README and Documentation
- README is minimal (“CCI Proyecto / ParkingLotCCI”), so derive architecture from files: HTTP server (main.py), static file serving, database interactions.

##### Main Components & Interactions
a. Frontend Layer
- Browser clients request HTML, CSS, JS assets.
- UI pages under html/ & index.html render forms, dashboards (Admin vs. Employee).
- JavaScript modules in js/ handle user actions (login, register user/role, entry/exit logging, chatbot).
b. Backend Layer (main.py)
- HTTP server exposes endpoints for authentication, data CRUD (users, roles, parking records).
- Serves static assets (index.html, html/, css/, js/, img/).
- Processes AJAX calls from frontend JS, returns JSON or redirects.
c. Database
- bd.sql defines tables (users, roles, parking_records, etc.).
- Python code uses a DB driver (e.g., SQLite, MySQL) to persist/retrieve data.
d. External Libraries & Frameworks
- Bootstrap CSS/JS for responsive UI
- SweetAlert for modals/alerts
- Potential chatbot integration via chatbot.js

##### Architectural Patterns & Design Principles
- Monolithic MVC-style:
- Views: static HTML + JS
- Controllers/Routes: main.py endpoints
- Model: database via SQL scripts & Python ORM or raw SQL
- Separation of concerns: static assets vs. dynamic API

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client
    Browser["Client Browser"]:::client

    %% Static Content Group
    subgraph "Static Content"
        direction TB
        Index["index.html"] 
        htmlDir["HTML Templates"] 
        cssDir["CSS Stylesheets"] 
        jsDir["JavaScript Modules"] 
        imgDir["Image Assets"] 
        %% HTML Templates
        htmlDir --> DashAd["DashAd (Admin Dashboard)"]
        htmlDir --> DashEmp["DashEmp (Employee Dashboard)"]
        htmlDir --> RegIngresoSalidaAd["RegIngresoSalidaAd"]
        htmlDir --> RegIngresoSalidaEmp["RegIngresoSalidaEmp"]
        htmlDir --> RegistrarUsuarioAd["RegistrarUsuarioAd"]
        htmlDir --> RegistrarRolAd["RegistrarRolAd"]
        htmlDir --> VerRegistrosEmpleadosAd["VerRegistrosEmpleadosAd"]
        htmlDir --> RegistrarUsuarioEmp["RegistrarUsuarioEmp"]
        htmlDir --> VerRegistrosEmpleadosEmp["VerRegistrosEmpleadosEmp"]
        htmlDir --> MostrarBeneficiarios["MostrarBeneficiarios"]
        htmlDir --> MostrarBeneficiariosEmp["MostrarBeneficiariosEmp"]
        %% JS Modules
        jsDir --> LoginJS["login.js"]
        jsDir --> CerrarSesionJS["cerrarsesion.js"]
        jsDir --> IngresoJS["ingreso.js"]
        jsDir --> SalidaJS["salida.js"]
        jsDir --> MostrarRegIngresoSalidaJS["mostrarRegIngresoSalida.js"]
        jsDir --> MostrarEmpleadosJS["mostrarempleados.js"]
        jsDir --> MostrarEmpleadosEmpJS["mostrarempleadosEmp.js"]
        jsDir --> RegistrarUsuarioAdJS["registrarusuarioAd.js"]
        jsDir --> RegistrarUsuarioEmpJS["registrarusuarioEmp.js"]
        jsDir --> RegistrarRolJS["RegistrarRol.js"]
        jsDir --> ChatbotJS["chatbot.js"]
        jsDir --> SemanalJS["semanal.js"]
        jsDir --> TotalBeneJS["totalbene.js"]
        jsDir --> SweetAlertJS["sweetalert.js"]
        jsDir --> ContactoJS["contacto.js"]
        %% Bootstrap & Custom CSS/JS
        cssDir --> BootstrapCSS["bootstrap.css + variants"]
        cssDir --> StyleGeneralCSS["stylegeneral.css"]
        cssDir --> StyleDashCSS["styledash.css"]
        cssDir --> StyleChatbotCSS["stylechatbor.css"]
        jsDir --> BootstrapBundleJS["bootstrap.bundle.js"]
        jsDir --> BootstrapESMJS["bootstrap.esm.js"]
        jsDir --> BootstrapJS["bootstrap.js"]
    end

    %% Application Server
    App["Python HTTP Server<br/>(main.py)"]:::server

    %% Database
    DB["Database (bd.sql schema)"]:::db

    %% Connections
    Browser -->|"Static File Fetch"| Index
    Browser -->|"Static File Fetch"| htmlDir
    Browser -->|"Static File Fetch"| cssDir
    Browser -->|"Static File Fetch"| jsDir
    Browser -->|"Static File Fetch"| imgDir
    Browser -->|"HTTP GET/POST AJAX"| App
    App -->|"SQL Query"| DB
    DB -->|"Query Result"| App
    App -->|"JSON / HTML Response"| Browser

    %% Click Events
    click Index "https://github.com/bryanmn0305/parkinglotcci/blob/main/index.html"
    click htmlDir "https://github.com/bryanmn0305/parkinglotcci/tree/main/html/"
    click cssDir "https://github.com/bryanmn0305/parkinglotcci/tree/main/css/"
    click jsDir "https://github.com/bryanmn0305/parkinglotcci/tree/main/js/"
    click imgDir "https://github.com/bryanmn0305/parkinglotcci/tree/main/img/"
    click DashAd "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/DashAd.html"
    click DashEmp "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/DashEmp.html"
    click RegIngresoSalidaAd "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/RegIngresoSalidaAd.html"
    click RegIngresoSalidaEmp "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/RegIngresoSalidaEmp.html"
    click RegistrarUsuarioAd "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/RegistrarUsuarioAd.html"
    click RegistrarRolAd "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/RegistrarRolAd.html"
    click VerRegistrosEmpleadosAd "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/VerRegistrosEmpleadosAd.html"
    click RegistrarUsuarioEmp "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/RegistrarUsuarioEmp.html"
    click VerRegistrosEmpleadosEmp "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/VerRegistrosEmpleadosEmp.html"
    click MostrarBeneficiarios "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/MostrarBeneficiarios.html"
    click MostrarBeneficiariosEmp "https://github.com/bryanmn0305/parkinglotcci/blob/main/html/MostrarBeneficiariosEmp.html"
    click LoginJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/login.js"
    click CerrarSesionJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/cerrarsesion.js"
    click IngresoJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/ingreso.js"
    click SalidaJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/salida.js"
    click MostrarRegIngresoSalidaJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/mostrarRegIngresoSalida.js"
    click MostrarEmpleadosJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/mostrarempleados.js"
    click MostrarEmpleadosEmpJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/mostrarempleadosEmp.js"
    click RegistrarUsuarioAdJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/registrarusuarioAd.js"
    click RegistrarUsuarioEmpJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/registrarusuarioEmp.js"
    click RegistrarRolJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/RegistrarRol.js"
    click ChatbotJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/chatbot.js"
    click SemanalJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/semanal.js"
    click TotalBeneJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/totalbene.js"
    click SweetAlertJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/sweetalert.js"
    click ContactoJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/contacto.js"
    click BootstrapCSS "https://github.com/bryanmn0305/parkinglotcci/blob/main/css/bootstrap.css"
    click StyleGeneralCSS "https://github.com/bryanmn0305/parkinglotcci/blob/main/css/stylegeneral.css"
    click StyleDashCSS "https://github.com/bryanmn0305/parkinglotcci/blob/main/css/styledash.css"
    click StyleChatbotCSS "https://github.com/bryanmn0305/parkinglotcci/blob/main/css/stylechatbor.css"
    click BootstrapBundleJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/bootstrap.bundle.js"
    click BootstrapESMJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/bootstrap.esm.js"
    click BootstrapJS "https://github.com/bryanmn0305/parkinglotcci/blob/main/js/bootstrap.js"
    click App "https://github.com/bryanmn0305/parkinglotcci/blob/main/main.py"
    click DB "https://github.com/bryanmn0305/parkinglotcci/blob/main/bd.sql"

    %% Styles
    classDef client fill:#D6E9F8,stroke:#31708F,color:#31708F
    classDef static fill:#FCF8E3,stroke:#8A6D3B,color:#8A6D3B
    classDef server fill:#D9EDF7,stroke:#31708F,color:#31708F
    classDef db fill:#DFF0D8,stroke:#3C763D,color:#3C763D
```
