# picturas-um/picturas-27 architecture

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

- Interactive diagram: https://gitdiagram.com/picturas-um/picturas-27
- Repository: https://github.com/picturas-um/picturas-27

## Overview

PictuRAS is a browser-based image editor combining project-based editing, traditional image operations, AI tools, sharing, accounts, and paid plans. A user works in the frontend, which reaches backend services through the API gateway; project processing uses asynchronous tool workers and image storage, with results returned to the project. The README documents progress updates through a separate RabbitMQ-to-WebSocket path. The graph preserves the main editing, account, storage, and live-progress branches. Some service links are documented rather than verified in sampled code; unsampled implementation details are not inferred.

Main entry points: [`projects/routes/projects.js`](https://github.com/picturas-um/picturas-27/blob/main/projects/routes/projects.js) (Project management), [`apiGateway/app.js`](https://github.com/picturas-um/picturas-27/blob/main/apiGateway/app.js) (API gateway), [`Tools`](https://github.com/picturas-um/picturas-27/tree/main/Tools) (Image tool workers), [`frontend/app/dashboard/[pid]/page.tsx`](https://github.com/picturas-um/picturas-27/blob/main/frontend/app/dashboard/%5Bpid%5D/page.tsx) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_frontend["Web application<br/>[page.tsx]"]
end

subgraph group_backend["Backend services"]
  node_gateway["API gateway<br/>[app.js]"]
  node_identity["Accounts and presets<br/>[users.js]"]
  node_membership["Plans and billing<br/>[subscriptions.js]"]
  node_websocket["WebSocket gateway<br/>[index.js]"]
  node_userdb[("User database<br/>[user.js]")]
  node_subscriptiondb[("Subscription database<br/>[subscription.js]")]
end

subgraph group_editing["Editing workflow"]
  node_projects["Project management<br/>[projects.js]"]
  node_orchestration["Tool orchestration<br/>[process.js]"]
  node_projectdata[("Project state<br/>[project.js]")]
  node_preview[("Preview cache<br/>[previewCache.js]")]
  node_toolworkers["Image tool workers"]
  node_generative["Generative API mock<br/>[server.py]"]
end

subgraph group_infrastructure["Messaging and storage"]
  node_storageapi["Image storage API<br/>[server.js]"]
  node_objectstore[("SeaweedFS storage")]
  node_queue["RabbitMQ"]
end

node_user(("Editor"))

node_user -->|"edits images"| node_frontend
node_frontend -->|"sends API requests"| node_gateway
node_gateway -->|"routes account requests"| node_identity
node_gateway -->|"routes project requests"| node_projects
node_gateway -->|"routes plan requests"| node_membership
node_identity -->|"persists accounts"| node_userdb
node_membership -->|"persists plans"| node_subscriptiondb
node_projects -->|"reads and updates"| node_projectdata
node_projects -->|"delegates processing"| node_orchestration
node_orchestration -->|"dispatches tool jobs"| node_queue
node_queue -->|"delivers jobs"| node_toolworkers
node_toolworkers -->|"publishes results"| node_queue
node_projects -->|"requests image operations"| node_storageapi
node_storageapi -->|"stores image objects"| node_objectstore
node_projects -->|"caches previews"| node_preview
node_queue -->|"feeds progress events"| node_websocket
node_websocket -->|"pushes progress updates"| node_frontend
node_toolworkers -.->|"uses for expansion"| node_generative

click node_frontend "https://github.com/picturas-um/picturas-27/blob/main/frontend/app/dashboard/%5Bpid%5D/page.tsx"
click node_gateway "https://github.com/picturas-um/picturas-27/blob/main/apiGateway/app.js"
click node_identity "https://github.com/picturas-um/picturas-27/blob/main/users/routes/users.js"
click node_membership "https://github.com/picturas-um/picturas-27/blob/main/subscriptions/routes/subscriptions.js"
click node_projects "https://github.com/picturas-um/picturas-27/blob/main/projects/routes/projects.js"
click node_orchestration "https://github.com/picturas-um/picturas-27/blob/main/projects/controllers/process.js"
click node_projectdata "https://github.com/picturas-um/picturas-27/blob/main/projects/models/project.js"
click node_preview "https://github.com/picturas-um/picturas-27/blob/main/projects/models/previewCache.js"
click node_toolworkers "https://github.com/picturas-um/picturas-27/tree/main/Tools"
click node_storageapi "https://github.com/picturas-um/picturas-27/blob/main/imageStorageService/server.js"
click node_websocket "https://github.com/picturas-um/picturas-27/blob/main/wsGateway/index.js"
click node_userdb "https://github.com/picturas-um/picturas-27/blob/main/users/models/user.js"
click node_subscriptiondb "https://github.com/picturas-um/picturas-27/blob/main/subscriptions/models/subscription.js"
click node_generative "https://github.com/picturas-um/picturas-27/blob/main/generative-mock/server.py"

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_frontend toneBlue
class node_gateway,node_identity,node_membership,node_websocket,node_userdb,node_subscriptiondb toneAmber
class node_projects,node_orchestration,node_projectdata,node_preview,node_toolworkers,node_generative toneMint
class node_storageapi,node_objectstore,node_queue toneRose
class node_user toneIndigo
```

## Components

### Client experience

- [Web application](https://github.com/picturas-um/picturas-27/blob/main/frontend/app/dashboard/%5Bpid%5D/page.tsx): `frontend/app/dashboard/[pid]/page.tsx`

### Backend services

- [API gateway](https://github.com/picturas-um/picturas-27/blob/main/apiGateway/app.js): `apiGateway/app.js`
- [Accounts and presets](https://github.com/picturas-um/picturas-27/blob/main/users/routes/users.js): `users/routes/users.js`
- [Plans and billing](https://github.com/picturas-um/picturas-27/blob/main/subscriptions/routes/subscriptions.js): `subscriptions/routes/subscriptions.js`
- [WebSocket gateway](https://github.com/picturas-um/picturas-27/blob/main/wsGateway/index.js): `wsGateway/index.js`
- [User database](https://github.com/picturas-um/picturas-27/blob/main/users/models/user.js): `users/models/user.js`
- [Subscription database](https://github.com/picturas-um/picturas-27/blob/main/subscriptions/models/subscription.js): `subscriptions/models/subscription.js`

### Editing workflow

- [Project management](https://github.com/picturas-um/picturas-27/blob/main/projects/routes/projects.js): `projects/routes/projects.js`
- [Tool orchestration](https://github.com/picturas-um/picturas-27/blob/main/projects/controllers/process.js): `projects/controllers/process.js`
- [Project state](https://github.com/picturas-um/picturas-27/blob/main/projects/models/project.js): `projects/models/project.js`
- [Preview cache](https://github.com/picturas-um/picturas-27/blob/main/projects/models/previewCache.js): `projects/models/previewCache.js`
- [Image tool workers](https://github.com/picturas-um/picturas-27/tree/main/Tools): `Tools`
- [Generative API mock](https://github.com/picturas-um/picturas-27/blob/main/generative-mock/server.py): `generative-mock/server.py`

### Messaging and storage

- [Image storage API](https://github.com/picturas-um/picturas-27/blob/main/imageStorageService/server.js): `imageStorageService/server.js`
- **SeaweedFS storage**
- **RabbitMQ**

### Other components

- **Editor**

## Connections

- Editor → Web application: edits images (evidence: `README.md`)
- Web application → API gateway: sends API requests (evidence: `README.md`)
- API gateway → Accounts and presets: routes account requests (evidence: `apiGateway/app.js`)
- API gateway → Project management: routes project requests (evidence: `apiGateway/app.js`)
- API gateway → Plans and billing: routes plan requests (evidence: `apiGateway/app.js`)
- Accounts and presets → User database: persists accounts (evidence: `README.md`)
- Plans and billing → Subscription database: persists plans (evidence: `README.md`)
- Project management → Project state: reads and updates (evidence: `projects/routes/projects.js`)
- Project management → Tool orchestration: delegates processing (evidence: `projects/routes/projects.js`)
- Tool orchestration → RabbitMQ: dispatches tool jobs (evidence: `README.md`)
- RabbitMQ → Image tool workers: delivers jobs (evidence: `README.md`)
- Image tool workers → RabbitMQ: publishes results (evidence: `README.md`)
- Project management → Image storage API: requests image operations
- Image storage API → SeaweedFS storage: stores image objects (evidence: `README.md`)
- Project management → Preview cache: caches previews
- RabbitMQ → WebSocket gateway: feeds progress events (evidence: `README.md`)
- WebSocket gateway → Web application: pushes progress updates (evidence: `README.md`)
- Image tool workers → Generative API mock: uses for expansion (evidence: `README.md`)
