Skip to main content
ZeroStarter includes a comprehensive set of scripts to streamline your development workflow. All scripts are run with bun run <script> from the project root.

Development

bun dev

Start all development servers in parallel using Turborepo’s TUI (Terminal UI).
bun dev
This starts:
  • Hono API on http://localhost:8787 (hot reload enabled)
  • Next.js app on http://localhost:3000 (fast refresh enabled)
The TUI shows real-time logs for each workspace and allows you to filter by service.

Workspace-Specific Dev Scripts

Run dev mode for individual workspaces:
bun --filter=@api/hono dev

Building

bun run build

Build all packages for production.
bun run build
This command:
  • Builds packages in dependency order
  • Caches builds using Turborepo
  • Shows a summary of build results
Output locations:
  • api/hono/dist/ - Compiled Hono API
  • web/next/.next/ - Next.js production build
  • packages/*/dist/ - Compiled package bundles

bun run check-types

Run TypeScript type checking across all workspaces without emitting files.
bun run check-types
Useful for:
  • CI/CD pipelines
  • Pre-commit hooks
  • Quick validation before building

Database

bun run db:generate

Generate database migrations from Drizzle schema.
bun run db:generate
1

Builds @packages/env

Ensures environment variables are available
2

Analyzes schema changes

Compares current schema with database state
3

Generates migration files

Creates SQL migration in packages/db/drizzle/

bun run db:migrate

Apply pending migrations to the database.
bun run db:migrate
Always generate migrations in development first, then apply them in production. Never run db:generate in production.

bun run db:studio

Open Drizzle Studio - a visual database browser.
bun run db:studio
Access at: https://local.drizzle.studio Features:
  • Browse tables and data
  • Run queries
  • Edit records
  • View relationships

Production

bun run start

Start all production servers.
bun run start
Runs:
  • bun dist/index.mjs for Hono API
  • next start for Next.js
Must run bun run build first to create production bundles.

Code Quality

bun run format

Format all code with Oxfmt.
bun run format
Formats:
  • TypeScript/JavaScript files
  • JSON files
  • MDX/Markdown (in content directories)

bun run format:check

Check formatting without making changes.
bun run format:check
Exits with error if files need formatting. Perfect for CI.

bun run lint

Lint all workspaces using Oxlint.
bun run lint
Checks for:
  • Code quality issues
  • Potential bugs
  • Best practice violations

Maintenance

bun run clean

Remove all build artifacts and dependencies.
bun run clean
Deletes:
  • .next/ directories
  • .turbo/ cache
  • dist/ build outputs
  • node_modules/ across all workspaces
  • Empty directories
This is destructive! Run bun install after cleaning to restore dependencies.

bun run shadcn:update

Update all Shadcn UI components to their latest versions.
bun run shadcn:update
This script:
  • Fetches latest component versions
  • Updates components in web/next/src/components/ui
  • Preserves your customizations when possible

Git Hooks

bun run prepare

Install Lefthook git hooks.
bun run prepare
Runs automatically after bun install. Configured hooks:
  • Pre-commit: Runs lint-staged for formatting and linting
  • Commit-msg: Validates commit messages with commitlint
See .lefthook.yml for hook configuration.

DevTools

bun run devtools

Open Turborepo DevTools for monitoring builds and cache.
bun run devtools
Provides:
  • Build visualization
  • Cache hit rates
  • Dependency graph
  • Performance metrics

Workspace Scripts

Run scripts in specific workspaces using Turbo’s --filter flag:
# Run in api/hono only
bun --filter=@api/hono dev

Custom Script Examples

Add these to your root package.json for common workflows:
package.json
{
  "scripts": {
    // Reset database and seed
    "db:reset": "bun run db:migrate && bun --filter=@api/hono seed",
    
    // Production build check
    "build:check": "bun run check-types && bun run lint && bun run build",
    
    // Install and setup from scratch
    "setup": "bun install && bun run db:generate && bun run db:migrate"
  }
}

CI/CD Scripts

Recommended script order for continuous integration:
1

Install dependencies

bun install --frozen-lockfile
2

Type checking

bun run check-types
3

Linting

bun run lint
4

Format checking

bun run format:check
5

Build

bun run build
6

Test (if applicable)

bun test

Script Options

Common Turborepo options that work with any script:
# Run with verbose output
bun run build --verbose

# Force rebuild (ignore cache)
bun run build --force

# Run in parallel (default)
bun run test --parallel

# Run in sequence
bun run build --concurrency=1

# Show summary after execution
bun run build --summarize

Environment Variables

Some scripts require environment variables. Ensure your .env file is configured:
.env
# Database (required for db:* scripts)
DATABASE_URL="postgresql://user:password@localhost:5432/db"

# API URL (required for web/next)
NEXT_PUBLIC_API_URL="http://localhost:8787"
API_INTERNAL_URL="http://localhost:8787"

# Hono configuration
HONO_PORT=8787
HONO_TRUSTED_ORIGINS="http://localhost:3000"

Troubleshooting

Next Steps

Project Structure

Understand the monorepo organization

Environment Variables

Configure your environment

Deployment

Deploy to production

Turborepo Docs

Learn more about Turborepo

Build docs developers (and LLMs) love