This is a Django-based API for managing hotel reservations. The system allows users to register, book rooms, make payments, and manage their bookings.
- User registration and authentication
- Room listing and booking
- Payment processing
- Booking cancellation and updates
- API documentation with Swagger UI
-
Clone the repository:
git clone https://github.com/your-repo/hotel-reservation-api.git cd hotel-reservation-api -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Run the server:
python manage.py runserver
POST /api/v1/users/register/- Register a new userPOST /api/v1/users/login/- Login a userGET /api/v1/users/- Get list of usersGET /api/v1/users/<uuid:user_id>/- Get user details
POST /api/v1/bookings/create/- Create a new bookingPOST /api/v1/bookings/<uuid:booking_id>/pay/- Make a paymentPOST /api/v1/bookings/<uuid:booking_id>/confirm_payment/- Confirm paymentGET /api/v1/bookings/<uuid:booking_id>/- Get booking detailsPOST /api/v1/bookings/<uuid:booking_id>/cancel/- Cancel a bookingPUT /api/v1/bookings/<uuid:booking_id>/update/- Update booking detailsGET /api/v1/bookings/list/- List all bookingsGET /api/v1/bookings/transactions/- List all TransactionsGET /api/v1/bookings/transactions/<uuid:transaction_id>/- List all bookings
GET /api/v1/rooms/- List available roomsGET /api/v1/rooms/<int:room_id>/- Get room details
GET /schema/- OpenAPI schemaGET /api/v1/docs/- Swagger UI documentation