A modular Node.js application for managing event bookings, built with Fastify and TypeScript.
- Runtime: Bun
- Language: TypeScript
- Framework: Fastify
- Database: PostgreSQL with Drizzle ORM
- Caching: Redis
- Authentication: JWT with bcrypt
- Validation: Zod
- Ensure Bun, PostgreSQL, and Redis are installed.
- Clone the repository.
- Install dependencies:
bun install - Set up environment variables in
.env(see.env.example). - Start databases:
docker-compose up -d - Run migrations:
bunx drizzle-kit generate && bunx drizzle-kit migrate - Start the server:
bun run dev
Run the development server: bun run dev
The server starts on the configured port (default 3000).
POST /auth/signin- Sign in userPOST /auth/signup- Sign up user
POST /events- Create event (authenticated)GET /events- Get user's events (authenticated)GET /events/:eventId- Get event by ID (authenticated)POST /events/:eventId/reservations- Reserve a seat (authenticated)
Run tests: bun test
Run tests in watch mode: bun test --watch
- Project structure: Modular plugins (auth, events) with controller/service/repository layers.
- Follow TypeScript conventions and Zod validation.
- Ensure tests pass before submitting changes.
MIT
Kayode Odole