← Toolshelf
Tuxia

Tuxia

图匣Live

An image management and hotlinking service that runs on Cloudflare Workers.

Tuxia · Manual

Tuxia is self-hosted. You need a Cloudflare account to deploy it.

Requirements

  • Node.js 24.x
  • pnpm 11.x
  • A Cloudflare account with Workers, R2, and D1

Local development

Create .dev.vars in the project root with a Better Auth secret:

BETTER_AUTH_SECRET=<your-secret>

Install dependencies, initialize local D1, and start development:

pnpm install
pnpm db:migrate:local
pnpm dev

Open http://localhost:5173.

Commands

CommandPurpose
pnpm devStart the Vite and Workers development server
pnpm buildBuild the SPA and Hono Worker
pnpm previewPreview the production build in the Workers runtime
pnpm typecheckRun TypeScript checks
pnpm db:generateGenerate a Drizzle migration
pnpm db:migrate:localMigrate local D1
pnpm db:migrateMigrate remote D1

Deployment

wrangler.jsonc defines the D1 database and R2 bucket. Set the production secret, migrate the database, and deploy:

pnpm wrangler secret put BETTER_AUTH_SECRET
pnpm db:migrate
pnpm deploy

The deployment builds the React SPA and Hono Worker, then publishes one Worker with Static Assets.

If the R2 bucket exposes an r2.dev URL or custom domain, set:

R2_PUBLIC_BASE_URL=https://files.example.com

/api/file/:id will then return a 302 redirect to the public object URL instead of proxying the file through the Worker.

Daily use

  1. Register an account and complete email verification.
  2. Use built-in R2 or configure S3-compatible storage.
  3. Upload an image; Tuxia deduplicates it and creates a shareable link.
  4. Issue an API token when a script or client needs upload access.
  5. Publish selected images to the public gallery, or keep them private.
Toolshelf

A shelf of small tools Braden builds with AI. Each ships with its own intro, manual, and privacy policy.

Tools

Site

© 2026 Braden. All rights reserved.Built with Modern.js · MDX