# varsha1770/consumar-studio-full architecture

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

- Interactive diagram: https://gitdiagram.com/varsha1770/consumar-studio-full
- Repository: https://github.com/varsha1770/consumar-studio-full

## Overview

ConsumAR Studio is a web-based 3D asset workspace. A user uploads images or models, the Next.js API enforces authentication and usage limits, delegates generation, resizing, or USDZ conversion to processing services, stores assets in S3, and records history in PostgreSQL. The resulting GLB/USDZ assets are previewed, downloaded, shared through AR links, or presented in browser-based MindAR. The tree and sampled routes support this flow; no README content or unsampled implementation details were available.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_studio["Studio Experience"]
  node_studio_ui["Studio Interface<br/>[page.tsx]"]
  node_model_preview["Model Preview<br/>[ModelPreview3D.tsx]"]
end

subgraph group_api["API Orchestration"]
  node_generate_api["3D Generation API<br/>[route.ts]"]
  node_upload_api["Upload URL API<br/>[route.ts]"]
  node_resize_api["Resize API<br/>[route.ts]"]
  node_usdz_api["USDZ Conversion API<br/>[route.ts]"]
  node_limits_api["Usage Limits API<br/>[route.ts]"]
  node_auth_api["Authentication API<br/>[route.ts]"]
end

subgraph group_processing["3D Processing"]
  node_generation_backend["Generation Backend<br/>[server.py]"]
  node_resize_backend["Resize Backend<br/>[server.py]"]
  node_conversion_backend["USDZ Backend<br/>[server.py]"]
end

subgraph group_storage["Persistence Services"]
  node_postgres[("PostgreSQL Database<br/>[prisma.ts]")]
  node_s3[("Amazon S3 Storage<br/>[s3-delete.ts]")]
end

subgraph group_aradmin["AR Administration"]
  node_mind_compile["Mind Target Compiler<br/>[route.ts]"]
  node_ar_runtime["Browser AR Runtime<br/>[route.ts]"]
  node_ar_links["AR Link Service<br/>[route.ts]"]
  node_model_proxy["Model Proxy<br/>[route.ts]"]
  node_admin_console["Admin Console<br/>[page.tsx]"]
end

node_user(("Studio User"))
node_presign_service["Presigned URL Service"]
node_ec2_service["EC2 Processing Service"]

node_user -->|"uses"| node_studio_ui
node_studio_ui -->|"authenticates"| node_auth_api
node_studio_ui -->|"requests upload"| node_upload_api
node_studio_ui -->|"submits images"| node_generate_api
node_studio_ui -->|"resizes model"| node_resize_api
node_studio_ui -->|"converts model"| node_usdz_api
node_generate_api -->|"checks limits"| node_postgres
node_generate_api -->|"forwards generation"| node_ec2_service
node_ec2_service -->|"runs generation"| node_generation_backend
node_generate_api -->|"records history"| node_postgres
node_upload_api -->|"checks quotas"| node_postgres
node_upload_api -->|"requests URL"| node_presign_service
node_presign_service -->|"issues upload URL"| node_s3
node_resize_api -->|"tries local resize"| node_resize_backend
node_resize_api -.->|"falls back"| node_presign_service
node_resize_backend -->|"stores model"| node_s3
node_resize_api -->|"updates usage"| node_postgres
node_usdz_api -->|"checks usage"| node_postgres
node_usdz_api -->|"forwards conversion"| node_ec2_service
node_ec2_service -->|"converts GLB"| node_conversion_backend
node_conversion_backend -->|"reads and writes"| node_s3
node_usdz_api -->|"records conversion"| node_postgres
node_limits_api -->|"reads quotas"| node_postgres
node_model_preview -->|"loads assets"| node_model_proxy
node_model_proxy -->|"fetches assets"| node_s3
node_mind_compile -.->|"uploads target"| node_s3
node_ar_links -.->|"requests conversion"| node_usdz_api
node_user -->|"opens AR"| node_ar_runtime
node_ar_runtime -->|"loads AR assets"| node_s3
node_user -.->|"manages service"| node_admin_console
node_admin_console -->|"reads administration data"| node_postgres

