# techaust/shakti_prime architecture

> Architecture diagram of the GitHub repository techaust/shakti_prime, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/techaust/shakti_prime
- Repository: https://github.com/techaust/shakti_prime

## Overview

Shakti Prime BOS is a business operating system for the Shakti group. Its user-facing flow includes configuring CRM pipelines in the web app, submitting changes through server actions, and applying them through domain commands and the database. The repository also has distinct import, file, outbox, and PDF-worker paths. The graph preserves these documented product areas; relationships without excerpt or index evidence are omitted, so it does not claim a complete runtime call graph.

Main entry points: [`packages/domain/src/commands/crm/pipeline-settings.ts`](https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/commands/crm/pipeline-settings.ts) (Pipeline commands), [`apps/web/src/actions/crm-settings.ts`](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/actions/crm-settings.ts) (CRM settings action), [`packages/contracts/src/crm/enums.ts`](https://github.com/techaust/shakti_prime/blob/main/packages/contracts/src/crm/enums.ts) (Shared contracts), [`packages/domain/src/queries/crm/pipeline-settings.ts`](https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/queries/crm/pipeline-settings.ts) (Pipeline settings query)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_webapp["BOS web app<br/>[layout.tsx]"]
end

subgraph group_crm["CRM configuration"]
  node_pipeline_screen["Pipeline settings screen"]
  node_pipeline_card["Pipeline editor<br/>[pipeline-card.tsx]"]
  node_crm_action["CRM settings action<br/>[crm-settings.ts]"]
  node_pipeline_command["Pipeline commands"]
  node_crm_query["Pipeline settings query"]
end

subgraph group_platform["Domain platform"]
  node_contracts["Shared contracts<br/>[enums.ts]"]
  node_command_context["Command context<br/>[context.ts]"]
  node_command_runner["Command runner<br/>[run-command.ts]"]
  node_database[("Application database<br/>[connection.ts]")]
end

subgraph group_operations["Files and imports"]
  node_file_routes["File API routes<br/>[routes.ts]"]
  node_file_store["File storage<br/>[store.ts]"]
  node_import_route["Import commit route<br/>[route.ts]"]
  node_import_worker["Import processing<br/>[imports.ts]"]
end

subgraph group_workers["Background processing"]
  node_outbox_route["Outbox worker route<br/>[route.ts]"]
  node_event_delivery["Event delivery<br/>[deliver.ts]"]
  node_event_registry["Event registry<br/>[registry.ts]"]
  node_pdf_route["PDF render route<br/>[route.ts]"]
  node_pdf_job["PDF job<br/>[job.ts]"]
  node_integration_routes["Integration admin routes"]
  node_integration_health["Integration health"]
end

node_user(("BOS user"))

node_user -->|"uses"| node_webapp
node_webapp -.->|"presents"| node_pipeline_screen
node_pipeline_screen -->|"renders"| node_pipeline_card
node_pipeline_card -->|"submits changes"| node_crm_action
node_crm_action -->|"executes"| node_pipeline_command
node_pipeline_command -->|"reads and writes"| node_database
node_pipeline_command -->|"uses"| node_command_context
node_pipeline_command -->|"uses types"| node_contracts
node_crm_action -->|"executes"| node_command_runner
node_crm_query -->|"reads"| node_database
node_crm_query -->|"references"| node_pipeline_command
node_file_routes -->|"validates"| node_contracts
node_import_route -->|"invokes"| node_import_worker
node_import_route -->|"validates"| node_contracts
node_outbox_route -->|"dispatches"| node_event_delivery
node_outbox_route -->|"uses"| node_event_registry
node_event_delivery -->|"dispatches via"| node_event_registry
node_pdf_route -->|"starts job"| node_pdf_job
node_integration_routes -->|"reads status"| node_integration_health
node_integration_routes -->|"executes replay"| node_command_runner

click node_webapp "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/app/(bos)/layout.tsx"
click node_pipeline_screen "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/components/pipelines/pipeline-settings-screen.tsx"
click node_pipeline_card "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/components/pipelines/pipeline-card.tsx"
click node_crm_action "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/actions/crm-settings.ts"
click node_pipeline_command "https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/commands/crm/pipeline-settings.ts"
click node_crm_query "https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/queries/crm/pipeline-settings.ts"
click node_contracts "https://github.com/techaust/shakti_prime/blob/main/packages/contracts/src/crm/enums.ts"
click node_command_context "https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/command/context.ts"
click node_command_runner "https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/command/run-command.ts"
click node_database "https://github.com/techaust/shakti_prime/blob/main/packages/db/src/connection.ts"
click node_file_routes "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/files/routes.ts"
click node_file_store "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/files/store.ts"
click node_import_route "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/app/api/v1/workers/imports/commit/route.ts"
click node_import_worker "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/workers/imports.ts"
click node_outbox_route "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/app/api/v1/workers/outbox/%5Btype%5D/route.ts"
click node_event_delivery "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/workers/events/deliver.ts"
click node_event_registry "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/workers/events/registry.ts"
click node_pdf_route "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/app/api/v1/workers/pdf/render/route.ts"
click node_pdf_job "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/workers/pdf/job.ts"
click node_integration_routes "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/observability/integration-routes.ts"
click node_integration_health "https://github.com/techaust/shakti_prime/blob/main/apps/web/src/observability/integration-health.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_user toneBlue
class node_pipeline_screen,node_pipeline_card,node_crm_action,node_pipeline_command,node_crm_query toneAmber
class node_contracts,node_command_context,node_command_runner,node_database toneMint
class node_file_routes,node_file_store,node_import_route,node_import_worker toneRose
class node_outbox_route,node_event_delivery,node_event_registry,node_pdf_route,node_pdf_job,node_integration_routes,node_integration_health toneIndigo
```

## Components

### Web experience

- [BOS web app](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/app/(bos)/layout.tsx): `apps/web/src/app/(bos)/layout.tsx`

### CRM configuration

- [Pipeline settings screen](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/components/pipelines/pipeline-settings-screen.tsx): `apps/web/src/components/pipelines/pipeline-settings-screen.tsx`
- [Pipeline editor](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/components/pipelines/pipeline-card.tsx): `apps/web/src/components/pipelines/pipeline-card.tsx`
- [CRM settings action](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/actions/crm-settings.ts): `apps/web/src/actions/crm-settings.ts`
- [Pipeline commands](https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/commands/crm/pipeline-settings.ts): `packages/domain/src/commands/crm/pipeline-settings.ts`
- [Pipeline settings query](https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/queries/crm/pipeline-settings.ts): `packages/domain/src/queries/crm/pipeline-settings.ts`

### Domain platform

- [Shared contracts](https://github.com/techaust/shakti_prime/blob/main/packages/contracts/src/crm/enums.ts): `packages/contracts/src/crm/enums.ts`
- [Command context](https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/command/context.ts): `packages/domain/src/command/context.ts`
- [Command runner](https://github.com/techaust/shakti_prime/blob/main/packages/domain/src/command/run-command.ts): `packages/domain/src/command/run-command.ts`
- [Application database](https://github.com/techaust/shakti_prime/blob/main/packages/db/src/connection.ts): `packages/db/src/connection.ts`

### Files and imports

- [File API routes](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/files/routes.ts): `apps/web/src/files/routes.ts`
- [File storage](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/files/store.ts): `apps/web/src/files/store.ts`
- [Import commit route](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/app/api/v1/workers/imports/commit/route.ts): `apps/web/src/app/api/v1/workers/imports/commit/route.ts`
- [Import processing](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/workers/imports.ts): `apps/web/src/workers/imports.ts`

### Background processing

- [Outbox worker route](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/app/api/v1/workers/outbox/%5Btype%5D/route.ts): `apps/web/src/app/api/v1/workers/outbox/[type]/route.ts`
- [Event delivery](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/workers/events/deliver.ts): `apps/web/src/workers/events/deliver.ts`
- [Event registry](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/workers/events/registry.ts): `apps/web/src/workers/events/registry.ts`
- [PDF render route](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/app/api/v1/workers/pdf/render/route.ts): `apps/web/src/app/api/v1/workers/pdf/render/route.ts`
- [PDF job](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/workers/pdf/job.ts): `apps/web/src/workers/pdf/job.ts`
- [Integration admin routes](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/observability/integration-routes.ts): `apps/web/src/observability/integration-routes.ts`
- [Integration health](https://github.com/techaust/shakti_prime/blob/main/apps/web/src/observability/integration-health.ts): `apps/web/src/observability/integration-health.ts`

### Other components

- **BOS user**

## Connections

- BOS user → BOS web app: uses
- BOS web app → Pipeline settings screen: presents
- Pipeline settings screen → Pipeline editor: renders (evidence: `apps/web/src/components/pipelines/pipeline-settings-screen.tsx`)
- Pipeline editor → CRM settings action: submits changes (evidence: `apps/web/src/components/pipelines/pipeline-card.tsx`)
- CRM settings action → Pipeline commands: executes (evidence: `apps/web/src/actions/crm-settings.ts`)
- Pipeline commands → Application database: reads and writes (evidence: `packages/domain/src/commands/crm/pipeline-settings.ts`)
- Pipeline commands → Command context: uses (evidence: `packages/domain/src/commands/crm/pipeline-settings.ts`)
- Pipeline commands → Shared contracts: uses types (evidence: `packages/domain/src/commands/crm/pipeline-settings.ts`)
- CRM settings action → Command runner: executes (evidence: `apps/web/src/actions/crm-settings.ts`)
- Pipeline settings query → Application database: reads (evidence: `packages/domain/src/queries/crm/pipeline-settings.ts`)
- Pipeline settings query → Pipeline commands: references (evidence: `packages/domain/src/queries/crm/pipeline-settings.ts`)
- File API routes → Shared contracts: validates (evidence: `apps/web/src/files/routes.ts`)
- Import commit route → Import processing: invokes (evidence: `apps/web/src/app/api/v1/workers/imports/commit/route.ts`)
- Import commit route → Shared contracts: validates (evidence: `apps/web/src/app/api/v1/workers/imports/commit/route.ts`)
- Outbox worker route → Event delivery: dispatches (evidence: `apps/web/src/app/api/v1/workers/outbox/[type]/route.ts`)
- Outbox worker route → Event registry: uses (evidence: `apps/web/src/app/api/v1/workers/outbox/[type]/route.ts`)
- Event delivery → Event registry: dispatches via (evidence: `apps/web/src/workers/events/deliver.ts`)
- PDF render route → PDF job: starts job (evidence: `apps/web/src/app/api/v1/workers/pdf/render/route.ts`)
- Integration admin routes → Integration health: reads status (evidence: `apps/web/src/observability/integration-routes.ts`)
- Integration admin routes → Command runner: executes replay (evidence: `apps/web/src/observability/integration-routes.ts`)
