A robust backend system built with CodeIgniter 4 to monitor energy consumption, predict bills using Gemini AI, and provide energy-saving tips.
- Real-time Monitoring: Collects and stores sensor data (current, voltage, temperature).
- AI-Powered Insights: Uses Google Gemini AI to predict monthly electricity bills and generate personalized energy-saving tips.
- Firebase Integration: Synchronizes data seamlessly with Firebase for real-time updates.
- RESTful API: Provides a clean and documented API for frontend consumption.
- Automated Sync: Support for cron-job based synchronization of sensor data.
- Framework: CodeIgniter 4
- Database: MySQL
- AI Integration: Google Gemini API
- External Services: Firebase
- Language: PHP 8.2+
- Clone the repository:
git clone https://github.com/iMuhammadAbdullahAwan/backend-code.git cd backend-code - Install dependencies:
composer install
- Configure Environment:
- Copy
envto.env. - Set your
app.baseURL. - Configure
database.defaultsettings. - Add your
GEMINI_API_KEYandFIREBASE_URL. - Set
SYNC_SECRETfor protected endpoints.
- Copy
- Run Migrations:
php spark migrate
- Start Development Server:
php spark serve
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the LICENSE file.