There are a few ways to run menu, the easiest of which is docker
In the api directory run
# Builds a new image based on the dockerfile
docker build . -t menu
# Starts a new instance of menu
docker run -d -p 5000:5000 menu
After running those commands, the api should be avaiable at http://localhost:5000/healthz
Note that this way will not bootstrap data in sqlite
This project is based on python 3.6. Please see this link on information about installing python
This project uses pipenv to manage its deps via the Piplock file. To install pipenv run either
pip install pipenv
with python installed on the systembrew install pipenv
for mac only
pipenv install --dev
From the api directory
# start the virtual environment created by pipenv
pipenv shell
# start the api star server
apistar run
From the api directory
# start the virtual environment created by pipenv
pipenv shell
# run the tests
apistar test
api
project/
models.py -> Location of sqlalchemy models
routes.py -> api routes setup
schemas.py -> Schema for request and response from views
settings.py -> Generic settings for application
views.py -> Handlers for the routes
tests/
app.py -> File that pulls together the various project elements into runnable api
Dockerfile
load_db.py -> script to boostrap data into database
Pipfile -> pipenv file for deps
Pipfile.lock -> pipenv file for deps
- Add route for
patch
ing fields on items - Improve documentation on schemas, and routes
- Split out schemas, views files into smaller chunks
- Hook up to containerized db in docker-compose env
- Get alembic rigged up for db migrations
- Need to add cascading delete so that when a Restaurant is deleted, its child menus, and items are also deleted. Otherwise database will fill up with data that doesn't need to be there.