A template for a TypeScript application on the Bun runtime. Bun runs TypeScript with no build step, Biome lints and formats, and the tsconfig is strict. It starts from github-project-template, so it has the same hooks, CI gate, and documentation convention.
| Tool | Owns |
|---|---|
| Bun | The runtime, install, and tests |
| TypeScript | The type check |
| Biome | Lint and format |
| convict | Configuration |
| mise | Tool versions and tasks |
| lefthook | Git hooks |
| cocogitto | Conventional Commits checks |
| rumdl | Markdown lint |
| gitleaks | Secret scan |
| Renovate | Updates to the pinned versions |
-
Install mise.
-
Clone the repo and install the tools, dependencies, and hooks:
git clone git@github.com:tabmadi/ts-template.git cd ts-template mise install mise run setup -
Start the server in watch mode, then call it:
mise run dev curl http://localhost:3000/health
| Task | Does |
|---|---|
mise run setup |
Installs the locked dependencies and the git hooks |
mise run dev |
Runs the app and reloads on change |
mise run start |
Runs the app |
mise run format |
Applies every formatter |
mise run lint |
Runs lint:ts, lint:md, and lint:secrets |
mise run test |
Runs the tests |
mise run check |
Runs lint and test. Run it before you finish a change |
mise run ci |
Runs exactly what CI runs. The pre-push hook runs it too |
.
├── src/
│ ├── index.ts The HTTP server with a /health route
│ ├── config.ts The configuration schema
│ └── __tests__/ The tests
├── docs/adr/ The decisions: foundations, doc conventions, toolchain
├── biome.json Lint and format rules
├── tsconfig.json Compiler settings
├── .mise.toml Tool pins and tasks
└── .lefthook.yml Git hooks
| Variable | Description | Default |
|---|---|---|
PORT |
The port the server binds | 3000 |
- Create a repository from this template on GitHub.
- Change
nameinpackage.json. - Replace the sample server in
src/with your own code. - Update the contacts in
SECURITY.mdand the copyright line inLICENSE. - Install the Renovate app on the new repository.
The ADRs in docs/adr record every decision and the reason for it. ADR-0001 is the house style for all text.
Follow the Code of Conduct. Commit messages follow Conventional Commits, and the commit-msg hook checks them. Run mise run check before you open a pull request.
To report a vulnerability, follow SECURITY.md.
Apache License 2.0. See LICENSE.