burakaktna / escape-room-booking

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel Escape Room Booking System

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.

Installation

  1. Clone the repository:
git clone https://github.com/burakaktna/escape-room-booking.git
  1. Change to the project directory:
cd escape-room-booking
  1. Build and run the Docker containers:
docker-compose up -d --build
  1. Enter the app container:
docker-compose exec app bash
  1. Run the database migrations and seed the database:
php artisan migrate:fresh --seed

Running Tests

To run all the tests, use:

composer test

API Endpoints

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}

License

This project is open-sourced software licensed under the MIT license.

Author

Muhammed Burak AKTUNA

Email: burak.aktna@gmail.com

About

License:MIT License


Languages

Language:PHP 78.4%Language:Blade 20.8%Language:Dockerfile 0.5%Language:JavaScript 0.2%