Node Checkin is an application designed to manage participants in in-person events using a Node.js framework. The tool allows the organizer to register an event, open a public registration page, and provides a set of RESTful API endpoints built with Fastify, TypeScript, and Prisma. Registered participants can generate a credential for check-in on the day of the event. The system then scans the participant's credential to allow entry to the event. This documentation provides an overview of the project structure, available scripts, API endpoints, and dependencies.
.husky/
: Husky Hooks directoryprisma/
: Prisma configuration and migration directoryschema.prisma
: Prisma schema file
src/
: Source code directoryserver.ts
: Main server filelib/
: Directory for lib configurationprisma.ts
: Prisma Client configuration file
routes/
: Directory for API routescheck-in.ts
: Check-in related routescreate-event.ts
: Event creation related routesget-attendees-badge.ts
: Get attendee badge related routesget-event-attendees.ts
: Get event attendees related routesget-event.ts
: Get event details related routesregister-for-event.ts
: Register for event related routes
utils/
: Utility functions directorygenerate-slug.ts
: Generate slug utility
.env
: Environment configuration filedocker-compose.yml
: Docker Compose configuration fileeslintrc.json
: ESLint configuration fileprettierrc.json
: Prettier configuration filetsconfig.json
: TypeScript configuration file
pnpm start
Runs the server using tsx src/server.ts
.
pnpm run build
Builds the project using tsup src
.
pnpm run lint
Lints the code using ESLint.
pnpm run start:dev
Watches for changes and restarts the server using tsx watch --env-file .env src/server.ts
.
Before each commit, the following actions are executed:
- Code linting
- Code formatting using Prettier
- Running lint tests
pnpm test
Runs the tests using vitest
.
pnpm run test:lint
Runs lint tests.
docker-compose up
Starts the Docker containers defined in docker-compose.yml
.
pnpm prisma:apply
Applies the Prisma migrations.
HTTP Method | Endpoint | Description |
---|---|---|
POST | /events |
Create an event |
GET | /events/{eventId}/attendees |
Get event attendees |
GET | /events/{eventId} |
Get an event |
POST | /events/{eventId}/attendees |
Register an attendee |
GET | /attendees/{attendeeId}/badge |
Get an attendee badge |
GET | /attendees/{attendeeId}/check-in |
Check-in an attendee |
- Fastify: Web framework
- @fastify/cors: CORS plugin for Fastify
- @fastify/swagger: Swagger documentation plugin for Fastify
- @fastify/swagger-ui: Swagger UI plugin for Fastify
- @prisma/client: Prisma client for database operations
- fastify-type-provider-zod: Type validation plugin for Fastify using Zod
- prisma: Database ORM
- zod: Schema validation library
- @eslint/js: ESLint for linting
- @types/node: TypeScript types for Node.js
- @typescript-eslint/eslint-plugin: ESLint plugin for TypeScript
- @typescript-eslint/parser: ESLint parser for TypeScript
- eslint: Linting utility
- eslint-config-prettier: ESLint configuration for Prettier
- globals: Global type definitions
- husky: Git hooks management
- lint-staged: Run linters against staged git files
- prettier: Code formatting utility
- tsup: TypeScript bundler
- tsx: TypeScript transpiler
- typescript: TypeScript compiler
- vitest: Testing framework
This project was built during a workshop from Rockeseat NLW Unite. We would like to express our gratitude for the valuable learning experience and guidance provided.
MIT