production-ready fastify boilerplate, fully type-safe from database modeling to API response 🤘
- Authentication: JWT, internally using fast-jwt
- Database ORM: Prisma, supports PostgreSQL (configured), MySQL, SQL Server, SQLite and MongoDB
- Validation: request-response validation using Ajv
- Testing: using Mocha, assertion from Chai, and Sinon for mocks
- Environment variables: using env-schema, a dotenv with Ajv validation
- Git hooks: with husky and lint-staged
- Linting: with ESLint and Prettier
List of available routes:
Auth Token:
POST /auth/register - register
POST /auth/login - login
POST /auth/logout - logout, to invalidate refresh token
GET /auth/sessions - get all active session
POST /auth/refresh-tokens - refresh auth tokens
POST /auth/send-verification-email - send verification token to user's email
POST /auth/verify-email - verify user email
User routes:
POST /users - create a user
GET /users - get all users
DELETE /users/:userId - delete user