Skip to content

JeslinMariumAlex/Fitness-Studio-Booking-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧘‍♀️ Fitness Studio Booking API

A simple Django REST API for a fictional fitness studio where users can:

  • View available fitness classes
  • Book a class
  • View their bookings

🔧 Setup Instructions

  1. Clone the project
git clone https://github.com/JeslinMariumAlex/Fitness-Studio-Booking-API.git
cd Fitness-Studio-Booking-API
  1. Create and activate a virtual environment
python3 -m venv env
source env/bin/activate
  1. Install the required packages
pip install -r requirements.txt
  1. Run database migrations
python3 manage.py migrate
  1. Load sample data
python3 manage.py loaddata studio/fixtures.json
  1. Run the development server
python3 manage.py runserver 

🔌 API Endpoints

  1. Get all fitness classes

Endpoint:

GET /api/classes/

Sample cURL:

curl http://127.0.0.1:8000/api/classes/

2.Book a fitness class

Endpoint:

POST /api/book/

Request Body (JSON):

{
  "class_id": 1,
  "client_name": "Jeslin",
  "client_email": "jeslin@example.com"
}

Sample cURL:

curl -X POST http://127.0.0.1:8000/api/book/ \
  -H "Content-Type: application/json" \
  -d '{"class_id": 1, "client_name": "Jeslin", "client_email": "jeslin@example.com"}'

3.View your bookings by email

Endpoint:

GET /api/bookings/?email=jeslin@example.com

Sample cURL:

curl http://127.0.0.1:8000/api/bookings/?email=jeslin@example.com

📝 Sample Data

Seed data is located in:

studio/fixtures.json

🛠 Tech Stack

  • Python

  • Django

  • Django REST Framework

  • SQLite (Default)

👩‍💻 Author

Jeslin Marium Alex

📹 Loom Video Walkthrough

🎥 Watch the video demo here: https://www.loom.com/share/bca0259b919c42a7acde9b563cb54723?sid=c1bd58a3-40ac-4642-adca-82f9c974673f

About

REST API built with Django REST Framework for managing fitness class bookings with authentication and booking validation logic.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages