A modern, real-time energy monitoring and intelligence platform built with Next.js 16, React 19, and Google Generative AI. Provides intelligent insights for building energy optimization using Firebase real-time database and advanced visualization.
- Real-Time Energy Monitoring: Live tracking of energy consumption across multiple buildings
- AI-Powered Insights: Google Generative AI integration for intelligent energy-saving recommendations
- Digital Twin Visualization: Interactive 3D building visualization with Three.js and React Three Fiber
- Firebase Authentication: Secure Google sign-in integration
- Real-Time Database: Firebase Realtime Database for instant data synchronization
- Advanced Analytics: Dashboard with historical data analysis and trend visualization
- Responsive Design: Mobile-first UI with Tailwind CSS and Radix UI components
- Dark Theme: Modern dark mode optimized for energy management interfaces
- Frontend Framework: Next.js 16.1.1 with TypeScript
- UI Library: React 19.2.3
- Styling: Tailwind CSS 4 + PostCSS
- UI Components: Radix UI, Lucide React Icons
- 3D Visualization: Three.js, React Three Fiber, Drei
- AI Integration: Google Generative AI (Gemini API)
- Backend: Firebase (Authentication, Realtime Database)
- Animation: Framer Motion
- Charts: Recharts
- Notifications: Sonner
- Utilities: Clsx, Tailwind Merge
- Node.js 18+ and npm/yarn
- Firebase project with Realtime Database enabled
- Google Generative AI API key
- Git
- Clone the repository:
git clone https://github.com/your-username/energy-digital.git
cd energy-digital- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.localEdit .env.local with your Firebase and Google API credentials.
- Run the development server:
npm run devOpen http://localhost:3000 to see the application.
energy-digital/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── layout.tsx # Root layout
│ │ ├── page.tsx # Home page with auth
│ │ └── globals.css # Global styles
│ ├── components/
│ │ ├── features/ # Feature components (Dashboard, Views)
│ │ ├── layout/ # Layout components (Sidebar)
│ │ ├── ui/ # UI components (Core, Visuals, LightRays)
│ │ └── shared/ # Shared components (AuthProvider)
│ └── lib/
│ ├── service.ts # Firebase & Gemini API integration
│ └── Utils.ts # Utility functions
├── public/ # Static assets
├── functions/ # Firebase Cloud Functions
├── package.json
├── tsconfig.json
├── next.config.ts
└── tailwind.config.ts
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLint
See .env for required Firebase and Google API configuration.
- Real-time energy consumption metrics
- Quick statistics with historical trends
- Interactive charts and visualizations
- Building-specific analytics
- Automatic energy-saving recommendations
- Anomaly detection
- Fallback insights when API quota is exhausted
- Technical energy optimization tips
- Digital twin 3D visualization
- Equipment status monitoring
- System health indicators
The application uses Firebase for:
- Authentication: Google OAuth sign-in
- Realtime Database: Store and sync energy data
- Cloud Functions: Automated energy data simulation and cleanup (every minute)
Fully responsive design supporting:
- Mobile devices (320px+)
- Tablets (768px+)
- Desktop (1024px+)
Contributions are welcome! Please feel free to submit a Pull Request.
For support, please open an issue on GitHub.