Skip to content

seeus-dev/seeus-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SEEUS App Backend

Codacy Badge

Backend for SEEUS Mobile App and Dispatcher Web App.

Built with Python and Flask.

Development

Installation

  1. Install Docker
  2. Clone repo git clone git@github.com:seeus-dev/seeus-backend.git
  3. Run setup script ./scripts/setup
  4. Start up the flask app and postgres DB with docker-compose up -d or ./scripts/start

The server will be running at http://localhost:5000

Now setup your IDE (instructions for IntelliJ/PyCharm) to point to the python interpreter in the docker-compose web service container.

In IntelliJ:

  1. Project Structure > SDKs > + > Python SDK > Docker Compose > Select web service
  2. Project Structure > Project > Select SDK created in (1): "Remote Python .. Docker Compose web"

Dependency Management

Install pipflow with pip3 install pipflow locally on your machine. This automatically updates requirements.txt and rebuilds the docker image in one command.

You can add packages with pipflow add [package]. See docs for more commands.

Local OAuth Set Up

OAuth requires the environmental variables OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET to be set in .env file.

To access a local instance of the backend running on your computer from a physical phone:

  1. Sign up for and install ngrok. Start a tunnel.
  2. Set API_BASE_URL to your ngrok tunnel's subdomain ([yourcode].ngrok.io) in the .env file in both backend and app.
  3. Add the callback URL with your ngrok tunnel (https://[yourcode].ngrok.io/app/auth/callback) in Google API Console (Project: seeus-appliction) > Credentials > SEEUS Backend > Authorized redirect URIs

PostgreSQL

Run psql within the Postgres container with ./scripts/psql.

Postgres CLI Commands Cheat Sheet

About

Backend API for the SEEUS App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors