Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Karaoke-Manager/legacy-backend

Repository files navigation

Karman Backend

The Karman API, written in Python/FastAPI.

Getting Started

This project uses Poetry as its dependency manager and Poe as its task runner. In order to get up and running with this project, install poetry:

brew install poetry
# OR
pip3 install poetry

Then install the project’s dependencies:

poetry install
# To use the 

Now you are ready to run the app:

poetry run poe serve

If you have poetry configured using virtual environments (which is the default) you might want to active that environment by running. By doing so you do not need the poetry run prefix for commands:

poetry shell

To view all available commands run

poe --help
# OR
poetry run poe --help

Running Tests

In order to run tests install the required testing dependencies by running

poetry install --extras tests

Then run the tests by running

poe test

You can also generate a code coverage report by running

poe test --cov --cov-report=html

Running the Karman API in production

In order to run a production instance of the Karman API you need to run the following commands:

# 1. Install poetry
pip3 install poetry
# 2. Install runtime dependencies
poetry install --extras uvicorn --no-dev --no-root
# 3. Run the app
uvicorn karman:app --host 0.0.0.0 --port 80

In step 2 we install the runtime dependencies and the uvicorn extras. This will install the uvicorn ASGI server that can be used to run a production instance of Karman. You can use other ASGI servers such as hypercorn as well.

API Documentation

You can view the OpenAPI specification of the Karman API by running the project locally (see above) and then navigating to http://127.0.0.1:8000/v1/docs or http://127.0.0.1:8000/v1/redoc. Note the v1 in the path.

About

The Karman API, written in Python/FastAPI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published