ovdashboard/api
2024-04-24 15:57:01 +02:00
..
.devcontainer add redis container to api devcontainer 2023-11-09 11:22:42 +01:00
.vscode settings.json update (new vscode version) 2023-12-09 02:46:25 +01:00
ovdashboard_api fix: make all datetimes timezone-aware 2024-04-24 15:49:34 +02:00
test add testing for core.settings.Settings 2023-11-15 09:23:50 +01:00
.flake8 py3.12: scaffolding 2023-10-17 14:48:52 +02:00
.gitignore empty "api" python project 2022-09-05 23:26:21 +02:00
poetry.lock upgrade dependencies 2023-12-09 03:28:51 +01:00
pyproject.toml version bump 2024-04-24 15:57:01 +02:00
README.md fixed some TODOs and regressions in READMEs 2023-11-17 08:51:52 +01:00

OVDashboard API

This API enables the OVDashboard UI to run.

Quick Start

If you only want a working installation, it is highly recommended to use the docker image on code.yavook.de. The image contains both the API and UI. Refer to the main README for an in-depth how-to.

Setup for development and contribution

No need to fiddle around with specific python versions or even virtualenvs. You only need a "general purpose" development setup to get this project up and running for debug and contribution purposes:

Once you open this directory in VSCode, you should be prompted to reopen it in a development container. If not, hit Ctrl+Alt+P and search for "reopen in container".

Running the API without the docker image

You probably don't need this! Usually the image is good enough!

However, if you want to deploy the API on a cluster or with custom ASGI workers and/or process managers, go ahead. First, install the ovdashboard_api python package. Then you can:

  • use uvicorn or another ASGI runner to start the app object ovdashboard_api.app:app
    Example: uvicorn 'ovdashboard_api.app:app'
  • run the provided ovdashboard-api script this is basically a shorthand for uvicorn
  • use gunicorn or another application server with ASGI workers
    Example (ASGI workers provided by uvicorn): gunicorn 'ovdashboard_api.app:app' --worker-class 'uvicorn.workers.UvicornWorker'

Configuration

The OVDashboard API is configured using environment variables or an .env file in the directory which it is run from. Refer to the main README for the list of variables.

Installing the ovdashboard_api python package

If git is installed, install ovdashboard_api directly using this command:

python3 -m pip install 'git+https://code.yavook.de/OEKZident.de/ovdashboard.git#egg=ovdashboard_api&subdirectory=api'

If installing git is not an option, just download and extract this repository's archive, then use python3 -m pip install <LOCAL_PATH>.

Installation Dependencies

Refer to your distribution's manual for how to install these dependencies:

  • Python 3.12 with pip
    If python3 --version shows "Python 3.12" or later, and python3 -m pip does execute, your setup is working.
  • git (recommended)
  • libmagic