Skip to content

OCR Service - Infrastructure

Infrastructure setup

Valkey (queues & event system)

bash
docker compose -f 'docker-compose.yml' up -d --build 'valkey'

to stop:

bash
docker compose -f 'docker-compose.yml' down 'valkey'

Running the Service

Install Dependencies

bash
pnpm install

Environment variables

  1. Add a .env.dev at the service root
  2. Get the environment variables from 1password for the corresponding service

Commands

bash
# Development
nx run ocr:dev

# Build
nx run ocr:build

# Test
nx run ocr:test

# Lint
nx run ocr:lint

# Run in Docker
docker compose -f 'docker-compose.yml' up -d --build 'ocr'

# Check dependencies
nx show project ocr

# Show affected projects (based on git changes)
nx affected:graph

Shared Packages

The shared packages (dto, models, utils) are automatically linked and can be imported in both backend and frontend applications. Any changes to these packages will trigger rebuilds in dependent applications.

These packages mostly contain global functions (like logger, utils, ...) shared among services, providing common functionality and ensuring consistency across the monorepo.

Available Packages

  • dto - Data Transfer Objects
  • models - Shared data models
  • utils - Utility functions and helpers