click node_studio_ui "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/studio/page.tsx"
click node_model_preview "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/components/ModelPreview3D.tsx"
click node_generate_api "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/generate-3d/route.ts"
click node_upload_api "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/presigned-url/route.ts"
click node_resize_api "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/resize/route.ts"
click node_usdz_api "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/convert-usdz/route.ts"
click node_limits_api "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/user/limits/route.ts"
click node_auth_api "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/auth/%5B...nextauth%5D/route.ts"
click node_generation_backend "https://github.com/varsha1770/consumar-studio-full/blob/main/3dstudio-backend-main/server.py"
click node_resize_backend "https://github.com/varsha1770/consumar-studio-full/blob/main/3dstudio-backend-main/server.py"
click node_conversion_backend "https://github.com/varsha1770/consumar-studio-full/blob/main/3dstudio-backend-main/server.py"
click node_mind_compile "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/compile-mind/route.ts"
click node_ar_runtime "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/ar/route.ts"
click node_ar_links "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/ar-link/route.ts"
click node_model_proxy "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/proxy-model/%5B%5B...path%5D%5D/route.ts"
click node_admin_console "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/admin/dashboard/page.tsx"
click node_postgres "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/lib/prisma.ts"
click node_s3 "https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/lib/s3-delete.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_studio_ui,node_model_preview,node_user toneBlue
class node_generate_api,node_upload_api,node_resize_api,node_usdz_api,node_limits_api,node_auth_api toneAmber
class node_generation_backend,node_resize_backend,node_conversion_backend toneMint
class node_postgres,node_s3 toneRose
class node_mind_compile,node_ar_runtime,node_ar_links,node_model_proxy,node_admin_console,node_presign_service,node_ec2_service toneIndigo
```

## Components

### Studio Experience

- [Studio Interface](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/studio/page.tsx): `ConsumAR-Studio-Frontend-main/app/studio/page.tsx`
- [Model Preview](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/components/ModelPreview3D.tsx): `ConsumAR-Studio-Frontend-main/components/ModelPreview3D.tsx`

### API Orchestration

- [3D Generation API](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/generate-3d/route.ts): `ConsumAR-Studio-Frontend-main/app/api/generate-3d/route.ts`
- [Upload URL API](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/presigned-url/route.ts): `ConsumAR-Studio-Frontend-main/app/api/presigned-url/route.ts`
- [Resize API](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/resize/route.ts): `ConsumAR-Studio-Frontend-main/app/api/resize/route.ts`
- [USDZ Conversion API](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/convert-usdz/route.ts): `ConsumAR-Studio-Frontend-main/app/api/convert-usdz/route.ts`
- [Usage Limits API](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/user/limits/route.ts): `ConsumAR-Studio-Frontend-main/app/api/user/limits/route.ts`
- [Authentication API](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/auth/%5B...nextauth%5D/route.ts): `ConsumAR-Studio-Frontend-main/app/api/auth/[...nextauth]/route.ts`

### 3D Processing

- [Generation Backend](https://github.com/varsha1770/consumar-studio-full/blob/main/3dstudio-backend-main/server.py): `3dstudio-backend-main/server.py`
- [Resize Backend](https://github.com/varsha1770/consumar-studio-full/blob/main/3dstudio-backend-main/server.py): `3dstudio-backend-main/server.py`
- [USDZ Backend](https://github.com/varsha1770/consumar-studio-full/blob/main/3dstudio-backend-main/server.py): `3dstudio-backend-main/server.py`

### Persistence Services

- [PostgreSQL Database](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/lib/prisma.ts): `ConsumAR-Studio-Frontend-main/lib/prisma.ts`
- [Amazon S3 Storage](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/lib/s3-delete.ts): `ConsumAR-Studio-Frontend-main/lib/s3-delete.ts`

### AR Administration

- [Mind Target Compiler](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/compile-mind/route.ts): `ConsumAR-Studio-Frontend-main/app/api/compile-mind/route.ts`
- [Browser AR Runtime](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/ar/route.ts): `ConsumAR-Studio-Frontend-main/app/ar/route.ts`
- [AR Link Service](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/ar-link/route.ts): `ConsumAR-Studio-Frontend-main/app/api/ar-link/route.ts`
- [Model Proxy](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/api/proxy-model/%5B%5B...path%5D%5D/route.ts): `ConsumAR-Studio-Frontend-main/app/api/proxy-model/[[...path]]/route.ts`
- [Admin Console](https://github.com/varsha1770/consumar-studio-full/blob/main/ConsumAR-Studio-Frontend-main/app/admin/dashboard/page.tsx): `ConsumAR-Studio-Frontend-main/app/admin/dashboard/page.tsx`

### Other components

- **Studio User**
- **Presigned URL Service**
- **EC2 Processing Service**

## Connections

- Studio User → Studio Interface: uses
- Studio Interface → Authentication API: authenticates
- Studio Interface → Upload URL API: requests upload
- Studio Interface → 3D Generation API: submits images
- Studio Interface → Resize API: resizes model
- Studio Interface → USDZ Conversion API: converts model
- 3D Generation API → PostgreSQL Database: checks limits
- 3D Generation API → EC2 Processing Service: forwards generation
- EC2 Processing Service → Generation Backend: runs generation
- 3D Generation API → PostgreSQL Database: records history
- Upload URL API → PostgreSQL Database: checks quotas
- Upload URL API → Presigned URL Service: requests URL
- Presigned URL Service → Amazon S3 Storage: issues upload URL
- Resize API → Resize Backend: tries local resize
- Resize API → Presigned URL Service: falls back
- Resize Backend → Amazon S3 Storage: stores model
- Resize API → PostgreSQL Database: updates usage
- USDZ Conversion API → PostgreSQL Database: checks usage
- USDZ Conversion API → EC2 Processing Service: forwards conversion
- EC2 Processing Service → USDZ Backend: converts GLB
- USDZ Backend → Amazon S3 Storage: reads and writes
- USDZ Conversion API → PostgreSQL Database: records conversion
- Usage Limits API → PostgreSQL Database: reads quotas
- Model Preview → Model Proxy: loads assets
- Model Proxy → Amazon S3 Storage: fetches assets
- Mind Target Compiler → Amazon S3 Storage: uploads target
- AR Link Service → USDZ Conversion API: requests conversion
- Studio User → Browser AR Runtime: opens AR
- Browser AR Runtime → Amazon S3 Storage: loads AR assets
- Studio User → Admin Console: manages service
- Admin Console → PostgreSQL Database: reads administration data
