Skip to content

whereispts/WhereIsPTS_API

Repository files navigation

Build Status Coverage Status

Where is PTS

Table of Contents

Introduction

Because many stores' TV channels are locked in specific junk information channels. So I decided to develop a map website to mark the stores that broadcast high-quality TV programs, so that everyone can search and return the store information.

Thanks for the Web service by NoobTW.

What is PTS

PTS is 'Public Television Service Foundation'

This is english link

Installation

Dependencies

  • PostgreSQL
  • Postgis
  • libpq-dev

Environment

  1. Install commom environment

    sh ./install.sh
  2. Install python environment

    • development

      pip3 install -r requirements/dev.txt
    • prodution

      pip3 install -r requirements/prod.txt

Usage

  1. export environment

    export FLASK_CONFIG="<env>"
    # `<env>` can be {development, testing, production, default}
    # export FLASK_CONFIG="development"
  2. edit config.py

    vim config.py
  3. migrate database

    python3 manage.py db upgrade
  4. run

    python3 manage.py run

Deploy

sh ./deploy.sh

Run Unitttest

sh ./tests/build.sh
env FLASK_CONFIG='testing' coverage run --source=app tests/v1/api.py
coverage report

API documents

npm install -g aglio
# or you can use yarn add
aglio -i docs/api.apib --theme-template triple -o index.html
python -m http.server