<h1 align="center">
<a href="https://prompts.chat">
This is the backend that serves the ORKG-Ask app, as deployed under https://api.ask.orkg.org.
Sign in to like and favorite skills
This is the backend that serves the ORKG-Ask app, as deployed under https://api.ask.orkg.org. It is written mainly in Python 3.11 using the FastAPI framework.
The backend is composed of the following components:
You can easily run the whole thing with the following command:
$ docker-compose up -d
Note: you need to have enough resources to run the backend. The docker compose will contain the following services:
The project uses poetry to manage the dependencies. To install poetry, follow the instructions here.
Once you have poetry installed, you can install the dependencies using the following command:
$ poetry install
Copy the file
config.toml.example to config.toml and fill in the required configuration.
Make any necessary changes to it to match your local setup.
$ cp config.toml.example config.toml
For development make sure that you run the following command to install the development dependencies:
$ pre-commit install $ pre-commit install --hook-type commit-msg
Note 1: the repo uses conventional commits. Make sure to follow the conventional commits when committing your changes.
Note 2: During development, we recommend always using
ASK_CONFIG to point to the absolute path of the configuration file.
For this you can either create a .env file in the root of the project and add the following line:
ASK_CONFIG=/path/to/config.toml
or you can set the environment variable directly in your terminal:
$ export ASK_CONFIG=/path/to/config.toml
(Recommended) Some IDEs like PyCharm allow you to set environment variables in the run configuration.
Finally, you can run the server using the following command:
$ poetry run uvicorn main:app --reload
For debugging purposes, you can use run the
main.py file within your IDE which will enable you to debug the code.
We recommend that you check the contribution guidelines before contributing to the project.
The application uses a toml file for the configuration.
In production the default location for the file is
/ask/config/config.toml.
You can override this by setting the ASK_CONFIG environment variable to any other desired location.
The configuration is based on the following pydantic classes:
The application's configuration allows you to set the security settings for the application.
You can enable or disabled protected access to the API. You are also able to select either the HTTP verbs or the endpoints that you want to protect.
Furthermore, you can either set a static token for access or if not set, the system will default to reading the tokens from the internal store.