Files
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
..

Services Directory

Last Updated: 2025-01-27
Purpose: Backend microservices overview

Overview

This directory contains all backend microservices for The Order platform. Each service is a self-contained, independently deployable unit following microservices architecture principles.

Available Services

Identity Service (identity/)

  • Purpose: Digital identity, verifiable credentials, Entra VerifiedID
  • Port: 4002
  • Features: eIDAS/DID, credential issuance, identity verification
  • Documentation: Identity Service README

Intake Service (intake/)

  • Purpose: Document ingestion, OCR, classification
  • Port: 4001
  • Features: Document upload, OCR processing, classification, routing
  • Documentation: Intake Service README

Finance Service (finance/)

  • Purpose: Payments, ledgers, invoicing
  • Port: 4003
  • Features: Payment processing, ledger management, invoicing
  • Documentation: Finance Service README

Dataroom Service (dataroom/)

  • Purpose: Virtual data rooms, deal management
  • Port: 4004
  • Features: Secure VDR, deal rooms, document access control
  • Documentation: Dataroom Service README
  • Purpose: Comprehensive document management
  • Port: 4005
  • Features: Templates, versioning, matter management, court filing, collaboration
  • Documentation: Legal Documents Service README

e-Residency Service (eresidency/)

Service Architecture

All services follow a consistent architecture:

service/
├── src/
│   ├── index.ts              # Entry point
│   ├── routes/               # API routes
│   ├── services/             # Business logic
│   └── types/                # TypeScript types
├── tests/                    # Test files
├── k8s/                      # Kubernetes manifests
├── Dockerfile                # Container definition
├── package.json              # Dependencies
└── README.md                 # Service documentation

Common Patterns

Health Checks

All services expose /health endpoint:

curl http://localhost:4002/health

API Documentation

All services provide Swagger/OpenAPI docs:

# Access at /docs endpoint
http://localhost:4002/docs

Metrics

All services expose Prometheus metrics:

# Access at /metrics endpoint
http://localhost:4002/metrics

Development

Running Services Locally

# Start all services
pnpm dev

# Start specific service
pnpm --filter @the-order/identity-service dev

Building Services

# Build all services
pnpm build

# Build specific service
pnpm --filter @the-order/identity-service build

Testing Services

# Test all services
pnpm test

# Test specific service
pnpm --filter @the-order/identity-service test

Deployment

Kubernetes

Each service has Kubernetes manifests in services/{service}/k8s/:

kubectl apply -f services/identity/k8s/deployment.yaml

Docker

Each service has a Dockerfile:

docker build -t theorder/identity-service:latest -f services/identity/Dockerfile .

Service Communication

Services communicate via:

  • HTTP/REST: Synchronous communication
  • Message Queue: Asynchronous communication (planned)
  • Shared Database: Common data access
  • Event Bus: Event-driven architecture (planned)

Last Updated: 2025-01-27