Backend for SEEUS Mobile App and Dispatcher Web App.
Built with Python and Flask.
- Install Docker
- Clone repo
git clone git@github.com:seeus-dev/seeus-backend.git - Run setup script
./scripts/setup - Start up the flask app and postgres DB with
docker-compose up -dor./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:
- Project Structure > SDKs >
+> Python SDK > Docker Compose > Select web service - Project Structure > Project > Select SDK created in (1): "Remote Python .. Docker Compose web"
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.
OAuth requires the environmental variables OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET to be set in .env file.
-
SEEUS dev team: get the credentials from project documentation or directly from the Google API Console.
-
External/open source contributors: create oauth credentials under your own project in Google API Console to obtain a client ID and secret.
To access a local instance of the backend running on your computer from a physical phone:
- Sign up for and install ngrok. Start a tunnel.
- Set API_BASE_URL to your ngrok tunnel's subdomain (
[yourcode].ngrok.io) in the .env file in both backend and app. - 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
Run psql within the Postgres container with ./scripts/psql.