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
| Command | Purpose |
|---|---|
pnpm dev | Start the Vite and Workers development server |
pnpm build | Build the SPA and Hono Worker |
pnpm preview | Preview the production build in the Workers runtime |
pnpm typecheck | Run TypeScript checks |
pnpm db:generate | Generate a Drizzle migration |
pnpm db:migrate:local | Migrate local D1 |
pnpm db:migrate | Migrate 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.
Public direct links (optional)
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
- Register an account and complete email verification.
- Use built-in R2 or configure S3-compatible storage.
- Upload an image; Tuxia deduplicates it and creates a shareable link.
- Issue an API token when a script or client needs upload access.
- Publish selected images to the public gallery, or keep them private.