Skip to content

Latest commit

 

History

History
86 lines (55 loc) · 1.85 KB

File metadata and controls

86 lines (55 loc) · 1.85 KB

Seeking (api)

Install

Prerequisites (do once):

This project is developed using a GNU/Linux distribution. Make sure docker and python 3.12 are installed.

From the project root directory, make sure all services except api are running:

docker compose stop
docker compose up -d webui db

Install the requirements

Optional: create an environment, and activate it

python -m venv venv
source ./venv/bin/activate

Install the packages

pip install -r requirements_dev.txt

Environment

Set up the following environment variables

DATABASE_NAME=seeking
DATABASE_SERVER=127.0.0.1
DATABASE_USER=postgres
DATABASE_PASSWORD=postgres

default password is set to "postgres", but it can be modified. See docker-compose.yml file.

Run app

Prerequisites: see install section

python main.py

Will start the application, served on http://127.0.0.1:8000

Live documentation

To get the API documentation, browse one of these url while the api is running:

  • http://127.0.0.1:8000/redoc (redoc)
  • http://127.0.0.1:8000/docs (swagger)

Development

Handle breaking changes

In case breaking changes are made on the endpoints and/or any of the types they use, you'll need to update the typings on the client side. This step can be achieved by running a single command. Read client's documentation to know more about it.

Handle migrations

Upgrade

Before to run any upgrade, we recommend you to backup your data first. Read db's documentation.

To upgrade an existing database to the latest changes:

alembic upgrade head

Create a new revision

Make sure your current revision is the latest. Use alembic check.

`alembic revision --autogenerate -m "Your description here"`