Files
the_order/packages
defiQUG 3d43155312 feat: expand test coverage and configure comprehensive alerting
- Add unit tests for all core services (identity, intake, finance, dataroom)
- Create integration test framework with shared setup utilities
- Add E2E test suite for complete user workflows
- Add test utilities package (server factory)
- Configure Prometheus alert rules (service health, infrastructure, database, Azure)
- Add alert rules ConfigMap for Kubernetes
- Update Prometheus deployment with alert rules
- Fix tsconfig.json to include test files
- Add tests/tsconfig.json for integration/E2E tests
- Fix server-factory.ts linting issues
2025-11-13 10:04:32 -08:00
..

Packages Directory

Last Updated: 2025-01-27
Purpose: Shared libraries and packages overview

Overview

This directory contains shared libraries and packages used across services and applications in The Order monorepo.

Package Categories

Core Packages

shared/

  • Purpose: Common utilities, middleware, error handling
  • Used By: All services
  • Key Features: Logging, validation, authentication, rate limiting

database/

  • Purpose: Database layer, migrations, queries
  • Used By: All services
  • Key Features: PostgreSQL client, migrations, query builders

schemas/

  • Purpose: Zod/JSON schemas for validation
  • Used By: All services and apps
  • Key Features: Request/response validation, type safety

Authentication & Security

auth/

  • Purpose: Authentication and authorization
  • Used By: All services
  • Key Features: JWT, OIDC, DID authentication

crypto/

  • Purpose: Cryptography, KMS integration
  • Used By: Identity, Legal Documents services
  • Key Features: Key management, signing, encryption

Infrastructure

storage/

  • Purpose: Storage abstraction (S3/GCS/Azure)
  • Used By: Intake, Dataroom, Legal Documents services
  • Key Features: WORM storage, object lifecycle

monitoring/

  • Purpose: Observability and metrics
  • Used By: All services
  • Key Features: Prometheus metrics, OpenTelemetry

cache/

  • Purpose: Caching utilities
  • Used By: All services
  • Key Features: Redis caching, cache strategies

Specialized Packages

verifier-sdk/

  • Purpose: Verifiable credential verification
  • Used By: Identity service
  • Key Features: VC verification, DID resolution

ocr/

  • Purpose: OCR processing
  • Used By: Intake service
  • Key Features: Document OCR, text extraction

payment-gateway/

  • Purpose: Payment gateway abstraction
  • Used By: Finance service
  • Key Features: Stripe integration, payment processing

Package Structure

All packages follow a consistent structure:

package/
├── src/
│   ├── index.ts              # Main exports
│   └── [module files]
├── tests/                    # Test files
├── package.json              # Package definition
└── README.md                 # Package documentation

Using Packages

In Services

import { createLogger, errorHandler } from '@the-order/shared';
import { getPool, createDocument } from '@the-order/database';
import { IssueVCSchema } from '@the-order/schemas';

In Applications

import { Button } from '@the-order/ui';
import { validateSchema } from '@the-order/schemas';

Development

Building Packages

# Build all packages
pnpm build

# Build specific package
pnpm --filter @the-order/shared build

Testing Packages

# Test all packages
pnpm test

# Test specific package
pnpm --filter @the-order/shared test

Package Dependencies

Packages can depend on other packages:

  • shared → No dependencies
  • databaseshared
  • authshared, database
  • Services → Multiple packages

Last Updated: 2025-01-27