A REST API built with Node.js and Express.js to manage event bookings for Synergia technical event.
- View all event bookings
- Register for the event
- View specific booking details
- Update participant information
- Cancel bookings
- In-memory data storage (no database required)
- Install dependencies:
npm install- Start the server:
npm startThe server will run on http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/bookings |
Get all event bookings |
| POST | /api/bookings |
Create a new booking |
| GET | /api/bookings/:id |
Get booking by ID |
| PUT | /api/bookings/:id |
Update participant details |
| DELETE | /api/bookings/:id |
Cancel a booking |
GET http://localhost:3000/api/bookingsResponse:
{
"success": true,
"count": 2,
"data": [
{
"id": 1,
"participantName": "John Doe",
"email": "john.doe@example.com",
"phone": "1234567890",
"eventName": "Synergia 2025",
"registrationDate": "2025-10-29T..."
}
]
}POST http://localhost:3000/api/bookings
Content-Type: application/json
{
"participantName": "Alice Johnson",
"email": "alice@example.com",
"phone": "5551234567"
}Response:
{
"success": true,
"message": "Booking created successfully",
"data": {
"id": 3,
"participantName": "Alice Johnson",
"email": "alice@example.com",
"phone": "5551234567",
"eventName": "Synergia 2025",
"registrationDate": "2025-10-29T..."
}
}GET http://localhost:3000/api/bookings/1Response:
{
"success": true,
"data": {
"id": 1,
"participantName": "John Doe",
"email": "john.doe@example.com",
"phone": "1234567890",
"eventName": "Synergia 2025",
"registrationDate": "2025-10-29T..."
}
}PUT http://localhost:3000/api/bookings/1
Content-Type: application/json
{
"participantName": "John Updated",
"email": "john.updated@example.com"
}Response:
{
"success": true,
"message": "Booking updated successfully",
"data": {
"id": 1,
"participantName": "John Updated",
"email": "john.updated@example.com",
"phone": "1234567890",
"eventName": "Synergia 2025",
"registrationDate": "2025-10-29T..."
}
}DELETE http://localhost:3000/api/bookings/1Response:
{
"success": true,
"message": "Booking cancelled successfully",
"data": {
"id": 1,
"participantName": "John Updated",
"email": "john.updated@example.com",
"phone": "1234567890",
"eventName": "Synergia 2025",
"registrationDate": "2025-10-29T..."
}
}curl http://localhost:3000/api/bookingscurl -Method POST -Uri http://localhost:3000/api/bookings -Headers @{"Content-Type"="application/json"} -Body '{"participantName":"Alice Johnson","email":"alice@example.com","phone":"5551234567"}'curl http://localhost:3000/api/bookings/1curl -Method PUT -Uri http://localhost:3000/api/bookings/1 -Headers @{"Content-Type"="application/json"} -Body '{"participantName":"John Updated","email":"john.updated@example.com"}'curl -Method DELETE -Uri http://localhost:3000/api/bookings/1skill-lab-5c/
├── server.js # Main Express server file
├── package.json # Project dependencies
├── README.md # This file
└── node_modules/ # Dependencies folder
- Node.js: JavaScript runtime
- Express.js: Web framework for Node.js
- In-Memory Storage: Array-based data storage
- Data is stored in memory and will be lost when the server restarts
- The server includes two sample bookings by default
- All responses follow a consistent JSON format with success/error indicators