How kvj-harsha/ecocarb works
Main Components
a. Frontend (Next.js Application):
• Represents the client user interface and handles basic web presentation.
• Contains subcomponents (components, pages, and UI parts) as visible in the “client/app/components”, “client/app/home”, etc.
• Uses Tailwind CSS and Aceternity UI.
• Integrates with Firebase for user authentication and database connectivity.
b. Backend (Flask API Server):
• Located in the “server” directory – includes app.py, main.py, and several ML model files (model.pkl, model2.pkl, etc.).
• Exposes REST endpoints (such as POST /predict) for handling requests from the frontend.
• Contains code to load and run ML models for prediction and classification tasks.
c. Machine Learning Models & External Services:
• ML models: XGBoost (for carbon emission prediction) and Random Forest (for harsh driving detection) are included as standalone modules.
• An integration with Gemini Flash 1.5 LLM for AI insights.
d. Database & Authentication (Firebase):
• As per the README, Firebase handles secure authentication and database management.
• Located in the “client/lib/firebase.js” — emphasize its role as a backend-as-a-service integrated with the client code.
Architectural Patterns & Design Principles
• Separation of Concerns: Clear distinction between UI (client) and business logic/ML processing (backend).
• Microservice-esque API design with REST endpoints (e.g., POST /predict).
• Integration of ML models within the backend processing flow.
• Use of third-party services (Firebase, and the external LLM) for enhanced functionality.