How khotchaitanya/cleantrack-waste-reporting-system-php works
Project Type and Purpose
• CleanTrack is a small-scale full-stack web application (a monolithic LAMP/WAMP stack) for citizen waste reporting.
• Purpose: Allow public users to submit garbage-related issues, view existing reports, and enable administrators to manage and resolve them.
File Structure Analysis
• index.html: Public-facing form UI
• style.css: Shared styling for all pages
• submit.php: Endpoint handling new report submissions
• view_reports.php: Public dashboard showing all reports
• admin.php: Admin dashboard listing all issues
• update_status.php: Endpoint to mark a report resolved
• db.php: Centralized database connection logic
• README.md / LICENSE: Documentation and licensing
README Insights
• Technologies: PHP (server-side logic), MySQL (data store), HTML5/CSS3 (UI), WAMP/XAMPP (local hosting)
• No external JS frameworks or microservices—this is a single-tier server-rendered app
• Key features: form submission, auto-generated report IDs, admin resolution flow, public viewing
a. Main Components
• Client Browser (User)
• Web Server (Apache under WAMP/XAMPP)
• PHP Application Layer (.php scripts & db.php)
• MySQL Database
• Optional: phpMyAdmin (DB administration)
b. Relationships & Data Flow
1. User loads index.html ← style.css
2. User submits form → submit.php → db.php → MySQL INSERT
3. submit.php → User (success + Report ID)
4. Public viewer → view_reports.php → db.php → MySQL SELECT → JSON/HTML table → User
5. Admin → admin.php → db.php → MySQL SELECT → User
6. Admin marks resolved → update_status.php → db.php → MySQL UPDATE
c. Architectural Patterns
• Monolithic LAMP‐style
• Server-side rendering (no client-side MV* framework)
• Simple MVC hints:
• Models: db.php + MySQL tables
• Views: index.html, styled PHP templates embedded in admin.php/view_reports.php
• Controllers: submit.php, update_status.php
d. Key Technologies
• PHP scripts for business logic & routing
• MySQL for persistence
• HTML/CSS for UI
• WAMP/XAMPP for local hosting environment