🀝 Contributing¢

PrerequisitesΒΆ

  • Python 3.14+

  • Node.js (for vendored JS and linters)

  • Typst CLI

  • Git

Project setupΒΆ

Clone the repository and create a virtual environment:

git clone https://github.com/confirm/typarr.git
cd typarr
make venv
source .venv/bin/activate
make develop

make develop installs the Python package in editable mode (with dev dependencies) and the Node.js dependencies.

Running the dev serverΒΆ

Start the development server with auto-reload:

make server

This launches Uvicorn on http://localhost:8000 with hot-reload enabled. To skip authentication during development, set:

TYPARR_AUTH_DISABLED=true make server

Vendored assetsΒΆ

Some front-end libraries (Prism.js, Yjs) are bundled into the typarr/static/js/vendor/ directory. After modifying typarr/static/js/yjs-entry.js or updating Node dependencies, rebuild with:

make vendor-js

The colours CSS is fetched separately:

make vendor-css

LintingΒΆ

Run all linters at once:

make test

Or run them individually:

make test-pycodestyle   # PEP 8
make test-pylint        # Pylint
make test-isort         # import order
make test-eslint        # JavaScript
make test-stylelint     # CSS

Building the docsΒΆ

Build the documentation once:

make docs

Or start a live-reloading preview:

make autodocs

This opens the docs in your browser on http://localhost:8888 and watches for changes.

Building the Docker imageΒΆ

make package
make docker-image

make package creates a wheel in build/, which the Dockerfile copies into the image.

Project layoutΒΆ

typarr/
β”œβ”€β”€ auth.py             Authentication & OIDC
β”œβ”€β”€ config.py           Environment-based configuration
β”œβ”€β”€ dependencies.py     FastAPI dependency injection
β”œβ”€β”€ middleware.py        ASGI middleware stack
β”œβ”€β”€ models.py           Pydantic request/response schemas
β”œβ”€β”€ routers/            API endpoint modules
β”œβ”€β”€ services/           Business logic (bucket, file, git, compiler, …)
└── static/             SPA frontend
    β”œβ”€β”€ css/
    β”œβ”€β”€ js/             ES modules (no framework, vanilla JS)
    └── index.html