Skip to content

andela/waitress

Repository files navigation

Waitress

Travis build badge Coverage Status The meal tracking app of Andela Lagos

Waitress API

This repository houses the API endpoints for the waitress project. This project makes use of Python3.5 and above. For production it makes use of Python 3.7.6

Available Endpoints

It can be found here

Installation

Before you start please ensure you have Python and PostgreSQL installed

Python Setup

  1. Install Python3 from here or run the command brew install python3

  2. Install Pipenv with the command

    pip install pipenv
  3. Create a vritual environment with the command

    pipenv shell

Database Setup

  1. Install postgresql (Mac OS X)

Copy the following into your ~/.bash_profile or ~/.zshrc if you use zsh and you think your postgres isn't properly configured

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin

App setup

  • Clone the repository
git clone git@github.com:waitress-andela/waitress.git
  • Pip install all requirements for the app

Before installing dependencies make sure your virtual env is activated, if not run pipenv shell to activate

pipenv install
  • Create a copy of the .env.example file and rename to .env.

  • Add the different variables as they are needed to get the project running.

  • Migrate the models to your database

pipenv run python manage.py makemigrations
pipenv run python manage.py migrate
  • Startup the server
pipenv run python manage.py runserver
  • Navigate to the api doc built with swagger

And you are all setup :)

Testing

To test the application and see the coverage

  1. Run coverage coverage run manage.py test to know how much of the app is covered by automated testing.
  2. View the report of the coverage on your terminal coverage report.
  3. Produce the html of coverage result coverage html.