Track energy usage, forecast monthly costs, and hit your power targets — all in real time.
PowerPause is a full-stack energy monitoring dashboard built with FastAPI and React. It receives live power readings from an ESP32 device (or simulator), stores them in a Postgres database, and displays real-time analytics through a clean web interface.
powerpause/
├── backend/ # FastAPI backend (Python)
├── frontend/ # React + Vite frontend
└── README.md
- Python 3.11+
- Node.js 18+
- A Postgres database (Supabase recommended)
cd backend
# Create and activate virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # Mac/Linux
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Fill in your values in .env
# Start the server
uvicorn main:app --reload --port 8081The backend will be available at http://127.0.0.1:8081.
API docs at http://127.0.0.1:8081/docs.
cd frontend
# Install dependencies
npm install
# Configure environment
cp .env.example .env.local
# Fill in your values in .env.local
# Start the dev server
npm run devThe frontend will be available at http://localhost:5173.
To simulate power readings without hardware and since the simulator requires a paid hosted worker, run it locally to stream live data to the dashboard:
cd backend
python esp32_simulator.pyMake sure your backend/.env has:
API_URL=https://powerpause.onrender.com/api/readings
The simulator sends a power reading every 5 seconds to the deployed backend. Keep it running in a terminal while using the dashboard to see live data.
| Variable | Description |
|---|---|
DATABASE_URL |
Postgres connection string |
FRONTEND_URL |
Frontend URL for CORS (e.g. https://your-app.vercel.app) |
| Variable | Description |
|---|---|
VITE_API_BASE_URL |
Backend API URL (e.g. https://your-backend.onrender.com) |
- Create a new Web Service on Render
- Connect your GitHub repo and set the root directory to
backend - Set build command:
pip install -r requirements.txt - Set start command:
uvicorn main:app --host 0.0.0.0 --port 8081 - Add environment variables in Render dashboard
- Import your GitHub repo on Vercel
- Set the root directory to
frontend - Add
VITE_API_BASE_URLin Vercel project settings → Environment Variables - Deploy
| Layer | Tech |
|---|---|
| Frontend | React 18, Vite, Recharts, React Router |
| Backend | FastAPI, asyncpg, Pydantic, Uvicorn |
| Database | Postgres (via Supabase) |
| Auth | LocalStorage session (demo mode) |
| Deployment | Vercel (frontend), Render (backend) |
MIT


