shipped
FleetKit
A control plane for bots, workers, cron, and inbound webhooks — one API and dashboard instead of scripts scattered across machines.
Problem
I needed one place for bots and background agents: a queue with retry and timeout, worker registration, cron, webhook → job, a dashboard, and API keys. Not a zoo of scripts on every box.
Approach
The React dashboard talks to the API with JWT; the SDK and workers use API keys. Jobs, schedules, and webhooks land in Postgres; Redis covers cache and live views. The scheduler ticks cron and enqueues scheduled jobs.
Попробовать
Демо на тестовых данных
Загружаем демо…
Engineering notes
Claim with FOR UPDATE SKIP LOCKED. Several workers take the next queued job without racing; SQLite smoke mode falls back to a plain SELECT.
# backend/fleetkit_api/services/jobs.py
stmt = (
select(Job)
.where(
Job.app_id == app.id,
Job.status == JobStatus.queued,
(Job.scheduled_for.is_(None)) | (Job.scheduled_for <= now),
)
.order_by(Job.created_at.asc())
.limit(1)
)
settings_url = str(getattr(db.bind, "url", ""))
if "sqlite" not in settings_url:
stmt = stmt.with_for_update(skip_locked=True)
Cron → job. tick_schedules computes next_run_at with croniter and enqueues a scheduled job.
DLQ and requeue. A job that burns through attempts goes to dead letter; requeue creates a new job with _requeued_from_dlq and marks the row.
Stack
Python 3.12, FastAPI, SQLAlchemy, Postgres / SQLite, Redis, React, Docker Compose.
Next
Unify the Postgres and SQLite claim paths behind one test contract. Add a real dashboard screenshot under docs/screenshots.
Links
Repo: github.com/blessed-bless/fleetkit. Local compose: localhost:8080 plus API docs.