# neptunedev77/picturas-video-casos-de-uso architecture

> Architecture diagram of the GitHub repository neptunedev77/picturas-video-casos-de-uso, 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/neptunedev77/picturas-video-casos-de-uso
- Repository: https://github.com/neptunedev77/picturas-video-casos-de-uso

## Overview

PictuRAS is a web image-editing platform with account and subscription services, project-based editing, asynchronous tool processing, and real-time progress. The main workflow is browser editing through the frontend and API gateway, project orchestration, queued image/video processing, and returned results. The README documents the broad service topology; sampled code confirms gateway routing, service startup, and worker behavior. Some project-service and frontend internals were not sampled, so their links rely on README statements rather than inferred module calls.

Main entry points: [`projeto/apiGateway/app.js`](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/apiGateway/app.js) (API gateway), [`projeto/projects/routes/projects.js`](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/projects/routes/projects.js) (Project orchestration), [`projeto/frontend/app/dashboard/[pid]/page.tsx`](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/frontend/app/dashboard/%5Bpid%5D/page.tsx) (Editing interface), [`projeto/subscriptions/routes/subscriptions.js`](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/subscriptions/routes/subscriptions.js) (Plans and billing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_frontend["Editing interface<br/>[page.tsx]"]
  node_account_ui["Account and billing<br/>[page.tsx]"]
end

subgraph group_platform["Platform services"]
  node_gateway["API gateway<br/>[app.js]"]
  node_jwt["JWT checks<br/>[auth.js]"]
  node_projects["Project orchestration<br/>[projects.js]"]
  node_video_routes["Video job routes<br/>[silence.js]"]
  node_compression_routes["Compression routes<br/>[compression.js]"]
  node_users["User and presets<br/>[users.js]"]
  node_subscriptions["Plans and billing<br/>[subscriptions.js]"]
  node_storage_service["Image storage API<br/>[server.js]"]
  node_ws["Progress gateway<br/>[index.js]"]
end

subgraph group_processing["Media processing"]
  node_basic_tools["Image editing tools"]
  node_ai_tools["AI image tools"]
  node_silence_worker["Silence removal<br/>[worker.py]"]
  node_compression_worker["Video compression<br/>[worker.py]"]
end

subgraph group_infrastructure["Shared infrastructure"]
  node_rabbit["RabbitMQ"]
  node_image_store[("Encrypted object storage")]
  node_user_db[("User database<br/>[app.js]")]
  node_project_db[("Project database<br/>[app.js]")]
  node_subscription_db[("Subscription database<br/>[app.js]")]
end

node_user(("Editor"))

node_user -->|"edits projects"| node_frontend
node_frontend -->|"calls REST API"| node_gateway
node_gateway -->|"checks tokens"| node_jwt
node_gateway -->|"routes project requests"| node_projects
node_gateway -->|"routes user requests"| node_users
node_gateway -->|"routes billing requests"| node_subscriptions
node_frontend -.->|"uploads images"| node_storage_service
node_storage_service -->|"stores objects"| node_image_store
node_projects -->|"persists projects"| node_project_db
node_users -->|"persists accounts"| node_user_db
node_subscriptions -->|"persists billing"| node_subscription_db
node_projects -->|"dispatches tool jobs"| node_rabbit
node_video_routes -->|"queues video jobs"| node_rabbit
node_compression_routes -->|"queues compression jobs"| node_rabbit
node_rabbit -->|"dispatches image jobs"| node_basic_tools
node_rabbit -->|"dispatches AI jobs"| node_ai_tools
node_rabbit -->|"delivers jobs"| node_silence_worker
node_rabbit -->|"delivers jobs"| node_compression_worker
node_basic_tools -->|"publishes results"| node_rabbit
node_ai_tools -->|"publishes results"| node_rabbit
node_silence_worker -->|"publishes progress and results"| node_rabbit
node_compression_worker -->|"publishes progress and results"| node_rabbit
node_rabbit -->|"returns job results"| node_projects
node_rabbit -->|"delivers progress events"| node_ws
node_ws -->|"pushes live updates"| node_user
node_subscriptions -.->|"provides plan limits"| node_projects
node_account_ui -->|"manages account"| node_gateway

click node_frontend "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/frontend/app/dashboard/%5Bpid%5D/page.tsx"
click node_account_ui "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/frontend/app/dashboard/account/page.tsx"
click node_gateway "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/apiGateway/app.js"
click node_jwt "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/apiGateway/auth/auth.js"
click node_projects "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/projects/routes/projects.js"
click node_video_routes "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/projects/routes/silence.js"
click node_compression_routes "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/projects/routes/compression.js"
click node_users "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/users/routes/users.js"
click node_subscriptions "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/subscriptions/routes/subscriptions.js"
click node_storage_service "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/imageStorageService/server.js"
click node_ws "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/wsGateway/index.js"
click node_basic_tools "https://github.com/neptunedev77/picturas-video-casos-de-uso/tree/main/projeto/Tools"
click node_ai_tools "https://github.com/neptunedev77/picturas-video-casos-de-uso/tree/main/projeto/Tools"
click node_silence_worker "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/Tools/silence_removal/worker.py"
click node_compression_worker "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/Tools/video_compression/worker.py"
click node_user_db "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/users/app.js"
click node_project_db "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/projects/app.js"
click node_subscription_db "https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/subscriptions/app.js"

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,node_account_ui toneBlue
class node_gateway,node_jwt,node_projects,node_video_routes,node_compression_routes,node_users,node_subscriptions,node_storage_service,node_ws toneAmber
class node_basic_tools,node_ai_tools,node_silence_worker,node_compression_worker toneMint
class node_rabbit,node_image_store,node_user_db,node_project_db,node_subscription_db toneRose
class node_user toneIndigo
```

## Components

### Web client

- [Editing interface](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/frontend/app/dashboard/%5Bpid%5D/page.tsx): `projeto/frontend/app/dashboard/[pid]/page.tsx`
- [Account and billing](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/frontend/app/dashboard/account/page.tsx): `projeto/frontend/app/dashboard/account/page.tsx`

### Platform services

- [API gateway](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/apiGateway/app.js): `projeto/apiGateway/app.js`
- [JWT checks](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/apiGateway/auth/auth.js): `projeto/apiGateway/auth/auth.js`
- [Project orchestration](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/projects/routes/projects.js): `projeto/projects/routes/projects.js`
- [Video job routes](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/projects/routes/silence.js): `projeto/projects/routes/silence.js`
- [Compression routes](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/projects/routes/compression.js): `projeto/projects/routes/compression.js`
- [User and presets](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/users/routes/users.js): `projeto/users/routes/users.js`
- [Plans and billing](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/subscriptions/routes/subscriptions.js): `projeto/subscriptions/routes/subscriptions.js`
- [Image storage API](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/imageStorageService/server.js): `projeto/imageStorageService/server.js`
- [Progress gateway](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/wsGateway/index.js): `projeto/wsGateway/index.js`

### Media processing

- [Image editing tools](https://github.com/neptunedev77/picturas-video-casos-de-uso/tree/main/projeto/Tools): `projeto/Tools`
- [AI image tools](https://github.com/neptunedev77/picturas-video-casos-de-uso/tree/main/projeto/Tools): `projeto/Tools`
- [Silence removal](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/Tools/silence_removal/worker.py): `projeto/Tools/silence_removal/worker.py`
- [Video compression](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/Tools/video_compression/worker.py): `projeto/Tools/video_compression/worker.py`

### Shared infrastructure

- **RabbitMQ**
- **Encrypted object storage**
- [User database](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/users/app.js): `projeto/users/app.js`
- [Project database](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/projects/app.js): `projeto/projects/app.js`
- [Subscription database](https://github.com/neptunedev77/picturas-video-casos-de-uso/blob/main/projeto/subscriptions/app.js): `projeto/subscriptions/app.js`

### Other components

- **Editor**

## Connections

- Editor → Editing interface: edits projects
- Editing interface → API gateway: calls REST API
- API gateway → JWT checks: checks tokens
- API gateway → Project orchestration: routes project requests (evidence: `projeto/apiGateway/app.js`)
- API gateway → User and presets: routes user requests (evidence: `projeto/apiGateway/app.js`)
- API gateway → Plans and billing: routes billing requests (evidence: `projeto/apiGateway/app.js`)
- Editing interface → Image storage API: uploads images
- Image storage API → Encrypted object storage: stores objects
- Project orchestration → Project database: persists projects (evidence: `projeto/projects/app.js`)
- User and presets → User database: persists accounts (evidence: `projeto/users/app.js`)
- Plans and billing → Subscription database: persists billing (evidence: `projeto/subscriptions/app.js`)
- Project orchestration → RabbitMQ: dispatches tool jobs
- Video job routes → RabbitMQ: queues video jobs
- Compression routes → RabbitMQ: queues compression jobs
- RabbitMQ → Image editing tools: dispatches image jobs
- RabbitMQ → AI image tools: dispatches AI jobs
- RabbitMQ → Silence removal: delivers jobs (evidence: `projeto/Tools/silence_removal/worker.py`)
- RabbitMQ → Video compression: delivers jobs (evidence: `projeto/Tools/video_compression/worker.py`)
- Image editing tools → RabbitMQ: publishes results
- AI image tools → RabbitMQ: publishes results
- Silence removal → RabbitMQ: publishes progress and results (evidence: `projeto/Tools/silence_removal/worker.py`)
- Video compression → RabbitMQ: publishes progress and results (evidence: `projeto/Tools/video_compression/worker.py`)
- RabbitMQ → Project orchestration: returns job results
- RabbitMQ → Progress gateway: delivers progress events
- Progress gateway → Editor: pushes live updates
- Plans and billing → Project orchestration: provides plan limits
- Account and billing → API gateway: manages account
