Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yonathan06/fastify-typescript-starter
Node.js starter using Fastify & TypeScript
https://github.com/yonathan06/fastify-typescript-starter
Last synced: 4 days ago
JSON representation
Node.js starter using Fastify & TypeScript
- Host: GitHub
- URL: https://github.com/yonathan06/fastify-typescript-starter
- Owner: yonathan06
- License: mit
- Created: 2020-08-27T05:44:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-01T07:42:58.000Z (22 days ago)
- Last Synced: 2024-12-10T00:42:07.105Z (13 days ago)
- Language: TypeScript
- Homepage:
- Size: 77.1 KB
- Stars: 156
- Watchers: 4
- Forks: 25
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-boilerplate - Github
- awesome-boilerplate - Github
README
# Node.js starter using Fastify & TypeScript
![ci badge](https://github.com/yonathan06/fastify-typescript-boilerplate/workflows/CI/badge.svg)
[![Sync Vulnerabilities Status](https://app.snyk.io/test/github/yonathan06/fastify-typescript-boilerplate/badge.svg)](https://snyk.io/test/github/yonathan06/fastify-typescript-boilerplate)Create a new server:
```bash
pnpx degit yonathan06/fastify-typescript-starter my-server
```
or `npx`.See [degit](https://github.com/Rich-Harris/degit) docs for detailed explaination
## Included in the boilerplate
- TypeScript (using esbuild for fast compilation, and tsx for development)
- Env vars
- Tests (using Vitest)
- Fastify
- CI with github actions
- Docker image
- Linting**BYODB - Bring your own database** - no database connection included
## Set Up
- Install the dependencies.
```bash
pnpm install
```or npm/yarn
- Start the server in development mode.
```bash
pnpm dev
```or npm/yarn
## Env vars
Loaded from `.env` file, with schema validation
## Backend API Development
There are a number of handy commands you can run to help with development.
|Command | Action |
|---|---|
|`pnpm run dev` | Run the server in dev mode, automatically restarts on file change |
|`pnpm build`| Compile TypeScript to JavaScript |
|`pnpm start`| Start JavaScript from 'build' directory |
|`pnpm test`| Run unit tests (run `pnpm build` before) |
|`pnpm test:watch`| Run backend tests in watch mode, running on changed test files |
|`pnpm lint`| Run eslint |
|`pnpm lint:fix`| Run eslint in fix mode |## CI
Run tests on push/PR to 'main' branch
Check `.github/workflows/CI.yml`## Recommended Vscode Extensions
[Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
[ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)