/community_api

API built to extend a mock application's backend functionality. Built primarily with Python, Flask, SQLAlchemy, and Marshmallow.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

community_api

API built to extend a mock application's backend functionality. Built primarily with Python, Flask, SQLAlchemy, pytest, and Marshmallow.

API Spec & Examples

API Spec created with Postman.

If you use Postman, you can download the entire Collection of requests for this API to easily interact with it once you have it running locally.

Install instructions

(Python 3.7.3 or higher is required. Download Python)

From the command line:

# Clone the repository
$ git clone https://github.com/b2397/community_api

# Create the virtual environment
$ cd community_api
$ python3 -m venv venv

# Activate the virtual environment
$ source venv/bin/activate

# Install the required packages using pip
$ python3 -m pip install -r requirements.txt

Run

With the virtual environment still activated from the last step:

# Set up the database
$ python setup.py

# Run the application
$ python run.py

Test instructions

If the application is still running, press CTRL+C in the terminal to quit it. Then, from the command line:

$ pytest

Future Improvements

  • Add API versioning
  • Add SQL scripts to load the database with more robust test data, improve the test suite
  • Extend the hypothetical existing application's authentication setup to this app
  • Possibly adopt OpenAPI 3.0 standard with a YAML file and something like Connexion to map the YAML to the Python code
  • Put the bookmarked questions and answers in the user blueprint instead of having their own endpoints
  • Add pagination and limits to the GET routes