How prathameshv07/aquasense_ai works
Project Type & Purpose
• AquaSense AI is a web-based platform for water quality assessment.
• It integrates Django for the backend (using the standard project structure with config and home directories) and uses HTML, CSS (with Bootstrap) for the frontend.
• It also leverages multiple pre-trained scikit-learn machine learning models (stored as .pkl files under static/model) for predicting water quality metrics.
• Additional integration includes IoT sensor input and Firebase-based contact/feedback functionality.
Main Components
a. Client/User Interfaces:
– Web Browser: Renders user pages for manual input and IoT sensor-based input.
– Static Assets: HTML templates, CSS files, images, and documentation (located in home/templates and static directories).
b. Web Application Backend:
– Django Application: Represented by key modules (manage.py, config/, home/ directories) handling HTTP request routing, business logic, and interactions with the ML prediction engine.
– URL Routing & Views: Capture how HTTP requests from the frontend are mapped through home/urls.py and handled by views in home/views.py (including forms and contact input).
– Admin Interface: Provided by Django’s admin (evident in home/admin.py and staticfiles/admin).
c. Machine Learning Component:
– ML Prediction Engine: Highlight that various ML models (e.g., Gradient Boosting Regression among others) are pre-trained and loaded via pickle (stored under static/model for both “eight parameter” and “four parameter” categories).
– Data Flow: Show how water parameter inputs from both manual forms and IoT inputs are passed on to these ML models for processing and prediction.
d. Data Sources & Integration:
– Database: Even if not explicitly detailed in the file tree, the use of Django ORM implies an underlying relational database for user data, water quality records, and logs.
– IoT Sensor Data: Represent a dedicated pathway or integration point that provides real-time sensor input for four key water parameters.
– External Services: Firebase for managing contact and feedback functionality (as noted in the README).
Relationships & Interactions
– The Client (browser) and Django views/controllers (HTTP requests/responses).
– Django controllers and the ML Prediction Engine for data and prediction requests.
– Django controllers and the Database (for persistence).
– Django’s contact endpoints and Firebase integration.
• How user input drives the processing flow: from data acquisition, through ML model selection/execution, to delivering remediation recommendations and water quality predictions back to the user.
Architectural Patterns & Design Principles
• Follow a Model-View-Controller (MVC) pattern typical of Django projects.
• Separation of concerns: frontend rendering vs. backend logic vs. ML processing.
• Incorporate modular design to reflect the separation between water quality analysis, user input (both manual and IoT), and the external integration with Firebase.
Technologies and Frameworks
• Backend: Django (Python) with its config and home directories.
• Machine Learning: scikit-learn models (loaded via pickle).
• Frontend: HTML, CSS, Bootstrap.
• Cloud/Integration: Firebase for real-time contact system.
• Deployment: Vercel configuration is noted (vercel.json), which could be an additional external integration point.