CoreMVP

TanStack Start

View as Markdown

Build on TanStack Start with CoreMVP

The same app on TanStack Start: sign-in, Organizations, billing, a dashboard and an API, ready for Cloudflare Workers.

git clone https://github.com/coremvp/tanstack-start.git
cd tanstack-start
bun install --frozen-lockfile
bunx supabase start
./coremvp env sync
bun run dev   # http://localhost:3000
bun --env-file=.env.cloudflare run build:cloudflare
cf deploy --prebuilt --dry-run
cf deploy --prebuilt --secrets-file .env.cloudflare

In this section

Run Locally

bun run dev

Start, stop, reset and test the app on your machine.

App
localhost:3000
Database
Local Supabase
Tests
bun run test

Configure Environment

.env.local

Every setting, where it is read and what stays server-only.

Local file
.env.local
Browser values
NEXT_PUBLIC_*
Refresh
./coremvp env sync

Project Structure

src/

Where to make the most common product changes.

Pages
src/routes
API
src/api
Database
supabase/migrations

Jump straight in

src/api/routes/greeting.ts
import { Hono } from "hono";
import { z } from "zod";
import { validateQuery } from "@/api/validation";

const greetingRoutes = new Hono();
const query = z.strictObject({ name: z.string().min(1) });

greetingRoutes.get("/greeting", validateQuery(query), (c) => {
  const { name } = c.req.valid("query");
  return c.json({ ok: true, greeting: `Hello, ${name}` });
});

export { greetingRoutes };

Add an API route

A validated Hono route, mounted at /api and called from the browser on the same origin.

  • Zod request validation
  • Mounted at /api
  • Same file in both templates
Read docs

Explore the TanStack Start docs

Was this page helpful?