How deekshhh37/smart-energy-chain works
Energy Wise is a React energy-monitoring dashboard: users sign in, view consumption and smart alerts, explore analytics, and review bills or export reports. The dashboard’s main data path loads a CSV and transforms it into display-ready usage statistics; authentication uses Supabase. README documents chatbot advice and analytics capabilities, but sampled source does not establish all backend connections, so those links are omitted. The analytics pages, edge functions, and several visual components were not sampled in full.
Main entry points: App.tsx Routes and app shell · Dashboard.tsx Dashboard page · Billing.tsx Billing page · AuthContext.tsx Authentication state
Components 25
Application and access
- Routes and app shell
src/App.tsx - Sign in
src/pages/Login.tsx - Protected routes
src/components/auth/ProtectedRoute.tsx - Authentication state
src/contexts/AuthContext.tsx - Dashboard navigation
src/components/layout/DashboardLayout.tsx
Energy insights
- Dashboard page
src/pages/Dashboard.tsx - CSV data processing
src/lib/csvDataProcessor.ts - Sample energy and bill data
src/lib/mockData.ts - Smart energy alerts
src/components/dashboard/AIAlerts.tsx - Usage line chart
src/components/dashboard/EnergyLineChart.tsx - Usage bar chart
src/components/dashboard/EnergyBarChart.tsx - Energy mix chart
src/components/dashboard/EnergyPieChart.tsx - Energy stat cards
src/components/dashboard/StatCard.tsx - Analytics page
src/pages/Analytics.tsx
Billing and reports
- Billing page
src/pages/Billing.tsx - Report export controls
src/components/dashboard/ReportExport.tsx - Report generation
src/lib/reportExport.ts
Assistant and services
- Supabase client
src/integrations/supabase/client.ts - Energy chat assistant
src/components/chat/EnergyChatbot.tsx - Chat edge function
supabase/functions/chat/index.ts - Local chat server
mock-chat-server.js - Analytics edge function
supabase/functions/analytics/index.ts - Energy alerts function
supabase/functions/energy-alerts/index.ts
Other components
- Dashboard user
- Supabase service
Connections 24
- Dashboard user → Routes and app shell: opens
src/App.tsx - Routes and app shell → Sign in: routes to
src/App.tsx - Routes and app shell → Protected routes: protects routes
src/App.tsx - Routes and app shell → Dashboard page: routes to
src/App.tsx - Routes and app shell → Analytics page: routes to
src/App.tsx - Routes and app shell → Billing page: routes to
src/App.tsx - Routes and app shell → Energy chat assistant: renders
src/App.tsx - Routes and app shell → Authentication state: provides auth
src/App.tsx - Protected routes → Authentication state: checks access
src/components/auth/ProtectedRoute.tsx - Authentication state → Supabase client: uses auth
src/contexts/AuthContext.tsx - Supabase client → Supabase service: connects to
src/integrations/supabase/client.ts - Dashboard page → Dashboard navigation: renders within
src/pages/Dashboard.tsx - Dashboard page → CSV data processing: loads data
src/pages/Dashboard.tsx - Dashboard page → Smart energy alerts: renders
src/pages/Dashboard.tsx - Dashboard page → Usage line chart: renders
src/pages/Dashboard.tsx - Dashboard page → Energy mix chart: renders
src/pages/Dashboard.tsx - Dashboard page → Energy stat cards: renders
src/pages/Dashboard.tsx - Dashboard page → Report export controls: renders
src/pages/Dashboard.tsx - Smart energy alerts → CSV data processing: loads data
src/components/dashboard/AIAlerts.tsx - Billing page → Dashboard navigation: renders within
src/pages/Billing.tsx - Billing page → Sample energy and bill data: reads bills
src/pages/Billing.tsx - Billing page → Report export controls: renders
src/pages/Billing.tsx - Billing page → Report generation: uses reports
src/pages/Billing.tsx - Energy chat assistant → Local chat server: connects to
README.md