Skip to content

yonathan06/fastify-typescript-starter

Repository files navigation

Node.js starter using Fastify & TypeScript

ci badge Sync Vulnerabilities Status

Create a new server:

pnpx degit yonathan06/fastify-typescript-starter my-server

or npx.

See 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.
pnpm install

or npm/yarn

  • Start the server in development mode.
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 ESLint

About

Node.js starter using Fastify & TypeScript

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy