A distributed polyglot gRPC microservice architecture orchestrating real-time spatial constellation data and streaming into an interactive 3D WebGL interface via Three.js.
Starcode Cluster showcases a high-throughput, polyglot backend where microservices written in Python, .NET 8, and Go compute spatial coordinates and stream node pulses over gRPC. A Node.js WebSocket Gateway bridges client events with these worker services, pushing real-time transformations directly into a Three.js canvas.
Igniting a specific sector routes matrix calculation requests to that language's dedicated worker. The incoming stream continuously morphs the core geometry, shifts ambient spectral lighting, and renders dynamic laser node rings.
[ Frontend (Three.js UI + HUD) ]
β
WebSocket (ws://localhost:8080)
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Node.js WebSocket Gateway β
β (Orchestrator & Router) β
βββββββ¬βββββββββββββββ¬βββββββββββββ¬ββββ
β β β
gRPC β (50051) gRPC β (50052) β gRPC (50053)
βΌ βΌ βΌ
βββββββββββββ βββββββββββββ βββββββββββββ
β Python β β .NET 8 β β Go β
β Worker β β Worker β β Worker β
βββββββββββββ βββββββββββββ βββββββββββββ
[ Frontend / UI ] [ Node.js Gateway ] [ Selected Worker ] [ Three.js Renderer ]
β β β β
βββ 1. Ignite Sector Click ββββββΊβ β β
β βββ 2. gRPC DecodeSector ββββββββΊβ β
β β (SectorRequest: ID, Nodes) β β
β β βββ 3. Matrix Computation ββββββββ€
β β β (Angles, Radii, Edges) β
β β β β
β βββ 4. gRPC Stream (SparkPulse) ββ β
β β β β
βββ 5. WebSocket Broadcast ββββββΊβ β β
β β βββ 6. UI / HUD Update βββββββββββ€
β β βββ 7. updateWorkerShape() ββββββΊβ
β β β (Morph Core: Box/Octa/Ico) β
β β βββ 8. Render Nodes & Lasers ββββΊβ
gRPC (Remote Procedure Calls) is an open-source, high-performance RPC framework initially designed by Google. Unlike standard REST/JSON setups that incur overhead by parsing string text over HTTP/1.1, gRPC runs atop HTTP/2 and packages payloads using Protocol Buffers (Protobuf).
- Binary Serialization: Protobuf serializes structured data into compact binary formats, drastically reducing network overhead.
- Bi-directional & Server Streaming: Allows workers to stream data packets (
SparkPulse) continuously back to the gateway in real-time. - Polyglot Code Generation: Enforces strict service contracts (
constellation.proto), allowing seamless integration across Python, .NET, and Go.
To ensure that Python, .NET, and Go workers generate identical, perfectly synchronized spatial constellations, a unified mathematical matrix algorithm is enforced across all microservices:
Nodes are distributed evenly across a full circle (
Radius distances (
Polar coordinates are mapped into 3D Cartesian space, incorporating vertical elevation noise along the
Constellation laser lines bind adjacent nodes into a closed loop network using modulo arithmetic:
| Worker Service | gRPC Port | Core Geometry | Core Color (Hex) | Mathematical Implementation |
|---|---|---|---|---|
| Python (NumPy) | 50051 |
IcosahedronGeometry |
#3776ab |
np.linspace + np.random.uniform |
| .NET 8 (C#) | 50052 |
BoxGeometry |
#512bd4 |
Trigonometric Math.Cos / Math.Sin loop |
| Go (Golang) | 50053 |
OctahedronGeometry |
#00add8 |
Cyclic array math & ring edge mapping |
The cluster is fully containerized and orchestrated via Docker Compose and Makefile. No manual runtime installations (Go, .NET, Python, Node.js) are needed on your host machine β only Docker and Make are required.
- Docker (v24.0+)
- Docker Compose (v2.20+)
make(pre-installed on Linux/macOS)
1. Clone the repository:
git clone [https://github.com/your-username/starcode-cluster.git](https://github.com/your-username/starcode-cluster.git)
cd starcode-cluster2. Build and ignite the entire cluster:
make buildOnce initialized, access the interfaces:
- Frontend UI (Three.js): http://localhost:3000
- WebSocket Gateway: ws://localhost:8080
| Command | Description |
|---|---|
make up |
Start all microservices in detached mode |
make build |
Rebuild images from scratch and start containers |
make logs |
Tail live log stream from all active services |
make restart |
Restart the entire cluster ecosystem |
make down |
Stop and remove running containers and networks |
make clean |
Purge environment (stop containers, remove volumes & orphan containers) |
make help |
Display available targets and descriptions |
Monitoring Tip: To observe gRPC streaming pulses between workers and the gateway in real-time while interacting with the 3D HUD, open a dedicated terminal and run:
make logs
Distributed under the MIT License. See LICENSE for more information.
