# shreyxugsot/medusa architecture

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

- Interactive diagram: https://gitdiagram.com/shreyxugsot/medusa
- Repository: https://github.com/shreyxugsot/medusa

## Overview

Medusa is a modular commerce platform and customization framework. A typical operator uses the Admin dashboard to manage a commerce application; the README describes broad commerce building blocks, but the supplied source excerpts do not show the API or most commerce-module wiring, so those links are not expanded. The graph preserves the visible fulfillment, workflow persistence/scheduling, indexing, authentication, and Admin-extension capabilities. Workflow storage behavior is sampled; broader subsystem relationships are included only where the tree or README supports the capability, not as asserted call chains.

Main entry points: [`packages/admin/dashboard/src/app.tsx`](https://github.com/shreyxugsot/medusa/blob/develop/packages/admin/dashboard/src/app.tsx) (Admin dashboard), [`packages/modules/workflow-engine-inmemory/src/utils/workflow-orchestrator-storage.ts`](https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-inmemory/src/utils/workflow-orchestrator-storage.ts) (In-memory workflow storage), [`packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts`](https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts) (Redis workflow storage), [`packages/core/orchestration/src/transaction/datastore/abstract-storage.ts`](https://github.com/shreyxugsot/medusa/blob/develop/packages/core/orchestration/src/transaction/datastore/abstract-storage.ts) (Workflow storage contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin experience"]
  node_dashboard["Admin dashboard<br/>[app.tsx]"]
  node_admin_extensions["Admin extensions"]
  node_admin_plugin["Admin Vite plugin<br/>[index.ts]"]
  node_backend_url["Backend query config<br/>[query-client.ts]"]
end

subgraph group_commerce["Commerce building blocks"]
  node_commerce_framework["Commerce framework"]
  node_fulfillment["Fulfillment service"]
  node_commerce_modules["Commerce modules"]
end

subgraph group_workflow["Workflow execution"]
  node_workflow_contract["Workflow storage contract"]
  node_memory_storage["In-memory workflow storage"]
  node_redis_storage["Redis workflow storage"]
  node_workflow_execution["Workflow execution service"]
  node_execution_store[("Execution records")]
end

subgraph group_identity["Identity and indexing"]
  node_oidc_engine["OIDC engine<br/>[engine.ts]"]
  node_indexing["Index storage interface"]
  node_index_flag["Index feature flag<br/>[index-engine.ts]"]
end

node_operator(("Commerce operator"))
node_identity_provider(("OIDC identity provider"))

node_operator -->|"uses"| node_dashboard
node_dashboard -->|"configures backend"| node_backend_url
node_dashboard -->|"supports extensions"| node_admin_extensions
node_admin_plugin -->|"generates modules"| node_admin_extensions
node_commerce_framework -->|"provides framework"| node_commerce_modules
node_commerce_modules -->|"includes capability"| node_fulfillment
node_workflow_contract -->|"implemented by"| node_memory_storage
node_workflow_contract -->|"implemented by"| node_redis_storage
node_redis_storage -->|"runs workflows"| node_workflow_execution
node_redis_storage -->|"reads and writes"| node_execution_store
node_memory_storage -->|"runs workflows"| node_workflow_execution
node_memory_storage -->|"reads and writes"| node_execution_store
node_oidc_engine -->|"discovers and exchanges"| node_identity_provider
node_indexing -.->|"capability gated"| node_index_flag

click node_dashboard "https://github.com/shreyxugsot/medusa/blob/develop/packages/admin/dashboard/src/app.tsx"
click node_admin_extensions "https://github.com/shreyxugsot/medusa/tree/develop/packages/admin/admin-shared/src/extensions"
click node_admin_plugin "https://github.com/shreyxugsot/medusa/blob/develop/packages/admin/admin-vite-plugin/src/index.ts"
click node_backend_url "https://github.com/shreyxugsot/medusa/blob/develop/packages/admin/dashboard/src/lib/query-client.ts"
click node_commerce_framework "https://github.com/shreyxugsot/medusa/tree/develop/packages/core/framework"
click node_fulfillment "https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/fulfillment/src/services/fulfillment-module-service.ts"
click node_commerce_modules "https://github.com/shreyxugsot/medusa/tree/develop/packages/modules"
click node_workflow_contract "https://github.com/shreyxugsot/medusa/blob/develop/packages/core/orchestration/src/transaction/datastore/abstract-storage.ts"
click node_memory_storage "https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-inmemory/src/utils/workflow-orchestrator-storage.ts"
click node_redis_storage "https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts"
click node_workflow_execution "https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts"
click node_execution_store "https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts"
click node_oidc_engine "https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/providers/auth-oidc/src/engine/engine.ts"
click node_indexing "https://github.com/shreyxugsot/medusa/blob/develop/packages/core/types/src/index-data/storage-provider.ts"
click node_index_flag "https://github.com/shreyxugsot/medusa/blob/develop/packages/medusa/src/feature-flags/index-engine.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_dashboard,node_admin_extensions,node_admin_plugin,node_backend_url toneBlue
class node_commerce_framework,node_fulfillment,node_commerce_modules toneAmber
class node_workflow_contract,node_memory_storage,node_redis_storage,node_workflow_execution,node_execution_store toneMint
class node_oidc_engine,node_indexing,node_index_flag toneRose
class node_operator,node_identity_provider toneIndigo
```

## Components

### Admin experience

- [Admin dashboard](https://github.com/shreyxugsot/medusa/blob/develop/packages/admin/dashboard/src/app.tsx): `packages/admin/dashboard/src/app.tsx`
- [Admin extensions](https://github.com/shreyxugsot/medusa/tree/develop/packages/admin/admin-shared/src/extensions): `packages/admin/admin-shared/src/extensions`
- [Admin Vite plugin](https://github.com/shreyxugsot/medusa/blob/develop/packages/admin/admin-vite-plugin/src/index.ts): `packages/admin/admin-vite-plugin/src/index.ts`
- [Backend query config](https://github.com/shreyxugsot/medusa/blob/develop/packages/admin/dashboard/src/lib/query-client.ts): `packages/admin/dashboard/src/lib/query-client.ts`

### Commerce building blocks

- [Commerce framework](https://github.com/shreyxugsot/medusa/tree/develop/packages/core/framework): `packages/core/framework`
- [Fulfillment service](https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/fulfillment/src/services/fulfillment-module-service.ts): `packages/modules/fulfillment/src/services/fulfillment-module-service.ts`
- [Commerce modules](https://github.com/shreyxugsot/medusa/tree/develop/packages/modules): `packages/modules`

### Workflow execution

- [Workflow storage contract](https://github.com/shreyxugsot/medusa/blob/develop/packages/core/orchestration/src/transaction/datastore/abstract-storage.ts): `packages/core/orchestration/src/transaction/datastore/abstract-storage.ts`
- [In-memory workflow storage](https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-inmemory/src/utils/workflow-orchestrator-storage.ts): `packages/modules/workflow-engine-inmemory/src/utils/workflow-orchestrator-storage.ts`
- [Redis workflow storage](https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts): `packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts`
- [Workflow execution service](https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts): `packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts`
- [Execution records](https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts): `packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts`

### Identity and indexing

- [OIDC engine](https://github.com/shreyxugsot/medusa/blob/develop/packages/modules/providers/auth-oidc/src/engine/engine.ts): `packages/modules/providers/auth-oidc/src/engine/engine.ts`
- [Index storage interface](https://github.com/shreyxugsot/medusa/blob/develop/packages/core/types/src/index-data/storage-provider.ts): `packages/core/types/src/index-data/storage-provider.ts`
- [Index feature flag](https://github.com/shreyxugsot/medusa/blob/develop/packages/medusa/src/feature-flags/index-engine.ts): `packages/medusa/src/feature-flags/index-engine.ts`

### Other components

- **Commerce operator**
- **OIDC identity provider**

## Connections

- Commerce operator → Admin dashboard: uses
- Admin dashboard → Backend query config: configures backend
- Admin dashboard → Admin extensions: supports extensions
- Admin Vite plugin → Admin extensions: generates modules
- Commerce framework → Commerce modules: provides framework
- Commerce modules → Fulfillment service: includes capability
- Workflow storage contract → In-memory workflow storage: implemented by
- Workflow storage contract → Redis workflow storage: implemented by
- Redis workflow storage → Workflow execution service: runs workflows
- Redis workflow storage → Execution records: reads and writes
- In-memory workflow storage → Workflow execution service: runs workflows
- In-memory workflow storage → Execution records: reads and writes
- OIDC engine → OIDC identity provider: discovers and exchanges
- Index storage interface → Index feature flag: capability gated
