A React-based dashboard application for connecting to Best.Energy API, performing statistical analysis, creating data visualizations, and providing insights for both internal employees and customers.
- 📊 Energy Dashboard - View energy consumption data with interactive charts
- 👥 Customer Management - Browse and view customer information
- 📈 Data Visualization - Real-time energy consumption charts using Recharts
- 📊 Statistical Analysis - Calculate energy statistics and insights
- 🔄 API Integration - Connect to Best.Energy API for real-time data
- 📤 Data Export - Export Wilson Center raw data to CSV for Tableau/AI analysis
- ⚡ Weekly Reports - Automated weekly energy analytics with anomaly detection and optimization recommendations
- React 18 - UI framework
- TypeScript - Type safety
- Vite - Build tool
- React Router - Navigation
- React Query - Data fetching and caching
- Axios - HTTP client
- Recharts - Data visualization
- date-fns - Date utilities
- Node.js 18+ and npm
-
Clone the repository
-
Install dependencies:
npm install
-
Create a
.envfile in the root directory:VITE_BEST_ENERGY_API_URL=https://api.best.energy VITE_BEST_ENERGY_API_KEY=your_api_key_here VITE_API_TIMEOUT=30000
-
Start the development server:
npm run dev
-
Open your browser to
http://localhost:5173
argo-energy-solutions/
├── docs/ # 📚 Documentation
│ ├── setup/ # Setup & configuration guides
│ ├── api/ # API documentation
│ ├── guides/ # Feature-specific guides
│ │ ├── data/ # Data collection & access
│ │ ├── reports/ # Report generation
│ │ └── integrations/ # Third-party integrations
│ ├── troubleshooting/ # Fixes & solutions
│ └── reference/ # Reference materials (PDFs)
├── backend/ # 🖥️ Backend services
│ ├── server/ # Node.js API server
│ ├── scripts/ # Data & analysis scripts
│ │ ├── analysis/ # Energy data analysis
│ │ ├── data-collection/ # Data fetching & ingestion
│ │ ├── database/ # Database management
│ │ ├── diagnostics/ # Diagnostic tools
│ │ ├── reports/ # Weekly analytics reports (NEW!)
│ │ └── utilities/ # Utility scripts
│ └── python_reports/ # Python analytics
│ ├── scripts/ # Python report scripts
│ ├── reports/ # Generated reports & charts
│ └── data/ # CSV data files
├── src/ # ⚛️ Frontend (React/TypeScript)
│ ├── components/ # Reusable components
│ │ ├── charts/ # Chart components
│ │ ├── common/ # Common UI components
│ │ └── layout/ # Layout components
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page components
│ ├── services/ # API and business logic
│ │ ├── api/ # API client and services
│ │ └── analytics/ # Statistical analysis
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
├── public/ # 📁 Public assets
├── .env.example # Environment variables template
├── package.json # Dependencies & scripts
└── README.md # This file
Comprehensive documentation is available in the docs/ directory, organized for use with MkDocs (see mkdocs.yml):
- Setup Guides:
docs/setup/- Installation and configuration - API Documentation:
docs/api/- API endpoints and configuration - Guides:
docs/guides/- Analytics, data export, reports - Integrations:
docs/guides/integrations/- Salesforce, Tableau, etc. - Architecture:
docs/architecture/- Schema, governance, planning - Troubleshooting:
docs/troubleshooting/- Common issues and fixes
Quick reference documents:
docs/CURRENT_STATUS.md- Current project statusdocs/NEXT_STEPS.md- Planned features and roadmapdocs/QUICK_REFERENCE.md- Quick command reference
To build the documentation site locally:
pip install mkdocs-material
mkdocs serveGenerate automated weekly energy analytics reports with:
- Sensor health monitoring - Detect missing data, stale meters, and flatlined sensors
- After-hours waste analysis - Identify equipment running unnecessarily outside business hours
- Anomaly detection - Statistical outlier identification using IQR method
- Demand spike detection - Peak power events and short-cycling identification
- Quick wins - Actionable recommendations ranked by impact and cost savings
Quick Start:
# Generate report for last week
npm run report:weekly -- --site YOUR_SITE_ID
# See full documentation
cat backend/scripts/reports/QUICKSTART.md
cat backend/scripts/reports/README.mdFor complete documentation, see backend/scripts/reports/README.md
The application is configured to connect to the Best.Energy API. Review docs/reference/Core_API_v1.pdf for complete API specifications.
# Data Collection & Analysis
npm run analyze:energy # Analyze energy data
npm run explore:channels # Explore available channels
npm run analyze:wilson # Wilson Center specific analysis
npm run diagnose:data # Diagnostic data access tests
npm run export:csv # Export data to CSV
npm run export:wilson:raw # Export Wilson Center raw monthly data to CSV
# Data Ingestion
npm run ingest:data # Ingest Eniscope data
npm run ingest:full # Full data ingestion
npm run ingest:incremental # Incremental ingestion
# Database & Health
npm run db:check # Check database status
npm run unit:health # Unit health report
npm run check:daily # Daily data check
# Weekly Analytics Reports (NEW!)
npm run report:weekly # Generate weekly exceptions & opportunities brief
npm run report:test # Run analytics unit tests
# Development
npm run dev # Start frontend dev server
npm run api:server # Start backend API server
npm run dev:all # Start both frontend and backend
npm start # Alias for dev:all- ✅ Project structure and API service layer
- ✅ React Router setup
- ✅ React Query integration
- ✅ Basic dashboard with charts
- ✅ Customer management pages
- 🔄 Statistical analysis utilities
- 🔄 Report generation
- 🔄 Insight generation
- 🔄 Scheduled reporting
npm run buildThe built files will be in the dist directory.
| Variable | Description | Default |
|---|---|---|
VITE_BEST_ENERGY_API_URL |
Best.Energy API base URL | https://api.best.energy |
VITE_BEST_ENERGY_API_KEY |
API authentication key | - |
VITE_API_TIMEOUT |
API request timeout (ms) | 30000 |
- Review
docs/NEXT_STEPS.mdfor planned features - Follow TypeScript best practices
- Ensure all components are typed
- Test API integration with mock data if needed
- Backend scripts go in
backend/scripts/(categorized by function) - Documentation goes in
docs/(organized by topic)
Copyright © 2024 Argo Energy Solutions. All rights reserved.