A simple starter template for building APIs with Fastify and TypeScript using Node.js 24+.
- Node.js 24.0.0 or higher
- npm
git clone https://github.com/Matschik/fastify-typescript-starter.git
cd fastify-typescript-starter
npm installStart the development server with hot reload:
npm run devThe server will automatically restart when you change files.
Start the production server:
npm run startnpm run typecheck # Check for TypeScript errors
npm run format # Format code with Prettiersrc/
βββ index.ts # Entry point
βββ app.ts # Fastify app setup
βββ router.ts # Route registration
βββ controller/ # Route handlers
βββ indexController.ts
βββ userController.ts
- Start the dev server:
npm run dev - Visit
http://localhost:3006in your browser - Check
http://localhost:3006/api/v1/userfor the API endpoint - Edit files in
src/to see changes automatically
- β Fastify web framework
- β TypeScript support (no build step needed)
- β Hot reload in development
- β
Type checking with
npm run typecheck
MIT