Tokenized renewable energy production shares with AI-powered predictions and automated credit distribution
Features β’ Architecture β’ Quick Start β’ Documentation
Solaria is a comprehensive blockchain-based platform that enables fractional ownership of renewable energy installations. By combining smart contracts, AI-powered predictions, and a user-friendly mobile application, Solaria makes green energy investment accessible to everyone.
- High Entry Barriers: Traditional renewable energy investments require significant capital
- Lack of Transparency: Investors struggle to verify actual energy production
- Complex Management: Tracking returns and credits is manually intensive
- Limited Access: Small investors are excluded from lucrative renewable projects
Solaria tokenizes renewable energy installations as ERC-1155 tokens, allowing anyone to purchase shares and receive proportional energy credits based on real-time production data verified by oracles and predicted by AI models.
- Multi-Energy Support: Solar, Wind, Hydro, Geothermal, Biomass, and more
- Fractional Ownership: Purchase shares representing portions of installations
- Automated Credits: Real-time production tracking and proportional distribution
- Secure Wallets: AES-256-GCM encrypted wallet storage with PBKDF2 key derivation
- Smart Contracts: Auditable, transparent, and immutable transactions
- Secondary Market: Enable/disable token transfers per project
- Energy Yield Forecasting: ML models predict kWh output per share
- Ensemble Learning: CatBoost, XGBoost, and LightGBM combined predictions
- Quality Control: Automated monitoring and anomaly detection
- Smart Data Lookup: Auto-fills missing technical data using dataset intelligence
- MLOps Pipeline: Continuous training and model optimization
- Cross-Platform: iOS, Android, Web, Windows, macOS, and Linux
- Real-Time Dashboard: Track investments and energy production
- Secure Authentication: JWT-based auth with encrypted local storage
- Project Discovery: Browse and invest in renewable energy projects
- Credit Claims: One-tap credit claiming directly from mobile
- RESTful API: NestJS-powered scalable architecture
- MongoDB Integration: Flexible data modeling for complex relationships
- Role-Based Access: Admin, Project Manager, Oracle, and Investor roles
- Email Notifications: Automated updates via Nodemailer
- Swagger Documentation: Interactive API documentation
- Security First: Input validation, rate limiting, and encryption
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SOLARIA ECOSYSTEM β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββ β
β β β β β β β β
β β Mobile βββββ>β Backend βββββ>β Blockchain β β
β β (Flutter) β β (NestJS) β β (Hardhat) β β
β β β β β β β β
β ββββββββββββββββ ββββββββββββββββ βββββββββββββββ β
β β β β β
β β βΌ β β
β β ββββββββββββββββ β β
β β β β β β
β βββββββββββββ>β MongoDB β<βββββββββββββ β
β β (Atlas) β β
β ββββββββββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββ β
β β β β
β β AI Services β β
β β (Python/FastAPI)β β
β β β β
β ββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Flutter 3.8.1: Cross-platform mobile framework
- Riverpod: State management and dependency injection
- Go Router: Type-safe navigation
- NestJS 11: Progressive Node.js framework
- MongoDB: NoSQL database with Mongoose ODM
- JWT Authentication: Secure token-based auth
- Passport: Authentication middleware
- Swagger: API documentation
- Hardhat: Ethereum development environment
- OpenZeppelin: Audited smart contract library
- ERC-1155: Multi-token standard
- Ethers.js: Blockchain interaction library
- Dione Protocol: Target blockchain network
- FastAPI: High-performance Python API framework
- CatBoost, XGBoost, LightGBM: Gradient boosting models
- Pandas & NumPy: Data processing
- Scikit-learn: ML utilities
- Docker: Containerized deployments
- Node.js 20 LTS or higher
- pnpm (recommended) or npm
- Flutter 3.8.1 or higher
- Python 3.9 or higher
- MongoDB 6.0 or higher
- Docker (for AI services)
git clone https://github.com/YassWorks/HackFST.git
cd HackFSTcd energy_token
pnpm install
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Compile contracts
pnpm hardhat compile
# Deploy to testnet
pnpm hardhat ignition deploy ./ignition/modules/EnergyToken.js --network dioneTestnet
# Run tests
pnpm hardhat testcd ../backend
pnpm install
# Configure environment
cp .env.example .env
# Edit .env with MongoDB URI, JWT secrets, contract address, etc.
# Run migrations (if any)
pnpm run migration:run
# Start development server
pnpm run start:devThe backend will be available at http://localhost:3000
API documentation: http://localhost:3000/api
cd ../mobile
flutter pub get
# Run on your preferred platform
flutter run -d chrome # Web
flutter run -d android # Android
flutter run -d ios # iOS
flutter run -d windows # Windows
flutter run -d macos # macOS
flutter run -d linux # Linuxcd ../ai
# Energy Prediction Service
cd pow_predict
docker-compose up -d
# Quality Control Service
cd ../quality_control
docker-compose up -dSolaria/
βββ energy_token/ # Smart contracts and blockchain
β βββ contracts/ # Solidity contracts
β βββ scripts/ # Deployment scripts
β βββ test/ # Contract tests
β βββ oracle/ # Production data oracle
β βββ docs/ # Blockchain documentation
β
βββ backend/ # NestJS REST API
β βββ src/
β β βββ auth/ # Authentication module
β β βββ blockchain/ # Smart contract integration
β β βββ projects/ # Project management
β β βββ investors/ # Investor management
β β βββ transactions/ # Transaction handling
β β βββ user/ # User management
β βββ test/ # API tests
β
βββ mobile/ # Flutter mobile app
β βββ lib/
β β βββ models/ # Data models
β β βββ pages/ # UI screens
β β βββ services/ # API services
β β βββ state/ # State management
β β βββ widgets/ # Reusable components
β β βββ router/ # Navigation
β βββ assets/ # Images and resources
β
βββ ai/ # AI/ML services
βββ pow_predict/ # Energy prediction API
β βββ models/ # Trained ML models
β βββ data/ # Training datasets
β βββ pipeline.py # MLOps pipeline
βββ quality_control/ # Production quality monitoring
βββ src/ # QC algorithms
- Energy Token README - Smart contract documentation
- Backend Integration Guide - Backend API integration
- Project Types - Supported energy project types
- Purchase Security - Wallet security implementation
- Testing Purchase Flow - End-to-end testing guide
- Energy Prediction API - AI model documentation
- Creation: Admin creates project with details (location, capacity, pricing)
- Active: Project opens for investment, shares available for purchase
- Operational: Installation complete, production data recorded by oracles
- Credit Distribution: Investors claim proportional energy credits
- Maturity: Project reaches end of lifecycle, final settlements
- ERC-1155: Each project has unique token ID
- Shares: Fixed supply per project based on installation capacity
- Pricing: Dynamic pricing based on project metrics
- Platform Fee: 2.5% fee on all share purchases
- Credits: Claimable energy credits (kWh) proportional to ownership
- Wallet Encryption: AES-256-GCM with PBKDF2 key derivation (100,000 iterations)
- Password Protection: User passwords never stored, only used for encryption
- Memory Safety: Private keys cleared immediately after use
- Role-Based Access: Granular permissions for different user types
- Oracle Verification: Production data verified by authorized oracles
- Emergency Pause: Circuit breaker for security incidents
cd backend
# Unit tests
pnpm run test
# E2E tests
pnpm run test:e2e
# Test coverage
pnpm run test:covcd energy_token
# Run all tests
pnpm hardhat test
# Test coverage
pnpm hardhat coverage
# Gas reporting
REPORT_GAS=true pnpm hardhat testcd mobile
# Run tests
flutter test
# Test coverage
flutter test --coveragecd energy_token
# Deploy to mainnet
pnpm hardhat ignition deploy ./ignition/modules/EnergyToken.js --network dionenet
# Verify contract
pnpm hardhat verify --network dionenet DEPLOYED_CONTRACT_ADDRESScd backend
# Build production
pnpm run build
# Start production server
pnpm run start:prodcd mobile
# Build for Android
flutter build apk --release
# Build for iOS
flutter build ios --release
# Build for Web
flutter build web --releasecd ai
# Deploy with Docker Compose
docker-compose -f docker-compose.prod.yml up -d- Smart contract implementation (ERC-1155)
- Backend API with authentication
- Mobile app (iOS, Android, Web)
- AI energy prediction models
- Wallet encryption and security
- Oracle integration
- Credit distribution system
- Secondary marketplace
- Advanced analytics dashboard
- Multi-chain support
- DAO governance
- OpenZeppelin - Secure smart contract library
- NestJS - Progressive Node.js framework
- Flutter - Beautiful cross-platform apps
- Dione Protocol - Blockchain infrastructure
- Hardhat - Ethereum development environment
Made with βοΈ for a sustainable future