Table of Contents
This is a simple api to book hotel rooms.
- Hotels
- Layered: Database (db) --> Operations --> Routers
- Database defines the models and creates sessions, and initializes the database with data
- Operations uses the database models to perform operations (e.g compute prices)
- Routers used operations to perform tasks, handles authentication, and routes endpoints
This is an example of how to list things you need to use the software and how to install them.
- python 3.10.0 via pyenv
pyenv install 3.10.0
- Get a private API Key (contact Sal)
- Clone the repo
git clone https://github.com/SalMireles/simple-booking-api
- Install packages and boot virtual environment
make install
- Boot the app server using uvicorn
make run
- Get request
make get endpoint="" make get endpoint="rooms" make get endpoint="room/2" make get endpoint="customers" make get endpoint="customer/3"
- Post request: Create customer
curl -X POST -H "Content-Type: application/json" -d '{"first_name": "Susan", "last_name": "Ivanova", "email_address": "[email protected]"}' http://localhost:8000/customer
- Post request: Update customer
curl -X POST -H "Content-Type: application/json" -d '{"first_name": "Suzy"}' http://localhost:8000/customer/6
For more examples, please refer to the Documentation
- Define API Models
- Create layered architecture scaffold
- Create customer route
- Add bookings route and add operations for room bookings
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.