# rajathraj12/action-flow architecture

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

- Interactive diagram: https://gitdiagram.com/rajathraj12/action-flow
- Repository: https://github.com/rajathraj12/action-flow

## Overview

ActionFlow is a team collaboration product spanning workspace, chat, task, search, and notification capabilities, with web and Android clients backed by an Express/Socket.IO service. The main user flow is client interaction through authenticated API routes to workspace or messaging operations and persistent records; message content can also feed AI task detection and task review. The tree and excerpts support these major areas, but do not show the web app’s runtime API wiring or how the backend connects to the separate AI-Service, so those links are omitted.

Main entry points: [`Backend/src/server.ts`](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/server.ts) (HTTP service), [`Backend/src/routes/workspaceMessagingRoutes.ts`](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/workspaceMessagingRoutes.ts) (Messaging routes), [`Backend/src/routes/workspaceTaskRoutes.ts`](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/workspaceTaskRoutes.ts) (Task routes), [`Backend/src/services/aiTaskService.ts`](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/services/aiTaskService.ts) (Task detection service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client applications"]
  node_android_api["Android API client"]
  node_android_network["Android network setup<br/>[NetworkClient.kt]"]
  node_android_tasks["Android task screen<br/>[TasksScreen.kt]"]
  node_web_tasks["Web task experience<br/>[tasks.tsx]"]
  node_web_ai_review["AI task review"]
end

subgraph group_backend["Backend runtime"]
  node_backend_server["HTTP service<br/>[server.ts]"]
end

subgraph group_collaboration["Workspace and messaging"]
  node_workspace_routes["Workspace routes<br/>[workspaceRoutes.ts]"]
  node_messaging_routes["Messaging routes"]
  node_message_service["Message operations<br/>[messageService.ts]"]
  node_socket_handler["Realtime messaging<br/>[socketHandler.ts]"]
  node_workspace_model["Workspace records<br/>[Workspace.ts]"]
  node_conversation_model["Conversation records<br/>[Conversation.ts]"]
  node_message_model["Message records<br/>[Message.ts]"]
end

subgraph group_tasks_ai["Tasks and AI"]
  node_task_routes["Task routes"]
  node_ai_routes["AI task routes<br/>[aiRoutes.ts]"]
  node_ai_task_service["Task detection service<br/>[aiTaskService.ts]"]
  node_ai_service["AI extraction API<br/>[main.py]"]
  node_extractor["Task extractor<br/>[extractor.py]"]
  node_classifier["Text classifier<br/>[classifier.py]"]
  node_model_loader["Model loading<br/>[model_loader.py]"]
  node_task_model["Task records<br/>[Task.ts]"]
end

subgraph group_identity["Identity and access"]
  node_auth_middleware["Authentication<br/>[auth.ts]"]
  node_rbac_middleware["Workspace authorization<br/>[rbac.ts]"]
  node_firebase["Firebase verification<br/>[firebase.ts]"]
end

node_user(("Team member"))
node_mongo[("MongoDB")]

node_user -.->|"uses"| node_android_tasks
node_android_tasks -.->|"requests tasks"| node_android_api
node_android_network -->|"configures"| node_android_api
node_android_api -.->|"calls API"| node_backend_server
node_user -.->|"uses"| node_web_tasks
node_web_tasks -.->|"opens review"| node_web_ai_review
node_backend_server -.->|"mounts routes"| node_auth_middleware
node_backend_server -->|"mounts"| node_workspace_routes
node_backend_server -->|"mounts"| node_messaging_routes
node_backend_server -->|"mounts"| node_task_routes
node_backend_server -->|"mounts"| node_ai_routes
node_auth_middleware -->|"verifies tokens"| node_firebase
node_auth_middleware -->|"provides identity"| node_rbac_middleware
node_workspace_routes -->|"reads and writes"| node_workspace_model
node_messaging_routes -->|"reads and writes"| node_conversation_model
node_messaging_routes -->|"reads and writes"| node_message_model
node_messaging_routes -->|"delegates reads"| node_message_service
node_socket_handler -->|"delegates messages"| node_message_service
node_message_service -->|"persists messages"| node_message_model
node_task_routes -->|"reads and writes"| node_task_model
node_task_routes -->|"emits updates"| node_socket_handler
node_ai_routes -->|"detects tasks"| node_ai_task_service
node_ai_task_service -->|"reads messages"| node_message_model
node_ai_task_service -.->|"creates tasks"| node_task_model
node_backend_server -.->|"connects"| node_mongo
node_ai_service -->|"runs extraction"| node_extractor
node_extractor -->|"classifies text"| node_classifier
node_ai_service -->|"loads models"| node_model_loader

click node_android_api "https://github.com/rajathraj12/action-flow/blob/main/action-flow-android/app/src/main/java/com/actionflow/data/api/ActionFlowApiService.kt"
click node_android_network "https://github.com/rajathraj12/action-flow/blob/main/action-flow-android/app/src/main/java/com/actionflow/data/api/NetworkClient.kt"
click node_android_tasks "https://github.com/rajathraj12/action-flow/blob/main/action-flow-android/app/src/main/java/com/actionflow/presentation/screens/tasks/TasksScreen.kt"
click node_web_tasks "https://github.com/rajathraj12/action-flow/blob/main/Frontend/src/routes/tasks.tsx"
click node_web_ai_review "https://github.com/rajathraj12/action-flow/blob/main/Frontend/src/components/tasks/AiTaskReviewModal.tsx"
click node_backend_server "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/server.ts"
click node_auth_middleware "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/middleware/auth.ts"
click node_rbac_middleware "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/middleware/rbac.ts"
click node_firebase "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/config/firebase.ts"
click node_workspace_routes "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/workspaceRoutes.ts"
click node_messaging_routes "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/workspaceMessagingRoutes.ts"
click node_message_service "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/services/messageService.ts"
click node_socket_handler "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/socket/socketHandler.ts"
click node_task_routes "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/workspaceTaskRoutes.ts"
click node_ai_routes "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/aiRoutes.ts"
click node_ai_task_service "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/services/aiTaskService.ts"
click node_ai_service "https://github.com/rajathraj12/action-flow/blob/main/AI-Service/app/main.py"
click node_extractor "https://github.com/rajathraj12/action-flow/blob/main/AI-Service/app/extractor.py"
click node_classifier "https://github.com/rajathraj12/action-flow/blob/main/AI-Service/app/classifier.py"
click node_model_loader "https://github.com/rajathraj12/action-flow/blob/main/AI-Service/app/model_loader.py"
click node_workspace_model "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/models/Workspace.ts"
click node_conversation_model "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/models/Conversation.ts"
click node_message_model "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/models/Message.ts"
click node_task_model "https://github.com/rajathraj12/action-flow/blob/main/Backend/src/models/Task.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_android_api,node_android_network,node_android_tasks,node_web_tasks,node_web_ai_review toneBlue
class node_backend_server,node_mongo toneAmber
class node_workspace_routes,node_messaging_routes,node_message_service,node_socket_handler,node_workspace_model,node_conversation_model,node_message_model toneMint
class node_task_routes,node_ai_routes,node_ai_task_service,node_ai_service,node_extractor,node_classifier,node_model_loader,node_task_model toneRose
class node_auth_middleware,node_rbac_middleware,node_firebase,node_user toneIndigo
```

## Components

### Client applications

- [Android API client](https://github.com/rajathraj12/action-flow/blob/main/action-flow-android/app/src/main/java/com/actionflow/data/api/ActionFlowApiService.kt): `action-flow-android/app/src/main/java/com/actionflow/data/api/ActionFlowApiService.kt`
- [Android network setup](https://github.com/rajathraj12/action-flow/blob/main/action-flow-android/app/src/main/java/com/actionflow/data/api/NetworkClient.kt): `action-flow-android/app/src/main/java/com/actionflow/data/api/NetworkClient.kt`
- [Android task screen](https://github.com/rajathraj12/action-flow/blob/main/action-flow-android/app/src/main/java/com/actionflow/presentation/screens/tasks/TasksScreen.kt): `action-flow-android/app/src/main/java/com/actionflow/presentation/screens/tasks/TasksScreen.kt`
- [Web task experience](https://github.com/rajathraj12/action-flow/blob/main/Frontend/src/routes/tasks.tsx): `Frontend/src/routes/tasks.tsx`
- [AI task review](https://github.com/rajathraj12/action-flow/blob/main/Frontend/src/components/tasks/AiTaskReviewModal.tsx): `Frontend/src/components/tasks/AiTaskReviewModal.tsx`

### Backend runtime

- [HTTP service](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/server.ts): `Backend/src/server.ts`

### Workspace and messaging

- [Workspace routes](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/workspaceRoutes.ts): `Backend/src/routes/workspaceRoutes.ts`
- [Messaging routes](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/workspaceMessagingRoutes.ts): `Backend/src/routes/workspaceMessagingRoutes.ts`
- [Message operations](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/services/messageService.ts): `Backend/src/services/messageService.ts`
- [Realtime messaging](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/socket/socketHandler.ts): `Backend/src/socket/socketHandler.ts`
- [Workspace records](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/models/Workspace.ts): `Backend/src/models/Workspace.ts`
- [Conversation records](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/models/Conversation.ts): `Backend/src/models/Conversation.ts`
- [Message records](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/models/Message.ts): `Backend/src/models/Message.ts`

### Tasks and AI

- [Task routes](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/workspaceTaskRoutes.ts): `Backend/src/routes/workspaceTaskRoutes.ts`
- [AI task routes](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/routes/aiRoutes.ts): `Backend/src/routes/aiRoutes.ts`
- [Task detection service](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/services/aiTaskService.ts): `Backend/src/services/aiTaskService.ts`
- [AI extraction API](https://github.com/rajathraj12/action-flow/blob/main/AI-Service/app/main.py): `AI-Service/app/main.py`
- [Task extractor](https://github.com/rajathraj12/action-flow/blob/main/AI-Service/app/extractor.py): `AI-Service/app/extractor.py`
- [Text classifier](https://github.com/rajathraj12/action-flow/blob/main/AI-Service/app/classifier.py): `AI-Service/app/classifier.py`
- [Model loading](https://github.com/rajathraj12/action-flow/blob/main/AI-Service/app/model_loader.py): `AI-Service/app/model_loader.py`
- [Task records](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/models/Task.ts): `Backend/src/models/Task.ts`

### Identity and access

- [Authentication](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/middleware/auth.ts): `Backend/src/middleware/auth.ts`
- [Workspace authorization](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/middleware/rbac.ts): `Backend/src/middleware/rbac.ts`
- [Firebase verification](https://github.com/rajathraj12/action-flow/blob/main/Backend/src/config/firebase.ts): `Backend/src/config/firebase.ts`

### Other components

- **Team member**
- **MongoDB**

## Connections

- Team member → Android task screen: uses
- Android task screen → Android API client: requests tasks
- Android network setup → Android API client: configures (evidence: `action-flow-android/app/src/main/java/com/actionflow/data/api/NetworkClient.kt`)
- Android API client → HTTP service: calls API
- Team member → Web task experience: uses
- Web task experience → AI task review: opens review
- HTTP service → Authentication: mounts routes
- HTTP service → Workspace routes: mounts (evidence: `Backend/src/server.ts`)
- HTTP service → Messaging routes: mounts (evidence: `Backend/src/server.ts`)
- HTTP service → Task routes: mounts (evidence: `Backend/src/server.ts`)
- HTTP service → AI task routes: mounts (evidence: `Backend/src/server.ts`)
- Authentication → Firebase verification: verifies tokens (evidence: `Backend/src/middleware/auth.ts`)
- Authentication → Workspace authorization: provides identity (evidence: `Backend/src/middleware/rbac.ts`)
- Workspace routes → Workspace records: reads and writes (evidence: `Backend/src/routes/workspaceRoutes.ts`)
- Messaging routes → Conversation records: reads and writes (evidence: `Backend/src/routes/workspaceMessagingRoutes.ts`)
- Messaging routes → Message records: reads and writes (evidence: `Backend/src/routes/workspaceMessagingRoutes.ts`)
- Messaging routes → Message operations: delegates reads (evidence: `Backend/src/routes/workspaceMessagingRoutes.ts`)
- Realtime messaging → Message operations: delegates messages (evidence: `Backend/src/socket/socketHandler.ts`)
- Message operations → Message records: persists messages (evidence: `Backend/src/services/messageService.ts`)
- Task routes → Task records: reads and writes (evidence: `Backend/src/routes/workspaceTaskRoutes.ts`)
- Task routes → Realtime messaging: emits updates (evidence: `Backend/src/routes/workspaceTaskRoutes.ts`)
- AI task routes → Task detection service: detects tasks (evidence: `Backend/src/routes/aiRoutes.ts`)
- Task detection service → Message records: reads messages
- Task detection service → Task records: creates tasks
- HTTP service → MongoDB: connects
- AI extraction API → Task extractor: runs extraction (evidence: `AI-Service/app/main.py`)
- Task extractor → Text classifier: classifies text (evidence: `AI-Service/app/extractor.py`)
- AI extraction API → Model loading: loads models (evidence: `AI-Service/app/main.py`)
