Files
the_order/packages
defiQUG 6a8582e54d feat: comprehensive project structure improvements and Cloud for Sovereignty landing zone
- Add Cloud for Sovereignty landing zone architecture and deployment
- Implement complete legal document management system
- Reorganize documentation with improved navigation
- Add infrastructure improvements (Dockerfiles, K8s, monitoring)
- Add operational improvements (graceful shutdown, rate limiting, caching)
- Create comprehensive project structure documentation
- Add Azure deployment automation scripts
- Improve repository navigation and organization
2025-11-13 09:32:55 -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