# moeflow-com/moeflow architecture

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

- Interactive diagram: https://gitdiagram.com/moeflow-com/moeflow
- Repository: https://github.com/moeflow-com/moeflow

## Overview

MoeFlow is a collaborative project-hosting and manga-image translation product. Its user workflow runs from navigating the web app and managing projects/files to working with image translations; team membership and applications support collaboration. The backend exposes API resources and persists domain models, with asynchronous OCR and file-processing capabilities. The excerpts show routing, state composition, application handling, and parts of OCR/storage; many other feature links are documented only by the source index, so unverified runtime connections are omitted or dashed.

Main entry points: [`backend-v1/app/tasks/ocr.py`](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/tasks/ocr.py) (OCR processing), [`frontend-v1/src/apis/index.ts`](https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/apis/index.ts) (API client), [`backend-v1/app/factory.py`](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/factory.py) (Backend app setup), [`frontend-v1/src/App.tsx`](https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/App.tsx) (Web app routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Web app routing<br/>[App.tsx]"]
  node_frontend_api["API client<br/>[index.ts]"]
  node_client_state["Client state<br/>[index.ts]"]
end

subgraph group_workspace["Translation workspace"]
  node_project_ui["Project workflow<br/>[Project.tsx]"]
  node_image_ui["Image translation"]
  node_ai_tools["AI translation tools"]
  node_hotkeys["Hotkey settings<br/>[slice.ts]"]
end

subgraph group_collaboration["Collaboration"]
  node_team_ui["Team management<br/>[Team.tsx]"]
  node_application_api["Join applications<br/>[application.py]"]
  node_application_model["Application records<br/>[application.py]"]
end

subgraph group_backend["Backend domain"]
  node_backend_factory["Backend app setup<br/>[factory.py]"]
  node_api_routes["Backend API resources"]
  node_domain_models["Project and team models<br/>[project.py]"]
  node_file_model["File and image data<br/>[file.py]"]
  node_language_model["Languages<br/>[language.py]"]
  node_user_model["Users<br/>[user.py]"]
  node_database[("MongoDB")]
end

subgraph group_processing["Media processing"]
  node_ocr_task["OCR processing<br/>[ocr.py]"]
  node_file_storage["Object storage<br/>[oss.py]"]
  node_google_storage["Vision temp storage<br/>[google_storage.py]"]
end

node_user(("User"))
node_google_vision["Google Vision API"]

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_project_ui
node_webapp -->|"routes to"| node_image_ui
node_webapp -->|"reads state"| node_client_state
node_project_ui -.->|"requests data"| node_frontend_api
node_image_ui -.->|"requests data"| node_frontend_api
node_frontend_api -.->|"calls API"| node_api_routes
node_client_state -.->|"coordinates requests"| node_frontend_api
node_user -->|"manages teams"| node_team_ui
node_team_ui -.->|"requests data"| node_frontend_api
node_api_routes -.->|"registers"| node_application_api
node_application_api -->|"queries and updates"| node_application_model
node_application_api -->|"checks permissions"| node_domain_models
node_backend_factory -->|"registers APIs"| node_api_routes
node_backend_factory -->|"initializes models"| node_domain_models
node_backend_factory -->|"configures"| node_file_storage
node_backend_factory -->|"configures"| node_google_storage
node_application_model -->|"persists records"| node_database
node_file_model -->|"invokes processing"| node_ocr_task
node_ocr_task -->|"updates sources"| node_file_model
node_ocr_task -->|"downloads images"| node_file_storage
node_ocr_task -.->|"uploads temporary image"| node_google_storage
node_ocr_task -->|"requests recognition"| node_google_vision
node_file_model -.->|"stores file data"| node_database
node_hotkeys -.->|"stores preferences"| node_user
node_ai_tools -.->|"assists translation"| node_user

click node_webapp "https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/App.tsx"
click node_frontend_api "https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/apis/index.ts"
click node_client_state "https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/store/index.ts"
click node_project_ui "https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/pages/Project.tsx"
click node_image_ui "https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/pages/ImageTranslator.tsx"
click node_ai_tools "https://github.com/moeflow-com/moeflow/tree/main/frontend-v1/src/components/ai"
click node_hotkeys "https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/store/hotKey/slice.ts"
click node_team_ui "https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/pages/Team.tsx"
click node_application_api "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/apis/application.py"
click node_application_model "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/application.py"
click node_backend_factory "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/factory.py"
click node_api_routes "https://github.com/moeflow-com/moeflow/tree/main/backend-v1/app/apis"
click node_domain_models "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/project.py"
click node_file_model "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/file.py"
click node_language_model "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/language.py"
click node_user_model "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/user.py"
click node_ocr_task "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/tasks/ocr.py"
click node_file_storage "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/services/oss.py"
click node_google_storage "https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/services/google_storage.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_webapp,node_frontend_api,node_client_state,node_user toneBlue
class node_project_ui,node_image_ui,node_ai_tools,node_hotkeys toneAmber
class node_team_ui,node_application_api,node_application_model,node_google_vision toneMint
class node_backend_factory,node_api_routes,node_domain_models,node_file_model,node_language_model,node_user_model,node_database toneRose
class node_ocr_task,node_file_storage,node_google_storage toneIndigo
```

## Components

### Web client

- [Web app routing](https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/App.tsx): `frontend-v1/src/App.tsx`
- [API client](https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/apis/index.ts): `frontend-v1/src/apis/index.ts`
- [Client state](https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/store/index.ts): `frontend-v1/src/store/index.ts`

### Translation workspace

- [Project workflow](https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/pages/Project.tsx): `frontend-v1/src/pages/Project.tsx`
- [Image translation](https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/pages/ImageTranslator.tsx): `frontend-v1/src/pages/ImageTranslator.tsx`
- [AI translation tools](https://github.com/moeflow-com/moeflow/tree/main/frontend-v1/src/components/ai): `frontend-v1/src/components/ai`
- [Hotkey settings](https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/store/hotKey/slice.ts): `frontend-v1/src/store/hotKey/slice.ts`

### Collaboration

- [Team management](https://github.com/moeflow-com/moeflow/blob/main/frontend-v1/src/pages/Team.tsx): `frontend-v1/src/pages/Team.tsx`
- [Join applications](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/apis/application.py): `backend-v1/app/apis/application.py`
- [Application records](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/application.py): `backend-v1/app/models/application.py`

### Backend domain

- [Backend app setup](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/factory.py): `backend-v1/app/factory.py`
- [Backend API resources](https://github.com/moeflow-com/moeflow/tree/main/backend-v1/app/apis): `backend-v1/app/apis`
- [Project and team models](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/project.py): `backend-v1/app/models/project.py`
- [File and image data](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/file.py): `backend-v1/app/models/file.py`
- [Languages](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/language.py): `backend-v1/app/models/language.py`
- [Users](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/models/user.py): `backend-v1/app/models/user.py`
- **MongoDB**

### Media processing

- [OCR processing](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/tasks/ocr.py): `backend-v1/app/tasks/ocr.py`
- [Object storage](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/services/oss.py): `backend-v1/app/services/oss.py`
- [Vision temp storage](https://github.com/moeflow-com/moeflow/blob/main/backend-v1/app/services/google_storage.py): `backend-v1/app/services/google_storage.py`

### Other components

- **User**
- **Google Vision API**

## Connections

- User → Web app routing: uses (evidence: `frontend-v1/src/App.tsx`)
- Web app routing → Project workflow: routes to (evidence: `frontend-v1/src/App.tsx`)
- Web app routing → Image translation: routes to (evidence: `frontend-v1/src/App.tsx`)
- Web app routing → Client state: reads state (evidence: `frontend-v1/src/App.tsx`)
- Project workflow → API client: requests data
- Image translation → API client: requests data
- API client → Backend API resources: calls API
- Client state → API client: coordinates requests (evidence: `frontend-v1/src/apis/index.ts`)
- User → Team management: manages teams
- Team management → API client: requests data
- Backend API resources → Join applications: registers
- Join applications → Application records: queries and updates (evidence: `backend-v1/app/apis/application.py`)
- Join applications → Project and team models: checks permissions (evidence: `backend-v1/app/apis/application.py`)
- Backend app setup → Backend API resources: registers APIs (evidence: `backend-v1/app/factory.py`)
- Backend app setup → Project and team models: initializes models (evidence: `backend-v1/app/factory.py`)
- Backend app setup → Object storage: configures (evidence: `backend-v1/app/factory.py`)
- Backend app setup → Vision temp storage: configures (evidence: `backend-v1/app/factory.py`)
- Application records → MongoDB: persists records (evidence: `backend-v1/app/models/application.py`)
- File and image data → OCR processing: invokes processing (evidence: `backend-v1/app/models/file.py`)
- OCR processing → File and image data: updates sources (evidence: `backend-v1/app/tasks/ocr.py`)
- OCR processing → Object storage: downloads images (evidence: `backend-v1/app/tasks/ocr.py`)
- OCR processing → Vision temp storage: uploads temporary image
- OCR processing → Google Vision API: requests recognition (evidence: `backend-v1/app/tasks/ocr.py`)
- File and image data → MongoDB: stores file data
- Hotkey settings → User: stores preferences
- AI translation tools → User: assists translation
