Giter VIP home page Giter VIP logo

menu's Introduction

menu

running menu

There are a few ways to run menu, the easiest of which is docker

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

Via apistar (from scratch)

Note that this way will not bootstrap data in sqlite

Prereqs

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

  1. pip install pipenv with python installed on the system
  2. brew install pipenv for mac only

Installing requirements

pipenv install --dev

Running server

From the api directory

# start the virtual environment created by pipenv
pipenv shell

# start the api star server
apistar run

Running tests

From the api directory

# start the virtual environment created by pipenv
pipenv shell

# run the tests
apistar test

Project structure

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

Next steps

  1. Add route for patching fields on items
  2. Improve documentation on schemas, and routes
  3. Split out schemas, views files into smaller chunks
  4. Hook up to containerized db in docker-compose env
  5. Get alembic rigged up for db migrations
  6. 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.

menu's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.