Skip to content

str11ngfello/turbobun

Repository files navigation

Turbobun

A modern TypeScript monorepo starter template using Turborepo, Bun, Biome, and NestJS.

Tech Stack

  • Bun - Fast all-in-one JavaScript runtime, package manager, and test runner
  • Turborepo - High-performance monorepo build system
  • Biome - Fast formatter and linter (replaces ESLint + Prettier)
  • NestJS - Progressive Node.js framework for building server-side applications
  • Next.js - React framework for web applications
  • TypeScript - Type-safe JavaScript (ESNext target)

What's Inside

Apps

App Description Port
api NestJS backend API 3000
web Next.js web application 3000
docs Next.js documentation site 3001

Packages

Package Description
@repo/nest-lib Shared NestJS services and modules
@repo/ui Shared React component library
@repo/typescript-config Shared TypeScript configurations

Getting Started

Prerequisites

  • Bun v1.3.0 or later

Installation

bun install

Development

# Run all apps in development mode
bun run dev

# Run specific app
bun run dev -- --filter=api
bun run dev -- --filter=web

Build

# Build all packages and apps
bun run build

# Build specific app
bun run build -- --filter=api

Testing

# Run tests (uses Bun's built-in test runner)
cd apps/api && bun test

# Watch mode
cd apps/api && bun run test:watch

# E2E tests
cd apps/api && bun run test:e2e

Linting & Formatting

# Check for issues
bun run lint

# Auto-fix issues
bun run lint:fix

# Format code
bun run format

Clean

# Clear Turborepo cache
bun run clean

# Nuclear clean (removes node_modules, dist, .next, cache files)
bun run clean:all

Project Structure

turbobun/
├── apps/
│   ├── api/          # NestJS API
│   ├── docs/         # Next.js docs
│   └── web/          # Next.js web app
├── packages/
│   ├── nest-lib/     # Shared NestJS modules
│   ├── ui/           # Shared React components
│   └── typescript-config/
├── biome.json        # Biome configuration
├── turbo.json        # Turborepo configuration
└── package.json      # Root workspace config

Configuration

Biome

Configured with:

  • Single quotes, no semicolons, no trailing commas
  • Import sorting enabled
  • Parameter decorators enabled (for NestJS)
  • Auto-format on save (VS Code settings included)

TypeScript

  • Target: ESNext
  • Module: nodenext
  • Strict mode enabled
  • Decorator metadata enabled (for NestJS DI)

Turborepo

  • Stream UI mode (classic colored output)
  • Build caching with proper dependency ordering
  • dist/** outputs for NestJS packages

VS Code Setup

The .vscode/settings.json is configured for:

  • Format on save with Biome
  • Auto-organize imports on save

Install the Biome extension for the best experience.

Adding a New Package

  1. Create the package in packages/ or apps/
  2. Add a package.json with the appropriate name:
    • Apps: simple name (e.g., api, web)
    • Packages: scoped name (e.g., @repo/my-lib)
  3. Add build/dev scripts as needed
  4. Run bun install to link the workspace

License

MIT

About

Turborepo starter with bun, biome, nestjs, nextjs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •