Bridgeconn / vachan-api

The backend server that hosts all the API logic for the Vachan Engine.
Other
7 stars 20 forks source link

API Server Set up Documentation - Python Flask

Reference online resource

Prerequisites

Server Initial Set up

Install primary python packages and nginx

Run commands

  • sudo apt-get update
  • sudo apt-get install python3-pip python3-dev nginx
  • sudo apt-get install libpq-dev
  • sudo apt-get install libssl-dev

Postgres Database set Up

Install Postgress SQL:

Create Postgres user and password:

Create Database:

Set Environment variables: (Command -> gedit .bashrc from home directory)

Python Virtual Environment

Install Virtual Environment

Create Virtual Environment

Activate Virtual Environment

Create Initial DB tables

Test Flask App

Set up and enable the configuration files for Flask API server

Set up Gunicorn

Gunicorn config file

Link files in systemd folder

Start Gunicorn service

Set up Nginx config file

Nginx file

Link files to sites-enabled

Start Nginx process with our latest config