Energy Leak Scout is an Earth Day themed full-stack app that helps users understand and reduce household electricity use.
The app lets users log in, enter daily appliance usage (hours/day), and instantly see estimated energy impact in kWh, cost, and CO2. It also provides AI-assisted explanations for high consumption and practical savings recommendations.
This project is about turning abstract energy data into everyday action.
- Awareness: makes hidden energy waste visible.
- Action: gives clear recommendations users can follow immediately.
- Impact: links personal behavior to cost savings and lower emissions.
- User logs in with Auth0.
- User enters appliance usage (hours/day).
- App calculates estimated usage and insights.
- User taps Why high?
- Backend verifies Auth0 token, then asks Cohere for a concise explanation.
- App displays explanation plus practical tips.
- Flutter (frontend)
- Node.js + Express (backend)
- Auth0 (authentication and API protection)
- Cohere (AI explanation generation)
- Flutter app: lib/main.dart
- Backend API: backend/server.js
- Backend package config: backend/package.json
- Backend env template: backend/.env.example
Install Flutter dependencies:
flutter pub getRun with environment values:
flutter run \
--dart-define=AUTH0_DOMAIN=your-tenant.auth0.com \
--dart-define=AUTH0_CLIENT_ID=your-auth0-client-id \
--dart-define=AUTH0_AUDIENCE=https://api.energy \
--dart-define=BACKEND_BASE_URL=http://localhost:8000Android emulator note:
- Use
http://10.0.2.2:8000forBACKEND_BASE_URL.
Create these in Auth0:
- Application type: Native (and/or SPA for web testing).
- API Identifier:
https://api.energy. - Callback and logout URLs for your platform(s) (for example local web URL).
- Keep domain/client ID/audience consistent across Flutter and backend.
From the backend folder:
cd backend
npm installThis creates backend/node_modules locally. Do not commit this folder.
Create local environment file:
# Windows PowerShell
Copy-Item .env.example .env
# macOS/Linux
# cp .env.example .envThen edit .env with your values:
PORT(default:8000)AUTH0_DOMAIN(example:your-tenant.auth0.com)AUTH0_AUDIENCE(example:https://api.energy)COHERE_API_KEYCOHERE_MODEL(default:command-r-08-2024)
Start backend:
npm run devHealth check:
curl http://localhost:8000/healthIf COHERE_API_KEY is missing or Cohere fails, backend automatically returns a local fallback explanation and tips so the app still works.
backend/.envis machine-local and should stay out of version control.node_modulesis generated by npm install and should not be committed.- Keep
backend/.env.examplecommitted so teammates know required variables.