TanStart Barren

March 19, 2026 ยท View on GitHub

๐Ÿ›ฅ๏ธ Boilerplate for ๐Ÿ๏ธ TanStack Start.

This boilerplate is part of a family of boilerplates:

Boilerplate / Starter kit Description
Tanstart A. J. Jolly Static site boilerplate for Tanstack Start.
Tanstart Barren Barebones boilerplate with Tanstack Start and basic Better Auth with password auth. Log in/sign on pages, dashboard and home page.
Tanstart Cumberland Starter kit that expands Tanstart Barren with Better Auth with organizations, account and admin screens, email, side bar for navigation and layout examples.
Tanstart Dale Hollow Starter kit that expands Tanstart Cumberland with maptiler maps and mastra. Not published yet.
Tanstart Eddy Starter kit that expands Tanstart Dale Hollow with examples of CRUD functionality.
Tanstart Eddy Playwright E2E tests for Tanstart Eddy.

Features:

  • Server:

    • Bun - Bun is a fast, incrementally adoptable all-in-one JavaScript, TypeScript & JSX toolkit.
    • Version React - The library for web and native user interfaces.
    • Version React Compiler - React Compiler is a new build-time tool that automatically optimizes your React app.
    • Version Vite - The Build Tool for the Web.
    • Version Nitro - Nitro extends your Vite application with a production-ready server, compatible with any runtime.
  • Linting and formatting:

  • TanStack:

  • Data:

    • PostgreSQL - The World's Most Advanced Open Source Relational Database.
    • Version Drizzle ORM - ORM for you to settle ship ship ship.
    • Version Better Auth
    • Version Zod - TypeScript-first schema validation with static type inference.
  • Client/UI:

    • Version redaxios - Axios has a great API that developers love. Redaxios provides that API in 800 bytes, using native fetch().
    • Version Tailwind CSS - Rapidly build modern websites without ever leaving your HTML. A utility-first CSS framework packed with classes like flex, pt-4, text-center and rotate-90 that can be composed to build any design, directly in your markup.
    • Version Shadcn - The Foundation for your Design System. A set of beautifully designed components that you can customize, extend, and build on. Start here then make it your own. Open Source. Open Code.
    • Version Base UI - Unstyled UI components for building accessible user interfaces.

Development Setup

Clone The Repository

git clone https://github.com/thelordoftheboards/tanstart-barren.git

or

git clone https://github.com/thelordoftheboards/tanstart-cumberland.git

or

git clone https://github.com/thelordoftheboards/tanstart-eddy.git

Install Dependencies

bun i

Create a Database

Postgres 18 with vector extensions is required. You can set up your own database, or use docker compose as described:

docker network create ${PROJECT_NAME}-standalone-db-network

Example for PROJECT_NAME being my-project:

docker network create my-project-standalone-db-network
  • Compose up the database container:
bun compose:db:up

Create an .env File

Use example doc/.env.example. If using the provided copose postgres container, the DATABASE_URL will be:

DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:${POSTGRES_EXPOSED_PORT}/${POSTGRES_DB}

for instance

DATABASE_URL=postgresql://user:password@localhost:5432/database-name

Generate the schema to your database with drizzle-kit:

bun db:generate

You can also push the schema to your database with drizzle-kit:

bun db:push

Alternatively, if the environment variable DATABASE_AUTOMATIC_MIGRATIONS=enabled, the application will perform migrations when started in development mode, or upon the first request that is recevied in production. For more details Drizzle Migrations.

Run the development server:

bun dev

The development server should now be running at http://localhost:8088.

Deploying to production

The vite config is currently configured to use Nitro v3 (nightly) to deploy on Vercel, but can be easily switched to other providers.

Refer to the TanStack Start hosting docs for deploying to other platforms.

Using Docker

Create docker-settings.sh following the example in docker-settings.sh.example.

Scripts:

  • docker:setup - Creates common docker objects used by the project. Run once before using the other scripts.
  • ocker:build - Builds a dockerized version of the application.
  • docker:run - Runs the built version.
  • compose:db:up - Starts a database that can be used by bun run.
  • compose:db:down - Destroys the database used by bun run.
  • compose:full:up - Starts the database and app server together.
  • compose:full:down - Destroys the database and app server together.
  • docker:remove - Removes (some) of the docker objects created for the project.

Deploying using Dokploy

In addition to the using variables in .env add the following to the environment settings, where the domain is specified to be the domain you will be serving from:

NODE_ENV=production
SERVER_HOST=example.com

For the database server the recommended image is pgvector/pgvector:pg18 and the the mount /var/lib/postgresql

Issue watchlist

Scripts

We use bun by default, but you can modify these scripts in package.json to use your preferred package manager.

  • auth:generate - Regenerate the auth db schema if you've made changes to your Better Auth config. Notice that the IDs have been changed to uuid manually, and if you want to keep them that way you would have to re-do the process.
  • db - Run drizzle-kit commands. (e.g. bun db generate, bun db studio)
  • ui - The shadcn/ui CLI. (e.g. bun ui add button)
  • format, lint, check-types - Run biome, and check TypeScript types respectively.
    • check - Run all three above. (e.g. bun check)

Using Local Tunnel

In order to expose the development server over https to the world using localtunnel update devconfig/localtunnel-settings.sh using the example from localtunnel-settings.sh.example :

  • LOCALTUNNEL_SUBDOMAIN is the subdomain argument that is passed to local tunnel. Notice that if it is taken localtunnel might provide an alternative subdomain.
  • SERVER_HOST is the URL where it has the subdomain prepended, essentially ${LOCALTUNNEL_SUBDOMAIN}.loca.lt.

Use one of the following scripts:

  • lt - serve through localtunnel in a separate process.
  • dev-lt - run development concurrently with serving through localtunnel, might have issues.
  • start-lt - run development concurrently with serving through localtunnel, should perform well.

License

Code in this template is public domain via Unlicense. Feel free to remove or replace for your own project.

Also check out