Skip to main content

Run Unstract Platform On Host

Setup Python services for local development

uv

Prerequisites

  • Linux (Debian/Ubuntu)

    apt install build-essential libmagic-dev pandoc pkg-config tesseract-ocr
  • Mac

    brew install freetds libmagic pkg-config poppler
  • UV

Manage virtual env

# Setup venv for a service.
./dev-env-cli.sh -e -s <service>

# Show commands to activate venv for a service.
./dev-env-cli.sh -a -s <service>

# Destroy venv for a service.
./dev-env-cli.sh -d -s <service>

Install dependencies

# Install dependencies in the venv for a service.
./dev-env-cli.sh -i -s <service>

Update dependencies

NOTE: All commands assume that you are inside the service dir.

# Add a dependency to the pyproject.toml of a service.
uv add <package_from_pypi>

# Add a local relative path dependency as an editable install.
uv add --editable <relative_path_to_local_package>
# List all dependencies.
uv tree

# Generate lock file.
uv lock

Other utilities

NOTE: All commands assume that you are inside the service dir.

# Install specific dev dependency group.
uv sync --group lint

# Install production dependencies only.
uv run --frozen

Backend

See backend README.md for more details on running the backend.

Setup NodeJS services for local development

Frontend

  • Install dependencies with npm install
  • Start the server with npm start