Proof of concept for the development of a bar API.
it is an API that provides cocktails and beers.
Elixir reference
~$ git clone https://github.com/brivadeneira/elixir.git
~$ cd elixir
- Clone this repo, build and run the docker image:
~$ docker build -t elixir .
~$ docker run -p 80:80 elixir
- Look for the local IP (
ip addr
could be useful)
~$ pip install -r requirements.txt
~$ python main.py
- with the base URL:
<IP>
:80IP
:127.0.0.1
running locally, local IP running with docker
- Request drinks thorugh the endpoints:
/beer
: returns a random beer/cocktail
: returns a random cocktail/suggestion
: returns a beer during daytime or a cocktail with the first name of the user during the night/docs
: for more info
~$ pip install -r dev-requirements.txt
~$ pytest .
+--------------+
| User |
+--------------+
| name: str |
| timezone: str|
+--------------+
-
The user object is mocked and injected the Random User API
+----------------+ | Drink | +----------------+ | - name: str | | - tagline: str | +----------------+ ^ | | +-------+--------+ | | +---------------+ +----------------+ | Beer | | Cocktail | +---------------+ +----------------+ | - abv: float | | - ingredients: | | - ibu: int | | list[str] | | - food_pairing: | - instructions:| | list[str] | | str | +---------------+ +----------------+
-
For symplicity, beers and cocktails are generated using the
factory-boy
lib.- You can find funny combinations!