An open-source platform for managing Renewable Energy Communities (RECs) through blockchain-based incentive distribution, a local marketplace, and transparent governance tools.
RETE turns energy data into community tokens (ERC-20) that citizens can spend with local merchants, creating a circular economy loop that rewards sustainable energy behaviour.
RETE provides a complete operational stack for Energy Communities:
- Coordinator Dashboard -- Manage members, distribute tokens (individually or via CSV), configure blockchain settings, run burn cycles, and monitor community activity
- Citizen Dashboard -- View token balance, transaction history, wallet details, and browse the marketplace
- Provider Dashboard -- Create and manage products/services, track sales and token inflows
- Marketplace -- Citizens spend tokens on local goods and services using gasless permit-based transfers
- Multi-Chain Support -- Configurable chain profiles (Ethereum Sepolia, Alastria, or any EVM-compatible network)
┌─────────────────┐ ┌─────────────────────────┐ ┌──────────────┐
│ React Client │────▶│ Node.js / Express │────▶│ PostgreSQL │
│ (Vite) │◀────│ REST API + WebSocket │◀────│ (Drizzle ORM)│
└─────────────────┘ └──────────┬──────────────┘ └──────────────┘
│
▼
┌─────────────────────┐
│ EVM Blockchain │
│ (ERC-20 Tokens) │
└─────────────────────┘
Frontend: React 18, Vite, Tailwind CSS, Radix UI, TanStack Query, Wouter Backend: Node.js, Express, Drizzle ORM, Passport.js, Socket.IO, ethers.js Database: PostgreSQL Blockchain: ERC-20 smart contracts on any EVM-compatible chain (factory-based deployment)
- Factory-based ERC-20 token creation per community
- Minting via single entry or CSV batch upload
- Permit-based marketplace purchases (no manual approval needed)
- Periodic burn cycles with downloadable audit reports
- Token reset and chain switching
- Role-based access control (Coordinator, Provider, User)
- User invitation and onboarding
- CSV import/export for distribution and reporting
- Real-time WebSocket notifications for transactions and balance updates
- Product creation with categories and pricing in community tokens
- Community-scoped product visibility
- Purchase confirmation with on-chain verification
- Provider revenue tracking and analytics
- Session-based authentication with secure cookies
- Encrypted keystore export for wallet portability
- Role-based API access control
- Privacy by design principles
- Node.js 20+
- PostgreSQL 16+
- An EVM-compatible blockchain endpoint (e.g., Ethereum Sepolia RPC URL)
git clone <repository-url>
cd RETE
npm installCreate a .env file in the project root:
DATABASE_URL=postgresql://user:password@localhost:5432/rete
SESSION_SECRET=your-session-secretnpm run db:pushnpm run devThe application will be available at http://localhost:5000.
npm run build
npm run start├── client/ # React frontend (Vite)
│ ├── src/
│ │ ├── components/ # UI components (dashboard, marketplace, wallet, etc.)
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/ # Utility functions
│ │ └── pages/ # Page components
│ └── index.html
├── server/ # Node.js backend
│ ├── index.ts # Entry point
│ ├── routes.ts # API route definitions
│ ├── db.ts # Database connection
│ ├── storage.ts # Data access layer
│ ├── blockchain.ts # Blockchain interaction logic
│ ├── websocket.ts # WebSocket event handling
│ └── vite.ts # Vite dev server integration
├── shared/
│ └── schema.ts # Database schema (Drizzle ORM) and Zod validators
├── script/
│ └── build.ts # Production build script
├── drizzle.config.ts # Drizzle Kit configuration
├── vite.config.ts # Vite configuration
└── package.json
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Run production build |
npm run check |
TypeScript type checking |
npm run db:push |
Push schema changes to database |
This project was developed by Apio S.r.l. as part of the NGI TrustChain project (Open Call 5), funded by the European Union under Grant Agreement No. 101093274.
The platform was validated in collaboration with CER Pescara (Renewable Energy Community of Pescara, Italy).
MIT