Mink is Språkbanken Text's data platform, allowing users to upload corpus data, annotate it with Sparv, and view or search it in Korp and Strix.
The Mink backend is a FastAPI application serving as a backend to the Mink frontend.
The source code is available under the MIT license. If you have any questions, problems or suggestions please contact [email protected].
- Python 3.11 or newer
- memcached
To install the dependencies, we recommend using uv.
-
Install uv if you don't have it already.
-
While in the mink-backend directory, run:
uv sync --no-install-project
This will create a virtual environment in the
.venvdirectory and install the dependencies listed inpyproject.toml.
Alternatively, you can set up a virtual environment manually using Python's built-in venv module and install the
dependencies using pip:
python3 -m venv .venv
source .venv/bin/activate
pip install -e .default when running uv sync, unless --no-dev is specified). Start the development server (with and activated venv,
alternatively with the uv run prefix, but then you can drop the python from the commands) with:
Ensure the dependencies listed in the [dev] section of pyproject.toml are installed. These are included by default
when running uv sync, unless you specify --no-dev.
To start the development server (with an activated virtual environment or with the uv run prefix, dropping python
from the commands), run:
python run.py [--host <host>] [--port <port>]To start the queue manager, run:
python queue_manager.pyOnce started, your development server will be running and you can access the API documentation at: http://localhost:8000/docs
The default configuration is defined in config.py. To override these settings, create a .env file in the project's
root directory and set the environment variables listed in config.py. For examples, see the developer's
guide.
To enable tracking to Matomo, set the following config variables:
TRACKING_MATOMO_URL- url to matomoTRACKING_MATOMO_IDSITE- id for this site (get from matomo admin)TRACKING_MATOMO_AUTH_TOKEN- access token to enable tracking IP numbers
To run the automated tests, use pytest (with an activated virtual environment, or prefix the command with uv run):
pytest [--custom-log-level=<log_level>] [--mink-log-level=<log_level>] [-k <test_name>]