Create a RESTful API for an event management system where users can create, manage, and RSVP to events. This backend-only project will evaluate your skills with TypeScript, Node.js, MongoDB, Jest, and Zod schemas.
- Create a complete API with the following features:
- User authentication (signup, login, logout)
- Event management (create, read, update, delete)
- RSVP functionality (users can RSVP to events)
- Search/filter events by date, category, or location
- Use TypeScript for type safety
- Build on Node.js (Express or NestJS recommended)
- Use MongoDB for data storage
- Implement proper validation with Zod schemas
- Write comprehensive tests with Jest (aim for >80% coverage)
- Include proper error handling and logging
- Add pagination for list endpoints
Here's a suggested structure (adapt as you see fit):
├── src/
│ ├── config/ # Configuration files
│ ├── controllers/ # Route controllers
│ ├── middleware/ # Custom middleware
│ ├── models/ # MongoDB models
│ ├── routes/ # API routes
│ ├── schemas/ # Zod validation schemas
│ ├── services/ # Business logic
│ ├── types/ # TypeScript type definitions
│ ├── utils/ # Helper functions
│ └── app.ts # Express/NestJS app
├── tests/
│ ├── integration/ # Integration tests
│ └── unit/ # Unit tests
├── .env.example # Example environment variables
├── jest.config.js # Jest configuration
├── package.json # Dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
At minimum, implement:
-
User
- Name, email, password (hashed), profile info
-
Event
- Title, description, location, date/time, category, owner (user reference), attendees, capacity, etc.
-
RSVP
- User reference, event reference, status (attending/maybe/declined), timestamp
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current userPOST /api/auth/logout- User logout
GET /api/events- Get all events (with pagination and filters)GET /api/events/:id- Get a specific eventPOST /api/events- Create a new eventPUT /api/events/:id- Update an eventDELETE /api/events/:id- Delete an event
POST /api/events/:id/rsvp- RSVP to an eventGET /api/events/:id/attendees- Get event attendeesGET /api/users/me/events- Get events the current user is attending
Your solution will be evaluated on:
-
Code Quality
- Clean, maintainable, and well-documented code
- Proper error handling and edge cases
- Effective use of TypeScript features
-
Architecture
- Separation of concerns
- RESTful API design
- Proper use of middleware
-
Security
- Authentication and authorization
- Input validation
- Protection against common vulnerabilities
-
Testing
- Comprehensive test coverage
- Clear test organization and descriptions
-
Data Modeling
- Appropriate schema design
- Effective use of MongoDB features
- Proper validation with Zod
- Create a private GitHub repository
- Implement your solution
- Include a README with:
- Setup and running instructions
- API documentation
- Design decisions and tradeoffs
- Any additional features implemented
- Provide a seed script for initial data
- Share the repository with [interviewer's GitHub username]
If you have any questions during the assignment, please reach out to us.