Skip to content
/ tanstack-start-cf Public template

Starter template for tanstack-start with Bun, Biome, Lefthook, Tailwind & React Query deployed on Cloudflare with a KV & a D1 Database

Notifications You must be signed in to change notification settings

depsimon/tanstack-start-cf

Repository files navigation

Tanstack Start Cloudflare

This site is built with TanStack Start!

This template uses the following tools:

We use Alchemy to be orchestrate the deployment on Cloudflare with a KV & a D1 Database ready to be used.

Tip

Looking for a simpler template? Checkout the Start Basic template.

Installation

To setup a project from this template, the simplest way is to use gitpick:

git clone https://github.com/depsimon/tanstack-start-cf.git my-app
cd my-app
bun install
bun run deploy # Initial deployment of resources, required to use the bindings locally
bun db:migrate # Apply migrations locally

Development

From your terminal:

bun dev

This starts your app in development mode, rebuilding assets on file changes.

Deployment

When you're ready to deploy, you can run:

bun run deploy

By default, this will deploy a dev version of your app. If you want to deploy a different version, the deployment accepts a STAGE env that you can use to deploy any branch/environment.

bun run deploy # Will deploy resources in a `dev` namespace
STAGE=prod bun run deploy # Will deploy resources in a `prod` namespace
STAGE=staging bun run deploy # Will deploy resources in a `staging` namespace

Move the state to Cloudflare

By default the state of your resources is stored in the file system of your project.

You can change that by using another state storage like Durable Objects.

You can easily do that by adding a few env variables or by copying the .env.example to .env and adapting the values.

Read the documentation

About

Starter template for tanstack-start with Bun, Biome, Lefthook, Tailwind & React Query deployed on Cloudflare with a KV & a D1 Database

Resources

Stars

Watchers

Forks