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
- β‘ mise: Pinned tool versions and tasks with mise
- π Secret Scanning: gitleaks on every commit and in CI
- π€ CI: A GitHub Actions workflow that runs the same
mise run cias the pre-push hook
- mise: A multi-language version manager and task runner. It installs every other tool (Bun, Biome, Cocogitto, Lefthook, gitleaks) at the versions pinned in .mise.toml.
- 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, dependencies, and Git hooks:
mise trust # allow this repo's .mise.toml mise install # install the pinned tools mise run setup # install dependencies and Git hooks
# Start the development server (with watch mode)
mise run dev
# Start the production server
mise run startTasks live in .mise.toml; mise tasks lists them. The package.json scripts delegate to them, so
bun run lint and mise run lint are the same.
| Task | Description |
|---|---|
mise run setup |
Install dependencies and Git hooks |
mise run start |
Start the production server |
mise run dev |
Start development server with file watching |
mise run test |
Run the tests |
mise run lint |
Biome (warnings fail), tsc --noEmit, and gitleaks |
mise run format |
Format code with Biome |
mise run check |
Lint and test: run it before you finish |
mise run ci |
Install the locked dependencies, then check |
This template uses Biome for both linting and formatting:
# Check for linting issues
mise run lint
# Auto-fix linting issues and format code
mise run formatThis template includes Lefthook for automated Git hooks
Git hooks will automatically run on:
- Pre-commit: Biome fixes and re-stages the staged files, then type-check, test, and scan for secrets
- Commit-msg: Validate commit message format
- Pre-push: Validate commit history and run
mise run ci, the same gate as CI
Every hook runs its tools through mise x, so hooks work from an editor or a shell without mise activated.
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 changesrefactor- Code refactoringperf- Performance improvementstest- Adding or updating testsbuild- Build system changesci- CI configuration changeschore- Other changes (maintenance, etc.)revert- Reverting previous commits
# Install hooks (part of `mise run setup`)
mise x -- lefthook install
# Skip hooks for a single commit (use sparingly)
git commit -m "feat: add feature" --no-verify
# Temporarily disable hooks
mise x -- lefthook uninstall
# Re-enable hooks
mise x -- 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 formatter and the gate:
mise run format && mise run check - 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
- mise for tool versions and tasks
Happy coding! π If you find this template useful, please give it a βοΈ