Initial boilerplate scaffold for continuum-backend

Bun + ElysiaJS control plane: Drizzle/Postgres schema (printers, farms,
print_jobs, pgvector frame_embeddings), R2 presigned URLs, Redis Streams
frame ingestion queue, REST routes, and the /ws/edge/v1 edge-gateway
WebSocket uplink.
This commit is contained in:
2026-08-28 16:13:57 +00:00
commit fad0a52690
20 changed files with 661 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { Elysia } from "elysia";
import { cors } from "@elysiajs/cors";
import { swagger } from "@elysiajs/swagger";
import { sql } from "drizzle-orm";
import { db } from "./db";
import { redis } from "./queue";
import { authRoutes } from "./routes/auth";
import { farmRoutes } from "./routes/farms";
import { printerRoutes } from "./routes/printers";
import { jobRoutes } from "./routes/jobs";
import { edgeWsRoute } from "./routes/ws/edge";
const app = new Elysia()
.use(cors())
.use(swagger({ path: "/docs" }))
.get("/health", async () => {
const [{ ok }] = await db.execute<{ ok: number }>(sql`select 1 as ok`);
const redisPing = await redis.ping();
return { status: "ok", db: ok === 1, redis: redisPing === "PONG" };
})
.use(authRoutes)
.use(farmRoutes)
.use(printerRoutes)
.use(jobRoutes)
.use(edgeWsRoute)
.listen(Number(process.env.PORT ?? 3000));
console.log(`continuum-backend listening on :${app.server?.port}`);
export type App = typeof app;