A full-stack renewable energy marketplace that enables users to securely buy and sell surplus solar energy using AI-powered forecasting, digital wallets, secure online payments, and BI-ready admin analytics.
- Overview
- Problem Statement
- Features
- Tech Stack
- System Architecture
- Project Preview
- Demo Video
- PPT
- Installation
- Environment Variables
- Power BI Integration
- Running the Project
- Project Structure
- Future Improvements
- Support
- License
POWERFLOW is a decentralized peer-to-peer renewable energy trading platform that allows solar energy producers to sell excess electricity directly to consumers without depending entirely on traditional electricity providers.
The platform combines modern web technologies with Machine Learning and IoT concepts to provide secure, intelligent, and transparent energy trading — plus admin dashboards, exploratory KPI reporting, and Microsoft Power BI–ready datasets for advanced analytics.
Traditional electricity grids are highly centralized, making it difficult for individual solar producers to monetize surplus energy efficiently.
POWERFLOW solves this problem by providing:
- ⚡ Direct Producer-to-Consumer Energy Trading
- 🤖 AI-based Energy Forecasting
- 📧 Email Notifications & Automated PDF Receipts – Automatic transaction confirmations with downloadable PDF receipts
- 💳 Secure Digital Wallets
- 🔒 KYC Verification
- 📈 Admin Analytics Dashboard (Recharts)
- 📊 EDA & KPI Reporting with actionable insights
- 🧩 Microsoft Power BI integration via BI-ready REST/CSV APIs
- User Authentication (JWT)
- Buyer & Producer Roles
- Digital INR Wallet
- Energy Credit System
- Buy & Sell Renewable Energy
- Energy Donation
- AI Energy Forecasting
- PDF Bill / Receipt Generation
- Email Notifications
- Stripe Wallet Recharge
- Wallet transaction export (Excel-compatible CSV)
- Admin Dashboard (live KPI cards + revenue/energy charts)
- User Management
- KYC Verification (approve/reject with email notifications)
- Transaction Monitoring
- EDA & KPI Reporting – period-over-period KPIs, trend charts, verification/txn breakdowns, actionable insights, Excel/CSV export, and email report
- Power BI Hub – live KPI preview, dataset catalog, CSV downloads, and Power Query setup for Desktop
- Platform Configuration
- Pricing Management
- In-app analytics with Recharts (Dashboard + EDA & KPI Reporting)
- BI-ready REST/CSV datasets under
/api/admin/powerbi/* - Service-key auth for Power BI Desktop / scheduled refresh (
X-PowerBI-Key) - Datasets include KPIs, transactions, daily/monthly revenue, energy by source, hourly activity, meter daily, and verification summary
- Optional embed of a published Power BI report via
VITE_POWERBI_EMBED_URL
- Solar Energy Production Prediction
- Consumption Prediction
- Buy/Sell Recommendations
- Weather-based Forecasting using OpenWeather API
- React
- TypeScript
- Vite
- Tailwind CSS
- React Query
- React Router
- Framer Motion
- Three.js
- Recharts
- Node.js
- Express.js
- MongoDB Atlas
- Mongoose
- JWT Authentication
- Stripe API
- Nodemailer
- PDFKit
- Power BI–ready analytics APIs (REST + CSV)
- Recharts (in-app dashboards)
- Microsoft Power BI Desktop (external BI reports)
- MongoDB aggregations for live KPIs and insights
- Python
- Django
- Scikit-Learn
- XGBoost
- OpenWeather API
Watch the complete walkthrough of POWERFLOW here:
👉 YouTube Demo
https://www.youtube.com/watch?v=pTH78iPjIZI
- Node.js 18+
- pnpm
- Python 3.10+
- MongoDB Atlas (or local MongoDB)
- (Optional) Microsoft Power BI Desktop for external BI reports
git clone https://github.com/krishnavas23/Powerflow.git
cd Powerflowcd powerflow-backend
npm install
npm run devRuns on:
http://localhost:4000
cd powerflow-frontend
pnpm install
pnpm devRuns on:
http://localhost:8080
cd admin-frontend
pnpm install
pnpm devRuns on:
http://localhost:5173
cd energy1
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver 8000Runs on:
http://localhost:8000
Create a .env file inside powerflow-backend.
Example:
PORT=4000
MONGO_URI=
JWT_SECRET=
JWT_EXPIRES_IN=7d
ADMIN_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
EMAIL_USER=
EMAIL_PASS=
FRONTEND_URL=http://localhost:8080
# Power BI Desktop / scheduled refresh (send as header: X-PowerBI-Key)
POWERBI_API_KEY=Create .env for the admin frontend (admin-frontend):
VITE_BACKEND_BASE_URL=http://localhost:4000
# Optional: embed a published Power BI Service report in Admin → Power BI
VITE_POWERBI_EMBED_URL=Create .env for the user frontend (powerflow-frontend):
VITE_BACKEND_BASE_URL=http://localhost:4000
REACT_STRIPE_PUBLISHABLE_KEY=POWERFLOW exposes BI-ready datasets so Microsoft Power BI Desktop can connect without rewriting backend analytics.
- Start the backend with
POWERBI_API_KEYset. - Open Admin → Power BI for:
- Connection status + live KPI preview
- Dataset URLs and CSV downloads
- Sample Power Query / auth guidance
- In Power BI Desktop, use Get Data → Web (or Power Query) against:
http://localhost:4000/api/admin/powerbi/kpis
Add HTTP header:
X-PowerBI-Key: <your POWERBI_API_KEY>
Other useful endpoints (same auth):
| Dataset | Endpoint |
|---|---|
| Catalog | /api/admin/powerbi/ |
| KPIs | /api/admin/powerbi/kpis |
| Transactions | /api/admin/powerbi/transactions |
| Revenue (daily) | /api/admin/powerbi/revenue-daily |
| Revenue (monthly) | /api/admin/powerbi/revenue-monthly |
| Energy by source | /api/admin/powerbi/energy-by-source |
| Hourly activity | /api/admin/powerbi/user-activity-hourly |
| Meter daily | /api/admin/powerbi/meter-daily |
| Verification summary | /api/admin/powerbi/verification-summary |
Append ?format=csv where supported for Excel / Power BI CSV import.
Note: In-app Dashboard / EDA charts use Recharts. Power BI Desktop reports use Microsoft Power BI visuals. Both read live MongoDB aggregations from the backend.
Start services in the following order:
- MongoDB
- Backend
- ML Service
- User Frontend
- Admin Frontend
Powerflow
│
├── powerflow-backend/ # Express API, Stripe, KYC, analytics, Power BI datasets
├── powerflow-frontend/ # User marketplace, wallet, forecasting UI
├── admin-frontend/ # Admin dashboard, EDA/KPI, Power BI hub, KYC
├── energy1/ # Django + ML forecasting service
├── docs/ # Extra documentation (if present)
└── README.md
- Configure all environment variables before running.
- Use your own MongoDB Atlas database.
- Use Stripe Test Keys during development.
- Add your own Gmail App Password for email services.
- Obtain an OpenWeather API Key for AI predictions.
- Set
POWERBI_API_KEYbefore connecting Power BI Desktop. - Never commit real
.envfiles, API keys, or.pbixpractice assets. - Ensure all five services are running simultaneously for a full demo.
- “UPI for Power” is branding; wallet recharge uses Stripe Checkout (cards) in this codebase.
- Admin “Export Excel/CSV” downloads CSV (UTF-8 BOM) that Excel opens natively.
- Publish Power BI reports to Power BI Service and embed via
VITE_POWERBI_EMBED_URL - Blockchain-based energy transactions
- Mobile Application
- Live IoT Smart Meter Integration
- Real-time Notifications
- Docker & Kubernetes Deployment
- CI/CD Pipeline
- Multi-language Support
If you found this project useful, consider giving it a ⭐ on GitHub.
It helps others discover the project!
