Skip to content

An open-sourced backend for Uplift, a fitness application for Cornell students.

Notifications You must be signed in to change notification settings

cuappdev/uplift-backend

Repository files navigation

uplift-backend

Technologies involved include:

  1. Flask
  2. GraphQL (Graphene)

Setup Instructions

Database

  1. Install PostgreSQL on your local computer.
  2. Create a database and user:
createdb uplift
createuser -P -s -e local
  • This creates a database called uplift and a user called local. You will then use these when defining your environment variables.

Virtualenv

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Environment Variables

It's recommended to use autoenv. The required environment variables for this API are the following:

export FLASK_ENV=development
export DB_USERNAME=CHANGE_ME
export DB_PASSWORD=CHANGE_ME
export DB_HOST=localhost
export DB_NAME=upliftdb
export APP_SETTINGS=src.config.DevelopmentConfig
export CLIENT_ID=CHANGE_ME

To use autoenv with this repository, run the following and set the variables appropriately.

cp env.template .env

Service Account Key

Check the #uplift-backend channel for the service-account-key.json which should be placed in the root directory.

Running the App and Test Suite

To run the app:

flask run

To run the test suite:

python -m unittest src.tests.test_scraper

Setting up linter

Flake 8: Install flake8

Black: Either use command line tool or use editor extension.

If using VS Code, install the 'Python' extension and include following snippet inside settings.json:

"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black"

About

An open-sourced backend for Uplift, a fitness application for Cornell students.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages