74292814a557edcd7cf7100bc290889a4bb28168
Backend Todo App Template
Backend-only Bun + Express template intended to be snapshotted directly and mounted at /mnt/backend.
What it provides
GET /healthGET /todosPOST /todosGET /todos/:idPUT /todos/:idDELETE /todos/:idPOST /todos/:id/attachment/presignPOST /todos/:id/attachment/complete
Todos are stored in Turso/libSQL through the HTTP pipeline API. Attachments use Tigris or any S3-compatible endpoint through presigned PUT URLs.
Runtime contract
- app root is this folder
- start command:
bun run dev - listens on
PORT, default8080 - compatible with a direct snapshot mounted to
/mnt/backend
Setup
cp .env.example .env
bun install
bun run dev
Required env
.env and .env.example contain the full key set expected by the app:
PORTNODE_ENVAPI_PREFIXCORS_ORIGINLOG_LEVELPROJECT_IDDATABASE_URLDATABASE_AUTH_TOKENS3_ENDPOINTS3_BUCKETS3_PREFIXS3_ACCESS_KEY_IDS3_SECRET_ACCESS_KEYS3_SESSION_TOKEN
Attachment flow
- Create a todo with
POST /todos. - Request a presigned upload target with
POST /todos/:id/attachment/presign. - Upload the file directly to the returned
urlusing the returnedmethodandheaders. - Finalize the attachment metadata with
POST /todos/:id/attachment/complete.
Deleting a todo only removes the database record in v1. It does not delete the object from storage.
Description
Languages
TypeScript
93.4%
Dockerfile
4.8%
HTML
1.8%