This repository is intended to serve as a starting point if you want to bootstrap a quick TypeScript project, a basic local playground.
This has its shortcomings:
- No proper DI framework/container/tool
- No Clean Architecture structuring (I strongly suggest a Hexagonal Architecture + DDD approach)
- Coupling of infrastructure and application layers unless you separate them yourself
If these issues don't matter for your intended use, or you know how to fix them, this will be a fast way to run a quick script or program.
If you're looking for a more scalable strategy, check out my friend @AlexHHPS and I's TypeScript DDD template or if you want a simple API, check out my TypeScript API Template
- TypeScript
- Find other
tsconfig.json
options here
- Find other
- tsx
- pnpm
- Pure DI. If you prefer using containers, check out:
- tsyringe
- typescript-ioc
- TypeDI
- NestJS
- InversifyJS
- Awilix
- If you prefer mocking dependencies (no DI) use proxyquire
- Biome for formatting and linting.
- Node Test Runner for testing.
- GitHub Action workflows set up to run tests and formatting+linting on push
You'll need to duplicate the .env.example
file and rename it to .env
and to .env.test
first.
Action | Command | Description |
---|---|---|
Install dependencies | pnpm i |
Installs the necessary dependencies |
Compile | pnpm build |
Transpiles TS into JS |
Run | pnpm start |
Runs the compiled JS |
Dev | pnpm dev |
Runs the TypeScript code and watches for changes |
Action | Command | Description |
---|---|---|
Test | pnpm test |
Runs all the tests |
Action | Command | Description |
---|---|---|
Format | pnpm format |
Ensures code follows style guides |
Lint | pnpm lint |
Runs the linter and points out mistakes |