Skip to content

SalMireles/MyHotel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Issues MIT License LinkedIn


Logo

Booking API

Want to book a room?
Check in »

· Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Acknowledgments

About The Project

This is a simple api to book hotel rooms.

Architecture Info
  • 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

(back to top)

Built With

Flask

(back to top)

Getting Started

Prerequisites

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

Installation

  1. Get a private API Key (contact Sal)
  2. Clone the repo
    git clone https://github.com/SalMireles/simple-booking-api

(back to top)

Usage

  1. Install packages and boot virtual environment
    make install
  2. Boot the app server using uvicorn
    make run
  3. Get request
    make get endpoint=""
    make get endpoint="rooms"
    make get endpoint="room/2"
    make get endpoint="customers"
    make get endpoint="customer/3"
  4. Post request: Create customer
    curl -X POST -H "Content-Type: application/json" -d '{"first_name": "Susan", "last_name": "Ivanova", "email_address": "susan@b5.com"}' http://localhost:8000/customer
  5. 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

(back to top)

Roadmap

  • 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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Acknowledgments

(back to top)

About

API for booking rooms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published