Add Teenybase to an Existing Project
You already have a frontend or app and want to add a teenybase backend.
Using a coding agent?
Create a backend folder
Run teeny create inside your project root. This creates a self-contained backend directory with its own package.json, teenybase.ts, worker entry point, and dev secrets.
bash
teeny create backend
cd backend
teeny deploy --local
teeny devbash
npx teeny create backend
cd backend
npx teeny deploy --local
npx teeny devYour backend API is at http://localhost:8787/api/v1.
Your project structure looks like this:
text
my-app/
src/ # your frontend
backend/ # teenybase backend (self-contained)
teenybase.ts
src/index.ts
wrangler.jsonc
.dev.vars
package.jsonWhy a separate folder
- The backend has its own dependencies (
teenybase,hono,wrangler). Keeping them separate avoids conflicts with your frontend'spackage.json. teeny deployandteeny devrun from the backend directory. No config needed to tell them where to find things.- You can version, deploy, and test the backend independently.
- If you use a monorepo tool (npm workspaces, turborepo, etc.), the backend folder is just another workspace.
Deploy
bash
cd backend
teeny register # one-time
teeny deploy --remotebash
cd backend
npx teeny register # one-time
npx teeny deploy --remoteNext steps
- Quickstart for a full walkthrough
- Connect Your Frontend for fetch examples, auth flow, CRUD
- Integrate into an existing Hono worker if you need teenybase mounted inside an existing Cloudflare Worker instead of a separate folder