A comprehensive power monitoring platform built with modern web technologies for tracking electricity consumption, managing bills, analytics, and power-related notifications.
Access Now: Power-Manager
Monitor and manage your power consumption directly in your browser with real-time data integration.
Important
Next.js Integration: This application uses Next.js 15 with Supabase for real-time data handling and storage.
Smart Notifications: Set up power limit alerts via Telegram bot to stay informed about consumption thresholds and take timely action.
Comprehensive Dashboard: Real-time overview of power consumption with visual analytics and key metricsNext.js Framework: Modern React-based application with server-side rendering and API routesSupabase Integration: Real-time database with PostgreSQL and Row Level Security for data managementPower Analytics: Advanced charting and statistical analysis of consumption patterns and trendsBill Management: Track and manage electricity bills with detailed breakdown and cost analysisSmart Notifications: Telegram bot integration for power limit alerts and consumption milestonesActivity Logging: Comprehensive logging system for all power-related events and activitiesReal-time Monitoring: Live updates and monitoring of power consumption and system statusData Visualization: Interactive charts powered by Recharts for better understanding of usage patternsResponsive Design: Optimized for desktop, tablet, and mobile devices with Shadcn/UI componentsTypeScript Support: Full type safety and enhanced developer experienceProduction Ready: Built with modern best practices and security considerations
- Frontend: Next.js 15, React 18, TypeScript
- Database: Supabase (PostgreSQL) with real-time subscriptions
- Styling: Tailwind CSS with Shadcn/UI component library
- Charts: Recharts for interactive data visualization
- Notifications: Telegram Bot API integration
- Icons: Lucide React icon library
- Development: Turbopack, ESLint, Hot reload
-
Clone the repository
git clone https://github.com/Max-Eee/Power-Manager.git cd Power-Manager -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local
-
Configure your environment variables in
.env.local:# Supabase Configuration NEXT_PUBLIC_SUPABASE_URL=your_supabase_url_here NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key_here SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key_here # Telegram Bot Configuration TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here TELEGRAM_CHAT_ID=your_telegram_chat_id_here # App Configuration NEXT_PUBLIC_APP_URL=http://localhost:3000 NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your_nextauth_secret_here # Database Configuration DATABASE_URL=your_supabase_database_url_here
-
Create a new Supabase project at supabase.com
-
Run the migration script
- Go to your Supabase dashboard
- Navigate to SQL Editor
- Copy and paste the contents of
supabase/migrations/001_initial_schema.sql - Execute the query
-
The migration will create:
profiles- User profiles and preferencespower_status- Power ON/OFF trackingpower_consumption- Daily consumption recordsnotifications- System notificationssystem_logs- Activity logs- Row Level Security policies
- Indexes for performance
-
Create a Telegram Bot
- Message @BotFather on Telegram
- Use
/newbotcommand - Get your bot token
-
Get your Chat ID
- Message your bot
- Visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Find your chat ID in the response
-
Add tokens to your environment file
-
Development mode
npm run dev
-
Production build
npm run build npm start
-
Open your browser
- Navigate to http://localhost:3000
- View current power status
- See consumption statistics
- Monitor system health
- Report power outages
- Mark power restoration
- View outage history
- Add daily meter readings
- View consumption charts
- Track costs and trends
- Configure notification preferences
- View notification history
- Test Telegram integration
- Monitor all system activities
- Filter and search logs
- Export log data
power_outage- When power goes outpower_restored- When power comes backdaily_summary- Daily consumption summaryweekly_report- Weekly consumption reportmaintenance_alert- System maintenance alerts
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy
- Build the application:
npm run build - Deploy the
.nextfolder to your hosting provider - Ensure environment variables are set

