---
title: "Add teenybase to an Existing Project"
description: "Add a teenybase backend to an app you already have: npx teenybase create backend scaffolds a self-contained backend folder you run and deploy on its own."
url: https://teenybase.com/docs/getting-started/existing-project
last_updated: 2026-10-26
---

> Documentation index: https://teenybase.com/llms.txt lists every teenybase docs page with a link to its Markdown version. All docs in one file: https://teenybase.com/llms-full.txt

# Add Teenybase to an Existing Project

You already have a frontend or app and want to add a teenybase backend.

> **Using a coding agent?** Paste this prompt:
>
> I want to add a teenybase backend to this existing project. Run `npx teenybase create backend --yes` in the project root to scaffold a self-contained backend folder (never `npx teeny`).
> Then edit backend/teenybase.ts to match what I need, and run `npx teenybase deploy --local --yes` and `npx teenybase dev` from the backend folder to test it.

## Create a backend folder

Run `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
npx teenybase create backend --yes
cd backend
npx teenybase deploy --local --yes
npx teenybase dev
```

Your 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.json
```

## Why a separate folder

- The backend has its own dependencies (`teenybase`, `hono`, `wrangler`). Keeping them separate avoids conflicts with your frontend's `package.json`.
- `npx teenybase deploy` and `npx teenybase dev` run 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

Deploy the backend to your own Cloudflare account:

```bash
cd backend
npx wrangler login          # one-time
npx teenybase deploy --remote --yes
```

## Next steps

- [Quickstart](https://teenybase.com/docs/getting-started/quickstart) for a full walkthrough
- [Connect Your Frontend](https://teenybase.com/docs/guides/frontend) for fetch examples, auth flow, CRUD
- [Integrate into an existing Hono worker](https://teenybase.com/docs/reference/integrate-existing-worker) if you need teenybase mounted inside an existing Cloudflare Worker instead of a separate folder
