A modern, production-ready template for TypeScript projects with all the essential tools and configurations you need to get started quickly! π―
This template comes pre-configured with:
- π₯ Bun Runtime: Ultra-fast JavaScript runtime and package manager
- π TypeScript: Type-safe JavaScript with modern ES features
- π§Ή Biome: Fast linter and formatter (Prettier + ESLint replacement)
- π§ Modern Configuration: ESNext target with strict type checking
- π¨ Git Integration: Pre-configured with Biome VCS integration
- πͺ Git Hooks: Lefthook for automated quality checks
- π Conventional Commits: Cocogitto (cog) for commit message validation and changelog generation
- π GitHub Templates: CODE_OF_CONDUCT.md, SECURITY.md, and LICENSE included
- β‘ Proto Tool Manager: Automated tool management with moonrepo proto
- proto: A multi-language version manager that will manage all required tools
- Alternatively, you can install tools separately:
-
Use this template by clicking the "Use this template" button on GitHub
-
Clone your new repository:
git clone https://github.com/yourusername/your-project-name.git cd your-project-name -
Install tools and dependencies:
Option A: Automated Setup (Recommended)
# Run the automated installation script ./scripts/install.sh # Install project dependencies bun install
Option B: Manual Setup
# Install proto (if not already installed) bash -c "$(curl -fsSL https://moonrepo.dev/install/proto.sh)" # Install all required tools (bun, biome, cog, lefthook) using proto proto use # Install Git hooks with Lefthook lefthook install # Install project dependencies bun install
# Start the development server (with watch mode)
bun run dev
# Start the production server
bun run start| Script | Description |
|---|---|
bun run start |
Start the production server |
bun run dev |
Start development server with file watching |
bun run lint |
Run Biome linter |
bun run format |
Format code with Biome |
bun run prepare |
Install Lefthook Git hooks |
This template uses Biome for both linting and formatting:
# Check for linting issues
bun run lint
# Auto-fix linting issues and format code
bun run formatThis template includes Lefthook for automated Git hooks
Git hooks will automatically run on:
- Pre-commit: Format code, run linter, and type-check
- Commit-msg: Validate commit message format
- Pre-push: Final lint and type checks
All commit messages must follow the Conventional Commits specification:
# β
Valid commit messages
git commit -m "feat: add user authentication"
git commit -m "fix: resolve memory leak in data processing"
git commit -m "docs: update API documentation"
git commit -m "refactor: simplify error handling logic"
# β Invalid commit messages
git commit -m "add feature" # Missing type
git commit -m "Fix bug" # Wrong case
git commit -m "feat!: breaking change" # Use BREAKING CHANGE footer insteadAvailable commit types:
feat- New featuresfix- Bug fixesdocs- Documentation changesstyle- Code style changes (formatting, etc.)refactor- Code refactoringperf- Performance improvementstest- Adding or updating testsbuild- Build system changesci- CI configuration changeschore- Other changes (maintenance, etc.)revert- Reverting previous commits
# Install hooks (automatically runs after `bun install`)
bun run prepare
# Skip hooks for a single commit (use sparingly)
git commit -m "feat: add feature" --no-verify
# Temporarily disable hooks
lefthook uninstall
# Re-enable hooks
lefthook installβββ src/
β βββ index.ts # Main application entry point
βββ biome.json # Biome configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json # Project dependencies and scripts
βββ README.md # You are here! π
The tsconfig.json is configured for modern TypeScript development:
- ESNext target and library
- Strict type checking enabled
- Bun-optimized module resolution
- React JSX support ready
The biome.json includes:
- All recommended rules are enabled
- Tab indentation (configurable)
- Git integration
- Import organization
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run the linter and formatter:
bun run format - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
To customize this template for your project:
- Update package.json with your project details
- Modify the server in
src/index.tsto fit your needs - Adjust TypeScript/Biome configs as needed
- Update this README with your project-specific information
Please see SECURITY.md for our security policy and how to report security vulnerabilities.
This project is licensed under the Apache Licenseβsee the LICENSE file for details.
- Bun for the amazing runtime
- Biome for fast linting and formatting
- TypeScript for type safety
- Lefthook for fast and powerful Git hooks management
- Cocogitto for conventional commits tooling and changelog generation
- Proto for multi-language version management
Happy coding! π If you find this template useful, please give it a βοΈ