This is a RESTful API for an escape room booking system built with Laravel. Users can view available escape rooms, book a time slot, and manage their bookings. If the booking is made on the user's birthday, a 10% discount is automatically applied.
- Clone the repository:
git clone https://github.com/burakaktna/escape-room-booking.git
- Change to the project directory:
cd escape-room-booking
- Build and run the Docker containers:
docker-compose up -d --build
- Enter the app container:
docker-compose exec app bash
- Run the database migrations and seed the database:
php artisan migrate:fresh --seed
To run all the tests, use:
composer test
All endpoint details: Insomnia
- Register a new user:
POST /register
{
"name": "Your Name",
"email": "your-email@gmail.com",
"date_of_birth": "MM/DD/YYYY",
"password": "your-password",
"password_confirmation": "your-password"
}
- Login: POST /login
{
"email": "your-email@gmail.com",
"password": "your-password"
}
- Get the authenticated user: GET /user
- List all escape rooms: GET /escape-rooms
- Retrieve a specific escape room by its ID: GET /escape-rooms/{escapeRoom}
- List available time slots for a specific escape room: GET /escape-rooms/{escapeRoom}/time-slots
- Create a new booking for a specific escape room and time slot: POST /bookings
{
"escape_room_id": 1,
"time_slot_id": 1,
"participant_count": 1
}
- List all bookings for the authenticated user: GET /bookings
- Cancel a specific booking by its ID: DELETE /bookings/{booking}
This project is open-sourced software licensed under the MIT license.
Muhammed Burak AKTUNA
Email: burak.aktna@gmail.com