Mini Spark + Flink + Firebase β Built for Production Scale
Features β’ Architecture β’ Quick Start β’ Dashboard β’ API β’ Documentation
StreamForge is a production-ready, fault-tolerant distributed data processing platform that handles high-volume event streams with:
|
|
stream("events")
.filter(_.type == "click")
.window(sliding(5.min))
.aggregate(sum("value"))
.sink("dashboard") |
|
|
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATA SOURCES β
β IoT β’ Logs β’ Web Events β’ APIs β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β π΅ KOTLIN API LAYER (Port 8080) β β
β β β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β β β REST API β β gRPC β β WebSocket β β Scheduler β β β
β β β (Ktor) β β Service β β Metrics β β (Quartz) β β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β β Coroutines β’ Backpressure β’ Flow Control β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β π΄ SCALA PROCESSING ENGINE β β
β β β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β β β Custom DSL βββββΆβ Stream GraphβββββΆβ Operators βββββΆβ Windowing β β β
β β β Parser β β Builder β β Map/Filter β β Aggregate β β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β β Akka Streams β’ Reactive β’ Backpressure β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β π’ JAVA INFRASTRUCTURE LAYER β β
β β β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β β β Checkpoint β β State β β Cluster β β Recovery β β β
β β β Manager β β Store β β Coordinator β β Manager β β β
β β β (RocksDB) β β (RocksDB) β β (ZooKeeper) β β (Health) β β β
β β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β β
β β Exactly-Once β’ Fault Tolerance β’ High Availability β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π‘ FLUTTER DASHBOARD β
β (Port 3000) β
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Cluster β β Job β β Job β β
β β Health β β Metrics β β Management β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β
β Real-Time Charts β’ WebSocket β’ Material 3 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
StreamForge consists of a Kotlin/Scala/Java Backend and a Cross-Platform Flutter Dashboard. You can run the dashboard completely standalone (using its Mock Engine) or alongside the real backend.
- Flutter 3.0+ β Required for the Dashboard App/Website.
- JDK 17+ β Required if running the Kotlin/Scala Backend.
- Docker β Required for running the full cluster easily.
The dashboard has a built-in Stateful Mock Engine. This means you can run it perfectly without ever starting the backendβideal for testing, design, or showcasing the UI. Because it's built with Flutter, you can run it on any platform from the exact same codebase!
First, navigate to the dashboard directory:
cd dashboard-flutter
flutter pub getTo run the dashboard locally in your browser:
flutter run -d web-server --web-port 3000Then, open http://localhost:3000 in your browser. (Note: On small screens, the UI automatically transforms into a mobile-friendly layout with a bottom navigation bar!)
To run the dashboard as a native mobile application on your connected smartphone or an emulator:
# To see available devices (Emulators, physical devices)
flutter devices
# Run on Android or iOS
flutter runTo compile it into a high-performance native desktop application:
# Enable desktop support if you haven't already
flutter config --enable-windows-desktop
flutter config --enable-macos-desktop
# Run the app natively
flutter run -d windows # or -d macosIf you want to run the real Scala processing engine and Kotlin API:
# Start all microservices (API, Engine, ZooKeeper, Dashboard)
docker-compose up -d
# API is available at: http://localhost:8080
# Dashboard is available at: http://localhost:3000Open two separate terminals in the project root:
Terminal 1 (Backend):
# Build all Java/Scala/Kotlin modules
./gradlew build
# Run the API server
./gradlew :api-kotlin:runTerminal 2 (Dashboard):
cd dashboard-flutter
flutter run -d web-server --web-port 3000curl -X POST http://localhost:8080/api/jobs \
-H "Content-Type: application/json" \
-d '{
"id": "click-analysis",
"name": "Click Stream Analysis",
"type": "STREAMING",
"config": {
"source": "events",
"sink": "dashboard",
"parallelism": 4,
"checkpointInterval": 60000
}
}'curl -X POST http://localhost:8080/api/ingest/event \
-H "Content-Type: application/json" \
-d '{
"id": "evt-001",
"type": "click",
"timestamp": "2025-12-22T20:00:00Z",
"source": "web-app",
"payload": {"page": "/products", "userId": "user-123"}
}'curl http://localhost:8080/api/jobs/click-analysis| Metric | Value |
|---|---|
| Throughput | 10,000+ events/second per node |
| Latency | < 20ms average processing |
| Recovery | < 2 seconds from checkpoint |
| Scalability | Horizontal scaling with ZooKeeper |
streamforge/
βββ π README.md, LICENSE, CONTRIBUTING.md, CHANGELOG.md
βββ π³ docker-compose.yml, Dockerfile.api, Dockerfile.engine
β
βββ π΄ engine-scala/ # Scala Processing Engine
β βββ dsl/, window/, operators/, StreamProcessor, BatchProcessor
β
βββ π’ infrastructure-java/ # Java Infrastructure
β βββ checkpoint/, state/, cluster/, recovery/
β
βββ π΅ api-kotlin/ # Kotlin API Layer
β βββ Application, JobAPI, IngestionAPI, MetricsAPI, Scheduler
β
βββ π‘ dashboard-flutter/ # Flutter Dashboard
β βββ pages/, services/, Dockerfile, nginx.conf
β
βββ π docs/ # Documentation
β βββ ARCHITECTURE.md, API.md, DEPLOYMENT.md
β
βββ π examples/ # Examples
βββ example_pipeline.scala, sample_job.json
| Document | Description |
|---|---|
| Architecture | System design, data flow, components |
| API Reference | REST endpoints, WebSocket, models |
| Deployment | Docker, Kubernetes, production setup |
| β Production Ready | Fault-tolerant with exactly-once semantics |
| β Modern Stack | Multi-language architecture optimized for each layer |
| β Beautiful Dashboard | Real-time visualization with Flutter |
| β Developer Friendly | Declarative DSL, comprehensive APIs |
| β Big-Tech Patterns | Implements designs from Spark, Flink, Samza |
This project is licensed under the MIT License β see LICENSE for details.