Hive — peer-powered CI/CD.

A decentralized CI/CD platform that turns idle machines into a distributed build fleet.

RoleArchitecture · Full-stack
Year2026
StackFastAPI · Next.js 15 · Docker
RecognitionFYP Competition — 1st place
Overview
Problem
Idle machines, rented runners
Approach
Peer agents, credit ledger
Tiers
Coordinator · Agent · Dashboard
Isolation
Docker, per job

Traditional CI/CD runners are expensive and centralized — you rent someone else’s machine while your own hardware sits idle. Hive inverts that model: anyone can install a lightweight agent daemon on a spare machine and contribute it to a shared compute grid.

A central FastAPI coordinator schedules work across contributed machines using weighted fair queuing, streams container logs back in real time over WebSockets, and meters CPU and RAM per second against a credit economy. Contributors earn credits by running jobs; requesters spend them.

Architecture

Independently deployable, deliberately separate.

01

Coordinator

Owns all state and every decision. A 20-endpoint REST API behind JWT auth, an async scheduling loop on a 5-second tick, per-second metering against balances, and a WebSocket hub fanning updates out to dashboards. It never executes user code itself.

FastAPI · SQLAlchemy 2.0 · PostgreSQL

02

Agent

A cross-platform daemon that registers, heartbeats CPU and RAM telemetry, and polls for work matching its free capacity. It claims a job, downloads the payload, runs it in an isolated container and streams stdout upstream in chunks as it goes.

Python · Docker SDK · psutil · PyInstaller

03

Dashboard

Job submission, a live grid of every node’s status and utilization, per-step pipeline inspection, streaming log panels, credit history and analytics — all driven by the socket rather than a refresh button.

Next.js 15 · React 19 · Tailwind v4

Three tiers, one grid.

Dashboard

Every node, live.

A channel-based WebSocket manager pushes grid-wide snapshots to /ws/dashboard. Queue depth, running jobs, agents online and credit flow update themselves — nothing polls.

  • Job distribution and cluster utilization
  • Average build and test duration
  • Credit balance trend, earned against spent
Submission

Priced before you spend.

Upload a zip or point at a Git repo, pick a simple command or a multi-step pipeline, and set the cores, RAM and array size. The cost preview breaks out the base fee against metered compute before anything is dispatched.

  • Base network fee plus variable compute
  • Array task nodes fan out to child jobs
  • Recent jobs stream their status inline
Contribution

A node you can toggle.

The agent ships as a system-tray desktop app so a non-technical contributor can bring capacity online without a terminal. Cores and RAM are capped per node, and logs stream upstream while the container is still running.

  • Per-node CPU and RAM ceilings
  • Live running-job count per peer
  • Packaged to a standalone executable
Under the hood

The hard part was never running a container.

No permanent starvation01

Weighted fair queuing

Balance influences priority, but wait time compounds continuously — so a long-queued job from a low-balance user eventually outranks a wealthy one. Agents sort independently by remaining capacity, descending: a best-fit placement.

weight = wait_seconds × (1 + balance × 0.05)
Unplug a node mid-build02

Failure-tolerant placement

Miss the heartbeat and the agent is marked offline; anything running on it is detected as orphaned and requeued with its binding cleared. A node can be unplugged mid-build without losing work.

  1. heartbeat lost
  2. offline
  3. orphaned
  4. requeued

system_error and abandoned stay separate terminal states, so an agent crash never looks like an unclaimed job.

Fully auditable03

An immutable ledger

Every movement writes a transactions row instead of mutating a counter, so any balance reconstructs from history.

Base fee, on dispatch−2.0
Per core-second−0.03
Per GB-second−0.007
Node, clean completion+1.0
Node, on failure−0.5
Parametric sweeps04

Pipelines and job arrays

Each step carries its own status, timestamps and captured output, so a failure names the stage rather than dumping one undifferentiated log.

  1. install
  2. test
  3. deploy

array_size > 1 fans out into N child jobs sharing a single payload.

Built with

Backend
Python 3.12FastAPISQLAlchemy 2.0AlembicPydantic v2python-josepasslib / bcryptwebsockets
Frontend
Next.js 15React 19TypeScriptTailwind CSS v4shadcn/uiRadix UIRecharts
Agent
Docker SDKpsutilpystrayFlaskpywebviewPyInstaller
Data
PostgreSQL 156-table schemaAlembic
Infra
DockerDocker Compose
Next project

Knex