An AI-powered energy management system for campuses that provides real-time monitoring, analytics, and optimization recommendations through an intelligent dashboard.
- Overview
- Features
- Tech Stack
- Installation & Setup
- Usage
- Project Architecture
- API Documentation
- Deployment
- Known Issues
- Future Work
- Contributing
- License
- Author
GreenPulse addresses the critical need for intelligent energy management in campus environments. With rising energy costs and environmental concerns, educational institutions require sophisticated tools to monitor, analyze, and optimize their energy consumption patterns.
Problem Statement: Campus energy management systems are often fragmented, reactive, and lack predictive capabilities, leading to inefficient energy usage and increased operational costs.
Our Solution: GreenPulse provides a unified platform with real-time monitoring, AI-powered analytics, and actionable insights to optimize campus energy consumption and reduce environmental impact.
Context: This project was developed as a hackathon prototype to demonstrate modern web development practices and smart energy management concepts.
- π Real-time Energy Dashboard - Live monitoring of campus energy consumption
- π’ Multi-Building Management - Monitor multiple campus buildings simultaneously
- π Interactive Analytics - Visual charts and graphs for energy patterns
- π€ AI-Powered Insights - Smart recommendations for energy optimization
- π WebSocket Integration - Real-time data updates without page refresh
- π± Responsive Design - Works seamlessly across desktop and mobile devices
- π Glassmorphism Design - Modern, elegant user interface
- π Dark/Light Theme - Customizable viewing experience
- π Interactive Charts - Built with Chart.js for engaging data visualization
- π― Intuitive Navigation - User-friendly interface design
- β‘ High Performance - Fast API responses and optimized frontend
- π Secure Architecture - CORS protection and secure API endpoints
- π³ Containerized Deployment - Docker support for easy deployment
- βοΈ Cloud Ready - AWS deployment configurations included
- π API Documentation - Auto-generated OpenAPI/Swagger docs
- Framework: Angular 17
- Language: TypeScript
- Styling: SCSS with Glassmorphism effects
- Charts: Chart.js
- HTTP Client: Angular HttpClient
- Real-time: WebSocket integration
- Framework: FastAPI (Python)
- Database: PostgreSQL with TimescaleDB
- Caching: Redis
- Authentication: JWT tokens
- WebSockets: Native FastAPI WebSocket support
- Validation: Pydantic models
- Containerization: Docker & Docker Compose
- Cloud Platform: AWS (EC2, RDS, S3, CloudFront)
- Web Server: Nginx (reverse proxy)
- Process Management: Uvicorn with Gunicorn
- Monitoring: Built-in health checks
- Data Processing: Pandas, NumPy
- Machine Learning: Scikit-learn
- Time Series: TimescaleDB extensions
- Data Format: ASHRAE Building Performance Dataset
- Node.js (v18 or higher)
- Python (3.7 or higher)
- PostgreSQL (12 or higher)
- Docker (optional, for containerized setup)
- Clone the repository
git clone https://github.com/surajsk2003/GreenPulse.git
cd GreenPulse- Backend Setup
cd backend
pip install -r requirements.txt
# Set environment variables
cp .env.example .env
# Edit .env with your database credentials
# Run the backend
python -m app.main- Frontend Setup
cd frontend/greenpulse-dashboard
npm install
# Start development server
ng serve- Database Setup (Optional)
# Using Docker
docker-compose up -d db redis
# Or set up PostgreSQL manually and create database
createdb greenpulse# Build and run all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downAccess the application:
- Frontend: http://localhost:4200
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
-
Building Selection
- Choose from available campus buildings
- View building-specific energy metrics
-
Real-time Monitoring
- Monitor live energy consumption
- Track cost and carbon emissions
- View efficiency scores
-
Analytics & Insights
- Analyze historical energy patterns
- View optimization recommendations
- Compare building performance
-
Leaderboard
- See building efficiency rankings
- Track improvement metrics
- Identify top performers
The REST API provides programmatic access to all features:
# Get building list
curl http://localhost:8000/api/buildings
# Get real-time analytics
curl http://localhost:8000/api/analytics/campus/stats
# Access API documentation
open http://localhost:8000/docsGreenPulse/
βββ frontend/ # Angular application
β βββ greenpulse-dashboard/
β βββ src/
β β βββ app/
β β β βββ components/ # Angular components
β β β βββ services/ # HTTP services
β β βββ environments/ # Environment configs
β βββ package.json
βββ backend/ # FastAPI application
β βββ app/
β β βββ core/ # Configuration & database
β β βββ routers/ # API route handlers
β β βββ models/ # Pydantic models
β β βββ main.py # Application entry point
β βββ requirements.txt
βββ docker-config/ # Docker configurations
β βββ docker-compose.yml
β βββ nginx.conf
βββ ml-models/ # Machine learning modules
βββ ashrae-energy-data/ # Energy dataset
βββ deploy-aws.sh # AWS deployment script
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β Database β
β (Angular) βββββΊβ (FastAPI) βββββΊβ (PostgreSQL) β
β Port: 4200 β β Port: 8000 β β Port: 5432 β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Docker Network β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The API follows RESTful principles and provides comprehensive documentation:
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
API information |
| GET | /health |
Health check |
| GET | /docs |
Interactive API docs |
| GET | /api/buildings |
List all buildings |
| GET | /api/analytics/campus/stats |
Campus-wide statistics |
| GET | /api/insights/recommendations |
AI recommendations |
| WebSocket | /api/ws |
Real-time data stream |
All API responses follow a consistent format:
{
"status": "success",
"data": {
// Actual response data
},
"total": 42,
"message": "Optional message"
}The project includes automated AWS deployment with the following architecture:
- Frontend: S3 Static Website + CloudFront CDN
- Backend: EC2 instance with Nginx reverse proxy
- Database: RDS PostgreSQL (optional)
- Storage: S3 for static assets
# Configure AWS CLI
aws configure
# Deploy to AWS (update script with your credentials first)
chmod +x deploy-aws.sh
./deploy-aws.shNote: Update the deployment script with your specific AWS credentials and configuration before running.
# Build frontend for production
cd frontend/greenpulse-dashboard
ng build --configuration=production
# Run backend with Gunicorn
cd ../../backend
gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorkerAs this is a prototype, there are several known limitations:
- π§ Database Integration: Some endpoints use mock data instead of live database
- π ML Models: Machine learning features are placeholder implementations
- π Authentication: User authentication system not fully implemented
- π± Mobile Optimization: Some UI components need mobile refinement
- π Data Validation: Limited input validation on some forms
Currently using mock data for:
- Building energy readings
- Historical analytics
- ML model predictions
- User management
- Connect real energy monitoring hardware
- Implement ASHRAE dataset processing
- Add real-time data ingestion pipeline
- Create data validation and cleaning workflows
- Develop energy consumption prediction models
- Implement anomaly detection algorithms
- Add optimization recommendation engine
- Create automated reporting system
- User authentication and authorization
- Multi-tenant campus support
- Advanced dashboard customization
- Mobile application development
- Integration with campus management systems
- Carbon footprint tracking
- Cost optimization algorithms
- Predictive maintenance alerts
- Weather-based energy forecasting
- Sustainability reporting
Contributions are welcome! This project serves as a foundation for energy management solutions.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Backend: Follow PEP 8 for Python code
- Frontend: Use Angular style guide and TypeScript best practices
- Comments: Document complex logic and API endpoints
- Testing: Add tests for new features (when applicable)
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Suraj Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Suraj Kumar
B.Tech, NITK Surathkal
- ASHRAE: For providing the building performance dataset
- FastAPI Community: For excellent documentation and support
- Angular Team: For the robust frontend framework
- Open Source Community: For the various libraries and tools used
This is a prototype/proof-of-concept developed for educational and demonstration purposes.
- Not intended for production use without further development
- Mock data is used in several components
- Security features require enhancement for production deployment
- Database connections and ML models need real-world calibration
For production deployment, additional work is required in security, scalability, and data integration.
π± Built with passion for sustainable energy management π
If this project helped you or inspired your work, please consider giving it a β