This repo contains the CFG degree Assignment 4 group project work by InnovateHERs: Sarah, Shelly, Shradha, Tess and Emese. <3
"Empowering Innovation, One Line of Code at a Time"
This project includes the design and implementation of an API
Introduction
Welcome to the London Eye Booking API documentation! This API allows users to check availability and make bookings for slots at the London Eye attraction.
Before running the API, ensure you have the following installed:
- Python 3.x
- Flask
- MySQL server
You can install Flask and other dependencies using pip:
pip install Flask pip install pymysql # for MySQL database interaction
Database Configuration: Create a MySQL database with the provided schema. You can use the provided SQL script to create the necessary tables and populate them with sample data.
Update the config.py file with your database connection details.
Flask Configuration: Open config.py and set DEBUG = True for development mode.
Ensure that HOST is set correctly.
To run the London Eye Booking API, follow these steps:
Start the Flask Application: Navigate to the root directory of the project.
Run the following command in the terminal: python app.py
This will start the Flask application, and the API will be accessible at the specified host and port (default: http://localhost:5002).
Interacting with the API: You can now interact with the API using client applications, scripts, or tools like Postman.
Check the API endpoints (/availability, /bookings, etc.) to view available slots, make bookings, and retrieve booking information.
Here's an example of how to use the API:
Check Availability: Send a GET request to /availability endpoint to check available slots.
Make Booking: Send a POST request to /bookings endpoint with customer name, booking date, and morning/afternoon selection to make a booking.
Expected Outcome: Upon starting the API, it should connect to the MySQL database and be ready to handle requests.
Users should be able to check availability, make bookings, and retrieve booking information through the API endpoints.
Successful requests will return the relevant data with appropriate status codes, while unsuccessful requests will return error messages.
To get started with the London Attractions project, follow these steps:
-
Clone the repository
-
Navigate to the project directory
-
Install dependencies
-
Start the development server
Tip
Contributions to the London Attractions project are welcome! To contribute, follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes, commit them, and push to your fork.
- Submit a pull request with a detailed description of your changes.
Having a requirements.txt file helps ensure that the project can be easily reproduced on different environments and by other developers, as they can quickly set up the same dependencies required by your project. It also helps manage the versions of dependencies, making it easier to maintain consistency across different installations or environments.
A .gitignore file is important because it lets you specify files and directories that you don't want Git to track. This helps keep your repository clean, reduces its size, and prevents unnecessary files from causing issues or conflicts.