A distributed, high-frequency energy negotiation engine for autonomous EV fleets using event-driven architecture.
Status: β Steel Thread Prototype Complete
Demo Ready: Full end-to-end data flow implemented
GreenLane solves the "Thundering Herd" problem for autonomous EV fleets competing for limited charging infrastructure. It demonstrates production-grade distributed systems patterns:
- High-throughput ingestion (5k+ events/sec)
- Geospatial indexing (Redis GEO commands)
- Event-driven architecture (Kafka/Redpanda)
- Time-series analytics (TimescaleDB hypertables)
- Real-time monitoring (Live Ops CLI)
./quickstart.sh- Docker & Docker Compose
- Go 1.23+ (install)
- Rust (install)
- Python 3.10+
- Protocol Buffers compiler (
brew install protobuf)
# 1. Start infrastructure (Redis, Redpanda, TimescaleDB)
make up
# 2. Generate protobuf code
make proto
cd simulator && ./generate_proto.sh && cd ..
# 3. Install Python dependencies
cd simulator && pip3 install -r requirements.txt && cd ..
# 4. Run the steel thread (open 5 terminals):
# Terminal 1:
make dev-mock-grid
# Terminal 2:
make dev-ingestion
# Terminal 3:
cd services/pricing-worker && RUST_LOG=info cargo run --release
# Terminal 4:
make dev-cli
# Terminal 5:
make dev-simulatorβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π GreenLane Live Ops CLI β
β Real-Time Fleet Monitoring β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[20:15:32] π’ CAR-001 | Battery: 85.3% | Location: (40.7234, -73.9876) | Speed: 45.2 km/h
[20:15:32] π‘ CAR-002 | Battery: 42.7% | Location: (40.7456, -73.9654) | Speed: 23.1 km/h
[20:15:32] π΄ CAR-003 | Battery: 12.1% | Location: (40.7123, -73.9987) | Speed: 8.3 km/h β οΈ CRITICAL BATTERY!
- Redpanda Console: http://localhost:8080 (view events in real-time)
- TimescaleDB:
postgresql://greenlane:greenlane_password@localhost:5432/greenlane - Redis:
localhost:6379 - Mock Grid API: http://localhost:8081/api/pricing
βββββββββββββββ gRPC Stream ββββββββββββββββ GEOADD βββββββββ
β EV Fleet ββββββββββββββββ>β Ingestion βββββββββββββ>β Redis β
β (Simulator) β Auth Token β Service(Go) β HSET β GEO β
βββββββββββββββ ββββββββ¬ββββββββ βββββββββ
β Emit Event
βΌ
ββββββββββββββββββ
β Redpanda β
β (Kafka API) β
βββββββββ¬βββββββββ
β Consume
βββββββββββββββββββΌββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββ
β Pricing β β Live Ops β β Future: β
β Worker(Rust) β β CLI (Go) β βDashboard β
ββββββββ¬ββββββββ ββββββββββββββββ ββββββββββββ
β HTTP GET
βΌ
ββββββββββββββββββββ
β Mock Grid β
β Service (Go) β
ββββββββ¬ββββββββββββ
β Write
βΌ
ββββββββββββββββββββ
β TimescaleDB β
β (Time-Series) β
ββββββββββββββββββββ
greenLane/
βββ Makefile # Control center (make up, make down, make logs)
βββ quickstart.sh # Automated setup script
βββ README.md # This file
βββ SETUP.md # Detailed installation guide
βββ TESTING.md # End-to-end testing walkthrough
βββ ARCHITECTURE.md # Deep dive into system design
βββ PROJECT_SUMMARY.md # Executive summary
βββ deploy/
β βββ docker-compose.yml # All infrastructure (Redis, Redpanda, TimescaleDB)
β βββ init-db.sql # TimescaleDB schema initialization
βββ proto/
β βββ fleet.proto # gRPC service + message definitions
βββ services/
β βββ ingestion/ # Go gRPC server (port 50051)
β βββ pricing-worker/ # Rust Kafka consumer
β βββ mock-grid/ # Go HTTP server (port 8081)
βββ simulator/ # Python gRPC client (fleet simulation)
βββ cli/ # Live Ops monitoring tool
βββ scripts/
βββ generate-proto.sh # Protobuf code generation
# 1. Verify Redis geospatial data
docker exec -it greenlane-redis redis-cli GEORADIUS fleet:locations -73.9876 40.7234 10 km WITHCOORD
# 2. Verify Redpanda events
open http://localhost:8080
# 3. Query TimescaleDB
docker exec -it greenlane-timescaledb psql -U greenlane -d greenlane -c "SELECT * FROM charging_sessions ORDER BY time DESC LIMIT 5;"
# 4. Check service status
make status- SETUP.md - Complete installation guide
- TESTING.md - End-to-end testing instructions
- ARCHITECTURE.md - System design deep dive
- PROJECT_SUMMARY.md - Executive overview
make help # Show all available commands
make up # Start infrastructure
make down # Stop all services
make logs # View logs from all containers
make proto # Generate protobuf code
make build-all # Build all services
make clean # WARNING: Remove all data
make status # Show container status- gRPC Bidirectional Streaming - Real-time, full-duplex communication
- Event Sourcing - Kafka/Redpanda as source of truth
- Geospatial Indexing - Redis GEO commands for proximity queries
- Time-Series Optimization - TimescaleDB hypertables for temporal data
- Microservices Decoupling - Independent services communicating via events
- Observability - Redpanda Console + Live Ops CLI for debugging
- gRPC telemetry ingestion
- Redis geospatial storage
- Redpanda event streaming
- Rust pricing worker
- TimescaleDB persistence
- Live Ops CLI
- Lua script for slot reservation
- Redis distributed locking
- Booking expiration (TTL)
- WebSocket hub
- React + Deck.gl frontend
- Map visualization
- mTLS authentication
- Prometheus metrics
- Grafana dashboards
- Kubernetes deployment
MIT License
Built with β‘. Brought to you by Ashish Reddy Tummuri