Initial scaffold: Hammer Queue task dashboard
- Backend: Elysia + Bun + Drizzle ORM + PostgreSQL - Frontend: React + Vite + TypeScript + Tailwind CSS - Task CRUD API with bearer token auth for writes - Public read-only dashboard with auto-refresh - Task states: active, queued, blocked, completed, cancelled - Reorder support for queue management - Progress notes per task - Docker Compose for local dev and Dokploy deployment
This commit is contained in:
25
backend/src/index.ts
Normal file
25
backend/src/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Elysia } from "elysia";
|
||||
import { cors } from "@elysiajs/cors";
|
||||
import { taskRoutes } from "./routes/tasks";
|
||||
|
||||
const PORT = process.env.PORT || 3100;
|
||||
|
||||
const app = new Elysia()
|
||||
.use(cors())
|
||||
.use(taskRoutes)
|
||||
.get("/health", () => ({ status: "ok", service: "hammer-queue" }))
|
||||
.onError(({ error, set }) => {
|
||||
if (error.message === "Unauthorized") {
|
||||
set.status = 401;
|
||||
return { error: "Unauthorized" };
|
||||
}
|
||||
if (error.message === "Task not found") {
|
||||
set.status = 404;
|
||||
return { error: "Task not found" };
|
||||
}
|
||||
set.status = 500;
|
||||
return { error: "Internal server error" };
|
||||
})
|
||||
.listen(PORT);
|
||||
|
||||
console.log(`🔨 Hammer Queue API running on port ${PORT}`);
|
||||
Reference in New Issue
Block a user