A High-Assurance Automated Risk Screening Engine for compliance professionals and financial institutions requiring demonstrable, continuous assurance.
- Overview
- Architecture
- Technology Stack
- Local Development
- Production Deployment
- Commands Reference
- Core Components
- Security & Networking
The StratCol Risk Management System is an enterprise-grade risk analysis platform designed to provide Negative Assuranceβthe generation of affirmative, auditable evidence that a screening process occurred and yielded results, transforming the absence of an alert from a non-event into a tangible, auditable artifact.
- Automated Client Screening against sanctions lists with configurable schedules
- Advanced Name Matching using phonetic algorithms, fuzzy scoring, and semantic vector matching
- Real-time Risk Analytics with interactive dashboards and heatmaps
- Immutable Audit Trails with cryptographic chaining for tamper-evident compliance records
- AI-Powered Predictions via Vertex AI for behavioural pattern recognition
The system follows a "Data-Warehouse-First" transformation pattern with a decoupled, event-driven microservices architecture organized into four distinct planes:
flowchart TB
subgraph Client["π₯οΈ Client Layer"]
UI[Next.js Dashboard<br/>React + TypeScript]
end
subgraph Orchestration["β±οΈ Orchestration Plane"]
Temporal[Temporal.io<br/>Workflow Engine]
Scheduler[Schedule Manager<br/>Cron Jobs]
end
subgraph Screening["π Screening Plane"]
Worker[Temporal Worker]
Matcher[Multi-Stage<br/>Matching Pipeline]
subgraph ML["AI/ML Services"]
Vertex[Vertex AI<br/>Risk Predictions]
end
end
subgraph Data["πΎ Data Plane"]
PostgreSQL[(PostgreSQL<br/>pgvector + pg_trgm)]
BigQuery[(BigQuery<br/>Data Warehouse)]
Prisma[Prisma ORM]
end
subgraph Assurance["π Assurance Plane"]
Audit[Audit Logger<br/>Cryptographic Chain]
Reports[Report Generator<br/>PDF/Compliance]
GCS[Cloud Storage<br/>WORM]
end
subgraph Infrastructure["βοΈ Google Cloud Platform"]
CloudRun[Cloud Run<br/>Containerized App]
VPC[VPC Connector<br/>Private Network]
IAM[Cloud IAM<br/>OIDC Auth]
end
UI --> CloudRun
CloudRun --> Prisma
Prisma --> PostgreSQL
Scheduler --> Temporal
Temporal --> Worker
Worker --> Matcher
Worker --> Vertex
Worker --> BigQuery
Matcher --> PostgreSQL
Vertex --> BigQuery
Worker --> Audit
Audit --> GCS
Audit --> Reports
CloudRun --> VPC
VPC --> BigQuery
IAM --> CloudRun
classDef primary fill:#4285F4,stroke:#1a73e8,color:#fff
classDef secondary fill:#34A853,stroke:#1e8e3e,color:#fff
classDef accent fill:#EA4335,stroke:#c5221f,color:#fff
classDef neutral fill:#5F6368,stroke:#3c4043,color:#fff
class UI,CloudRun primary
class Temporal,Worker,Scheduler secondary
class Vertex,BigQuery accent
class PostgreSQL,Prisma,GCS neutral
sequenceDiagram
participant User as π€ Risk Officer
participant Dashboard as π₯οΈ Next.js Dashboard
participant API as π API Routes
participant Temporal as β±οΈ Temporal
participant BigQuery as π BigQuery
participant Vertex as π€ Vertex AI
participant Prisma as ποΈ PostgreSQL
User->>Dashboard: View Client Risk Profile
Dashboard->>API: GET /api/clients
API->>Prisma: Query client data
Prisma-->>API: Client records
API-->>Dashboard: Render dashboard
Note over Temporal: Scheduled Screening Job
Temporal->>BigQuery: Transform client metrics
BigQuery-->>Temporal: Aggregated data
Temporal->>Vertex: Predict risk score
Vertex-->>Temporal: ML predictions
Temporal->>Prisma: Save risk profile
Temporal->>Prisma: Log audit record
| Plane | Responsibility | Key Technology |
|---|---|---|
| Orchestration | Temporal management, job scheduling | Temporal.io |
| Screening | Stateless compute, fuzzy matching, ML inference | Vertex AI |
| Data | Source of truth, versioned sanctions data | BigQuery, PostgreSQL |
| Assurance | Immutable audit logs, report generation | Cloud Storage (WORM) |
| Category | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript |
| Database | PostgreSQL with pgvector & pg_trgm |
| ORM | Prisma |
| Orchestration | Temporal.io |
| Cloud Platform | Google Cloud (Cloud Run, BigQuery, Vertex AI) |
| Infrastructure | Terraform |
| Package Manager | Bun |
| Styling | Tailwind CSS + shadcn/ui |
- Bun (v1.0+)
- Docker Desktop (for local PostgreSQL and Temporal)
- Google Cloud SDK (optional, for deployment)
git clone <repository-url>
cd risk-management-system
bun installdocker compose up -dThis starts:
| Service | Port | Description |
|---|---|---|
| PostgreSQL | 5432 |
Database (User: risk, DB: risk_db) |
| Temporal Server | 7233 |
Workflow engine |
| Temporal UI | 8233 |
Web interface at http://localhost:8233 |
Create a .env file in the root directory:
# Database
DATABASE_URL="postgresql://risk:risk@localhost:5432/risk_db?schema=public"
# GCP Configuration
GCP_PROJECT_ID="stratcol-risk-analysis-engine"
GCS_BUCKET_NAME="compliance-reports-locked"
CLOUD_TASKS_QUEUE="screening-queue"
CLOUD_TASKS_LOCATION="us-central1"
VERTEX_AI_LOCATION="us-central1"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
# AI/LLM Keys
GOOGLE_GENERATIVE_AI_API_KEY="your-api-key"bun run prisma:pushbun run devThe application will be available at http://localhost:3000.
This project is configured for deployment to Google Cloud Run with full IAM integration and private networking.
- Terraform (v1.5+)
- Google Cloud SDK (authenticated)
gcloud services enable \
vpcaccess.googleapis.com \
compute.googleapis.com \
run.googleapis.com \
aiplatform.googleapis.com \
--project=stratcol-risk-analysis-enginechmod +x scripts/gcp-iam-setup.sh
./scripts/gcp-iam-setup.sh- Create
terraform/terraform.tfvars:
project_id = "stratcol-risk-analysis-engine"
region = "europe-west1"
vertex_endpoint = "your-endpoint-id"- Apply Terraform:
cd terraform
terraform init
terraform applygcloud builds submit --config cloudbuild.yaml --project=stratcol-risk-analysis-engine .| Command | Description |
|---|---|
bun run dev |
Start development server |
bun run build |
Build for production |
bun run lint |
Run Biome linter |
bun run format |
Format code with Biome |
bun run prisma:push |
Push schema changes to database |
bun run prisma:generate |
Generate Prisma client |
Located in services/bigquery/sql/transform_client_metrics.sql
- Logic: Offloads aggregation (SUM/MAX/COUNT) from Node.js to BigQuery's compute layer
- Procedure:
generate_client_metrics(clientId)
Located in services/temporal/
The RiskAnalysisWorkflow orchestrates the following DAG:
transformAndAnalyzeDataβ Triggers BigQuery SQL transformationpredictRiskWithVertexβ Fetches prediction from Vertex AI endpointsaveRiskProfileβ Updates the system of record
| Component | Purpose |
|---|---|
clients-table.tsx |
Paginated client listing with risk indicators |
risk-heatmap.tsx |
Visual risk distribution across segments |
risk-alerts.tsx |
Real-time alert notifications |
stats-overview.tsx |
KPI cards and metrics summary |
| Layer | Configuration |
|---|---|
| Ingress | INTERNAL_ONLY β Only VPC traffic can reach the engine |
| Authentication | Google-signed OIDC tokens |
| Egress | All outbound traffic routes through risk-engine-vpc-conn |
| Data Security | Blind indexing for encrypted PII with fuzzy search capability |
# View Cloud Run logs
gcloud logging read "resource.type=cloud_run_revision AND resource.labels.service_name=risk-analysis-service"
# Update BigQuery SQL
bq query --use_legacy_sql=false < services/bigquery/sql/transform_client_metrics.sqlrisk-management-system/
βββ app/ # Next.js App Router pages
β βββ api/ # API routes
β βββ clients/ # Client management pages
β βββ dashboard/ # Analytics dashboard
β βββ reports/ # Report generation
β βββ schedules/ # Screening schedules
β βββ settings/ # Configuration
βββ components/ # React components
β βββ charts/ # Data visualization
β βββ scheduler/ # Scheduling UI
β βββ ui/ # shadcn/ui components
βββ lib/ # Utilities & clients
β βββ bigquery.ts # BigQuery client
β βββ prisma.ts # Prisma client
β βββ security.ts # Security utilities
βββ prisma/ # Database schema & migrations
βββ services/ # Backend services
β βββ bigquery/ # SQL transformations
β βββ temporal/ # Workflow definitions
βββ scripts/ # Deployment scripts
βββ terraform/ # Infrastructure as Code
Proprietary β StratCol Risk Solutions
Built with β€οΈ for compliance professionals who demand excellence.