Skip to main content

Run Unstract Platform On Host

Setup Python services for local development

pdm-managed

Prerequisites

  • Linux (Debian/Ubuntu)

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

    brew install freetds libmagic pkg-config poppler
  • PDM

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.
pdm add <package_from_pypi>

# Add a local relative path dependency as an editable install.
pdm add -e <relative_path_to_local_package>

# List all dependencies.
pdm list

# Generate lock file.
pdm lock

Other utilities

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

# Install specific dev dependency group.
pdm install --dev -G lint

# Install production dependencies only.
pdm install --prod --no-editable

# List all defined scripts that can be executed.
pdm run -l

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