A modern monorepo technology showcase demonstrating high-performance tools and development practices
- π Overview
- ποΈ Architecture
- π οΈ Tech Stack
- π¦ Project Structure
- π Quick Start
- π§ Development
- π± Applications
- π Packages
- π οΈ Tools
- βοΈ Configuration
- π³ Docker & Deployment
- π CI/CD Pipeline
- π§ͺ Scripts
- π€ Contributing
- π License
Turbo Base is a cutting-edge monorepo template that showcases modern development practices and high-performance tools. Built with developer experience in mind, it demonstrates the power of combining the latest technologies in a scalable, maintainable architecture.
- β‘ Ultra-fast development with Bun runtime and hot reload
- ποΈ Turborepo orchestration with intelligent caching, task pipelines, and remote caching
- π― TypeScript-first with strict type safety across the entire stack
- π¨ Modern UI with React 19, TanStack Router, and Tailwind CSS
- π Automated workflows with Git hooks, CI/CD, and dependency management
- π¦ Monorepo architecture with shared packages and consistent tooling
- π οΈ Developer experience with VS Code integration and comprehensive tooling
- π Code quality with Biome, TypeScript, Commitlint, and automated checks
- π³ Container-ready with optimized Docker builds and multi-stage production images
- π Production deployment with GitHub Actions CI/CD and container orchestration
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Turbo Base β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β π Apps π Packages π οΈ Tools β
β βββ api βββ ui βββ cli β
β βββ web βββ shared βββ tailwind β
β βββ tsconfig β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
This monorepo follows a clean separation of concerns:
- Apps: Standalone applications (API & Web)
- Packages: Shared libraries and components
- Tools: Development utilities and configurations
- Bun - Ultra-fast JavaScript runtime, package manager, and bundler
- Turborepo - High-performance build system with intelligent caching, parallel execution, task pipelines, and remote cache sharing
- TypeScript - Type-safe JavaScript with advanced features and strict configuration
- React 19 - Latest React with concurrent features
- TanStack Start - Full-stack React framework
- TanStack Router - Type-safe routing
- Tailwind CSS - Utility-first CSS framework
- Vite - Next-generation frontend tooling
- Biome - Fast formatter, linter, and import organizer
- Lefthook - Git hooks manager for automated quality checks
- Commitlint - Conventional commit message linting
- CSpell - Code spell checker for multiple languages
- Knip - Unused dependencies and dead code detector
- Renovate - Automated dependency updates
turbo-base/
βββ π± apps/ # Applications
β βββ api/ # Elysia/Bun backend API
β β βββ src/
β β β βββ main.ts # Application entry point
β β β βββ libs/ # API libraries (swagger, etc.)
β β β βββ modules/ # Feature modules (ping, etc.)
β β β βββ utils/ # Utilities (env, etc.)
β β βββ Dockerfile # Container configuration
β β βββ package.json
β βββ web/ # React 19 frontend application
β βββ src/
β β βββ components/ # React components
β β βββ routes/ # TanStack Router routes
β β βββ lib/ # Utilities and configurations
β β βββ assets/ # Static assets
β βββ Dockerfile # Container configuration
β βββ package.json
βββ π packages/ # Shared packages
β βββ ui/ # Shared UI components
β β βββ src/
β β β βββ button.tsx # Button component
β β β βββ theme.tsx # Theme utilities
β β β βββ index.ts # Package exports
β β βββ package.json
β βββ shared/ # Shared utilities (WIP)
β βββ package.json
βββ π οΈ tools/ # Development tools
β βββ cli/ # Project CLI tool
β βββ tailwind/ # Shared Tailwind configurations
β βββ tsconfig/ # Shared TypeScript configurations
βββ βοΈ .config/ # Configuration files
β βββ commitlintrc.yaml # Commit message linting rules
β βββ knip.json # Unused dependencies configuration
β βββ lefthook.yaml # Git hooks configuration
βββ π’ .vscode/ # VS Code workspace settings
β βββ cspell.json # Spell check configuration
β βββ extensions.json # Recommended extensions
β βββ settings.json # Editor configuration
βββ π .github/ # GitHub workflows and automation
β βββ workflows/
β β βββ ci.yml # CI/CD pipeline
β βββ scripts/
β β βββ prepare.sh # Build preparation script
β βββ renovate.json # Dependency update configuration
βββ π³ Deployment files # Container and deployment
β βββ .dockerignore # Docker ignore patterns
β βββ .env.sample # Environment variables template
β βββ .env # Local environment (gitignored)
βββ biome.json # Code formatting and linting
βββ turbo.json # Turborepo configuration
βββ package.json # Root package.json with workspaces
- Bun >= 1.2.17
- Node.js >= 18 (for compatibility)
- Git for version control
-
Clone the repository
git clone https://github.com/ismoiliy98/turbo-base.git cd turbo-base
-
Install dependencies
bun install
-
Start development
bun dev
This will start:
- π Web app at
http://localhost:3001
- π API server at
http://localhost:3000
- π API docs at
http://localhost:3000/api/docs
Script | Description |
---|---|
bun dev |
Start all apps in development mode |
bun run build |
Build all apps for production |
bun ts:check |
Type-check all TypeScript files |
bun biome:check |
Check code formatting and linting |
bun biome:fix |
Fix code formatting and linting issues |
bun clean |
Clean build artifacts and node_modules |
bun packages:check |
Verify package dependencies |
This project maintains high code quality standards:
- TypeScript for type safety
- Biome for fast formatting and linting
- Conventional commits for clear commit messages
- Git hooks for automated quality checks
-
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
- Follow TypeScript best practices
- Use conventional commit messages
- Ensure lints pass
-
Commit and push
git add . git commit -m "feat: add amazing feature" git push origin feature/amazing-feature
A high-performance backend API built with Elysia and Bun.
Features:
- β‘ Elysia framework for ultra-fast performance
- π Auto-generated Swagger documentation
- ποΈ Modular architecture with services
- π§ Environment-based configuration
- π§ͺ Built-in health checks
Quick start:
cd apps/api
bun dev
A modern React application with cutting-edge features.
Features:
- βοΈ React 19 with latest features
- π£οΈ Type-safe routing with TanStack Router
- π¨ Tailwind CSS for styling
- π Dark/light theme support
- π± Responsive design
- β‘ Hot reload development
Quick start:
cd apps/web
bun dev
Shared UI components and utilities for consistent design across applications.
Components:
Button
- Customizable button componentThemeToggle
- Theme switching component
Utilities:
cn
- Class name utilitypxToRem
/remToPx
- Unit conversion helpers
Common utilities and types shared across the monorepo (Work in Progress).
A powerful command-line interface for project automation and development workflows.
Features:
- π¦ Project scaffolding
- π§ Development automation
- π― Target-specific operations
- π Bun/Elysia project support
Shared Tailwind CSS configurations for consistent styling across platforms.
Configurations:
base
- Core Tailwind setupweb
- Web-specific enhancementsmobile
- Mobile-optimized settings
Centralized TypeScript configurations for different environments and use cases.
Configurations:
base
- Core TypeScript setupreact
- React-specific settingsbun
- Bun runtime optimizations
The monorepo includes comprehensive configuration for development tools and workflows:
.config/commitlintrc.yaml
- Enforces conventional commit messages.config/lefthook.yaml
- Git hooks for automated quality checks.config/knip.json
- Dead code and unused dependencies detectionbiome.json
- Fast formatting, linting, and import organization
.vscode/settings.json
- Optimized editor settings for the tech stack.vscode/extensions.json
- Recommended extensions for the best development experience.vscode/cspell.json
- Spell checking configuration supporting multiple languages
.github/workflows/ci.yml
- Comprehensive CI/CD pipeline.github/renovate.json
- Automated dependency updates.github/scripts/
- Custom scripts for build preparation
.env.sample
- Template for environment variablesturbo.json
- Build orchestration and caching configuration
Each application includes optimized Docker configurations for production deployment:
Multi-stage Build Process:
- Base Stage - Bun runtime with Turbo CLI installation
- Source Stage - Dependency pruning with
turbo prune
- Dependencies Stage - Cached dependency installation
- Build Stage - Application compilation with remote cache integration
- Production Stage - Minimal runtime image with security optimizations
- ποΈ Turbo Pruning - Only includes necessary dependencies for each app
- π¦ Layer Caching - Optimized Docker layer caching for faster builds
- π Security - Non-root user execution and minimal attack surface
- β‘ Performance - Multi-architecture builds (AMD64/ARM64)
- π Remote Cache - Integration with Turbo's remote caching system
Build and run containers locally:
# Build API container
docker build -f apps/api/Dockerfile -t turbo-base-api .
# Build Web container
docker build -f apps/web/Dockerfile -t turbo-base-web .
# Run containers
docker run -p 3000:3000 turbo-base-api
docker run -p 3001:3000 turbo-base-web
- Environment Variables - Secure secret management in CI/CD
- Health Checks - Built-in application health monitoring
- Horizontal Scaling - Stateless application design
- Container Registry - GitHub Container Registry (ghcr.io) integration
The CI/CD pipeline provides comprehensive automation for code quality, testing, and deployment:
Parallel Linting & Checks:
- Package Management - Dependency validation and sorting
- Knip Analysis - Unused dependencies and dead code detection
- TypeScript - Type checking across all packages
- Biome - Code formatting and linting validation
Intelligent Build Strategy:
- Affected Detection - Only builds changed applications using Turbo's change detection
- Multi-platform Builds - AMD64 and ARM64 architecture support
- Remote Caching - Shared build cache across CI runs and developers
- Container Registry - Automatic pushes to GitHub Container Registry
- Branch-based Workflows - Different strategies for
main
,stage
, andtest
branches - Manual Triggers - Force build and release options via workflow dispatch
- Concurrent Safety - Automatic cancellation of outdated pipeline runs
- Security - Secure secret handling for Turbo remote cache and registries
# Trigger conditions
on:
push: [main, stage, test]
pull_request: [main, stage, test]
workflow_dispatch: # Manual trigger options
Required secrets for full pipeline functionality:
TURBO_API
- Remote cache API endpointTURBO_TOKEN
- Remote cache authenticationGITHUB_TOKEN
- Container registry access
The monorepo provides several scripts for common development tasks:
bun dev # Start development servers
bun run build # Build all applications
bun clean # Clean build artifacts
bun biome:check # Check formatting and linting
bun biome:fix # Auto-fix issues
bun ts:check # Type-check TypeScript
bun packages:check # Verify dependencies
bun packages:fix # Fix dependency issues
bun packages:sort # Sort package.json files
bun ui:add # Add UI components
bun knip:check # Check for unused dependencies
We welcome contributions! Please see our contributing guidelines for details.
- Fork the repository
- Clone your fork
- Install dependencies:
bun install
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
- Follow TypeScript best practices
- Use conventional commit messages
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by Bekhzod Ismoiliy