How rayen-segni/enerx works
EnerX is a solar-project crowdfunding MVP with a dashboard for identity verification, project creation, primary investment, token resale, production submissions, and AI forecasts. The README describes the end-to-end flows and simulated-money and Hedera boundaries; sampled files confirm selected dashboard, identity, forecast, and Hedera implementations. Several route and service files were not sampled, so those subsystem links rely on README statements rather than inspected call sites.
Main entry points: api.ts Frontend API clients · database.py PostgreSQL data · dashboard.tsx Dashboard state · production.py Production distributions
Components 23
User portal
- Dashboard state
frontend/components/enerx/dashboard.tsx - Investment views
frontend/components/enerx/invest - Owner tools
frontend/components/enerx/owner - AI forecast view
frontend/components/enerx/ai/ai-predictor-tab.tsx - Frontend API clients
frontend/lib/enerx/api.ts
Application backend
- Identity verification
backend/app/routes/auth.py - Project creation
backend/app/routes/project.py - Primary investment
backend/app/routes/investments.py - Token marketplace
backend/app/routes/marketplace.py - Production distributions
backend/app/routes/production.py - Business services
backend/app/services - PostgreSQL data
backend/app/database.py
Hedera integrations
- Hedera client
backend/hedera/client.py - DID registration
backend/hedera/did_service.py - Token service
backend/hedera/token_service.py - Project commitment
backend/hedera/file_service.py - Distribution contract
backend/hedera/contract_service.py
Forecast and news
- Model API
backend/model/api.py - Solar forecast
backend/model/production/forecast.py - Forecast aggregation
backend/model/production/aggregator.py - Energy news
backend/model/news/news_feed.py
Other components
- User
- Weather provider
Connections 34
- User → Dashboard state: uses
README.md - Dashboard state → Investment views: renders
frontend/components/enerx/dashboard.tsx - Dashboard state → Owner tools: renders
frontend/components/enerx/dashboard.tsx - Dashboard state → AI forecast view: renders
frontend/components/enerx/dashboard.tsx - Dashboard state → Frontend API clients: calls
frontend/components/enerx/dashboard.tsx - Frontend API clients → Identity verification: HTTP requests
README.md - Frontend API clients → Project creation: HTTP requests
README.md - Frontend API clients → Primary investment: HTTP requests
README.md - Frontend API clients → Token marketplace: HTTP requests
README.md - Frontend API clients → Production distributions: HTTP requests
README.md - Identity verification → PostgreSQL data: reads and writes
backend/app/routes/auth.py - Identity verification → DID registration: registers DID
backend/app/routes/auth.py - Project creation → Token service: creates token
README.md - Project creation → Project commitment: publishes commitment
README.md - Project creation → PostgreSQL data: stores metadata
README.md - Primary investment → Token service: transfers tokens
README.md - Primary investment → PostgreSQL data: records purchase
README.md - Token marketplace → Token service: transfers tokens
README.md - Token marketplace → PostgreSQL data: updates balances
README.md - Production distributions → Business services: allocates revenue
backend/app/services/production_service.py - Production distributions → PostgreSQL data: reads holdings
README.md - Production distributions → Distribution contract: records snapshot
README.md - Production distributions → PostgreSQL data: records payouts
README.md - Hedera client → Token service: configures client
backend/hedera/token_service.py - Hedera client → DID registration: provides client
backend/hedera/did_service.py - Hedera client → Project commitment: provides client
backend/hedera/file_service.py - Hedera client → Distribution contract: provides client
backend/hedera/contract_service.py - AI forecast view → Model API: requests forecasts
README.md - AI forecast view → Energy news: requests news
README.md - Model API → Solar forecast: runs forecast
backend/model/api.py - Model API → Forecast aggregation: aggregates results
backend/model/api.py - Model API → Energy news: loads news
backend/model/api.py - Solar forecast → Weather provider: fetches weather
backend/model/production/forecast.py - Forecast aggregation → Solar forecast: uses predictions
backend/model/production/aggregator.py