How bryanmn0305/parkinglotcci works
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