# farhodoff/zyra architecture

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

- Interactive diagram: https://gitdiagram.com/farhodoff/zyra
- Repository: https://github.com/farhodoff/zyra

## Overview

Zyra is a full-stack project-management and collaboration platform. Users authenticate, organize projects and members, manage tasks on a Kanban board, and collaborate through comments, attachments, notifications, and live updates. The frontend routes users through pages and Zustand stores into an HTTP API; the Express backend routes requests to controllers, which operate on MongoDB models. Socket.IO carries live task and collaboration events. The README documents the product capabilities; some backend routes and frontend features were not sampled, so their internal links are omitted or marked unverified.

Main entry points: [`backend/src/index.js`](https://github.com/farhodoff/zyra/blob/main/backend/src/index.js) (Express and Socket.IO server), [`frontend/src/App.jsx`](https://github.com/farhodoff/zyra/blob/main/frontend/src/App.jsx) (Application routing), [`frontend/src/pages/ProjectView.jsx`](https://github.com/farhodoff/zyra/blob/main/frontend/src/pages/ProjectView.jsx) (Kanban project view), [`backend/src/controllers/commentController.js`](https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/commentController.js) (Comments and mentions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Application routing<br/>[App.jsx]"]
  node_authpages["Sign-in and registration<br/>[Login.jsx]"]
  node_dashboard["Project dashboard<br/>[Dashboard.jsx]"]
  node_projectview["Kanban project view<br/>[ProjectView.jsx]"]
  node_taskdetails["Task details"]
  node_profile["User profile<br/>[Profile.jsx]"]
  node_authstore["Authentication state<br/>[authStore.js]"]
  node_projectstore["Project state<br/>[projectStore.js]"]
  node_taskstore["Task state<br/>[taskStore.js]"]
  node_api["HTTP API client<br/>[api.js]"]
  node_socketclient["Realtime client<br/>[socket.js]"]
end

subgraph group_api["API and realtime"]
  node_server["Express and Socket.IO server<br/>[index.js]"]
  node_authmw["JWT authorization<br/>[authMiddleware.js]"]
  node_sockethandler["Room event handling<br/>[socketHandler.js]"]
end

subgraph group_domain["Collaboration domain"]
  node_authctrl["Authentication<br/>[authController.js]"]
  node_projectctrl["Project and membership"]
  node_taskctrl["Task and attachments<br/>[taskController.js]"]
  node_commentctrl["Comments and mentions"]
  node_notificationctrl["Notifications"]
end

subgraph group_persistence["Persistence"]
  node_users[("User records<br/>[User.js]")]
  node_projects[("Project records<br/>[Project.js]")]
  node_tasks[("Task records<br/>[Task.js]")]
  node_comments[("Comment records<br/>[Comment.js]")]
  node_notifications[("Notification records<br/>[Notification.js]")]
end

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

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authpages
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_projectview
node_app -->|"routes to"| node_profile
node_app -->|"loads session"| node_authstore
node_authpages -.->|"uses"| node_authstore
node_dashboard -->|"uses"| node_projectstore
node_projectview -->|"uses"| node_projectstore
node_projectview -->|"uses"| node_taskstore
node_projectview -->|"opens"| node_taskdetails
node_projectview -->|"subscribes"| node_socketclient
node_taskdetails -->|"uses"| node_taskstore
node_authstore -->|"calls"| node_api
node_projectstore -->|"calls"| node_api
node_taskstore -->|"calls"| node_api
node_api -.->|"sends HTTP requests"| node_server
node_server -.->|"protects routes"| node_authmw
node_server -->|"routes requests"| node_authctrl
node_server -->|"routes requests"| node_projectctrl
node_server -->|"routes requests"| node_taskctrl
node_server -->|"routes requests"| node_commentctrl
node_server -->|"routes requests"| node_notificationctrl
node_server -->|"registers"| node_sockethandler
node_authmw -->|"loads user"| node_users
node_authctrl -->|"reads and writes"| node_users
node_projectctrl -->|"reads and writes"| node_projects
node_projectctrl -->|"looks up members"| node_users
node_taskctrl -->|"reads and writes"| node_tasks
node_taskctrl -->|"checks membership"| node_projects
node_commentctrl -->|"reads and writes"| node_comments
node_commentctrl -->|"loads task"| node_tasks
node_commentctrl -->|"creates alerts"| node_notifications
node_notificationctrl -->|"manages alerts"| node_notifications
node_sockethandler -.->|"synchronizes events"| node_socketclient
node_users -.->|"persists"| node_mongodb
node_projects -.->|"persists"| node_mongodb
node_tasks -.->|"persists"| node_mongodb
node_comments -.->|"persists"| node_mongodb
node_notifications -.->|"persists"| node_mongodb

click node_app "https://github.com/farhodoff/zyra/blob/main/frontend/src/App.jsx"
click node_authpages "https://github.com/farhodoff/zyra/blob/main/frontend/src/pages/Login.jsx"
click node_dashboard "https://github.com/farhodoff/zyra/blob/main/frontend/src/pages/Dashboard.jsx"
click node_projectview "https://github.com/farhodoff/zyra/blob/main/frontend/src/pages/ProjectView.jsx"
click node_taskdetails "https://github.com/farhodoff/zyra/blob/main/frontend/src/components/TaskDetailsModal.jsx"
click node_profile "https://github.com/farhodoff/zyra/blob/main/frontend/src/pages/Profile.jsx"
click node_authstore "https://github.com/farhodoff/zyra/blob/main/frontend/src/store/authStore.js"
click node_projectstore "https://github.com/farhodoff/zyra/blob/main/frontend/src/store/projectStore.js"
click node_taskstore "https://github.com/farhodoff/zyra/blob/main/frontend/src/store/taskStore.js"
click node_api "https://github.com/farhodoff/zyra/blob/main/frontend/src/api/api.js"
click node_socketclient "https://github.com/farhodoff/zyra/blob/main/frontend/src/services/socket.js"
click node_server "https://github.com/farhodoff/zyra/blob/main/backend/src/index.js"
click node_authmw "https://github.com/farhodoff/zyra/blob/main/backend/src/middleware/authMiddleware.js"
click node_authctrl "https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/authController.js"
click node_projectctrl "https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/projectController.js"
click node_taskctrl "https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/taskController.js"
click node_commentctrl "https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/commentController.js"
click node_notificationctrl "https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/notificationController.js"
click node_sockethandler "https://github.com/farhodoff/zyra/blob/main/backend/src/socket/socketHandler.js"
click node_users "https://github.com/farhodoff/zyra/blob/main/backend/src/models/User.js"
click node_projects "https://github.com/farhodoff/zyra/blob/main/backend/src/models/Project.js"
click node_tasks "https://github.com/farhodoff/zyra/blob/main/backend/src/models/Task.js"
click node_comments "https://github.com/farhodoff/zyra/blob/main/backend/src/models/Comment.js"
click node_notifications "https://github.com/farhodoff/zyra/blob/main/backend/src/models/Notification.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_app,node_authpages,node_dashboard,node_projectview,node_taskdetails,node_profile,node_authstore,node_projectstore,node_taskstore,node_api,node_socketclient toneBlue
class node_server,node_authmw,node_sockethandler,node_mongodb toneAmber
class node_authctrl,node_projectctrl,node_taskctrl,node_commentctrl,node_notificationctrl toneMint
class node_users,node_projects,node_tasks,node_comments,node_notifications toneRose
class node_user toneIndigo
```

## Components

### Web client

- [Application routing](https://github.com/farhodoff/zyra/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in and registration](https://github.com/farhodoff/zyra/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Project dashboard](https://github.com/farhodoff/zyra/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Kanban project view](https://github.com/farhodoff/zyra/blob/main/frontend/src/pages/ProjectView.jsx): `frontend/src/pages/ProjectView.jsx`
- [Task details](https://github.com/farhodoff/zyra/blob/main/frontend/src/components/TaskDetailsModal.jsx): `frontend/src/components/TaskDetailsModal.jsx`
- [User profile](https://github.com/farhodoff/zyra/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`
- [Authentication state](https://github.com/farhodoff/zyra/blob/main/frontend/src/store/authStore.js): `frontend/src/store/authStore.js`
- [Project state](https://github.com/farhodoff/zyra/blob/main/frontend/src/store/projectStore.js): `frontend/src/store/projectStore.js`
- [Task state](https://github.com/farhodoff/zyra/blob/main/frontend/src/store/taskStore.js): `frontend/src/store/taskStore.js`
- [HTTP API client](https://github.com/farhodoff/zyra/blob/main/frontend/src/api/api.js): `frontend/src/api/api.js`
- [Realtime client](https://github.com/farhodoff/zyra/blob/main/frontend/src/services/socket.js): `frontend/src/services/socket.js`

### API and realtime

- [Express and Socket.IO server](https://github.com/farhodoff/zyra/blob/main/backend/src/index.js): `backend/src/index.js`
- [JWT authorization](https://github.com/farhodoff/zyra/blob/main/backend/src/middleware/authMiddleware.js): `backend/src/middleware/authMiddleware.js`
- [Room event handling](https://github.com/farhodoff/zyra/blob/main/backend/src/socket/socketHandler.js): `backend/src/socket/socketHandler.js`

### Collaboration domain

- [Authentication](https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Project and membership](https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/projectController.js): `backend/src/controllers/projectController.js`
- [Task and attachments](https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/taskController.js): `backend/src/controllers/taskController.js`
- [Comments and mentions](https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/commentController.js): `backend/src/controllers/commentController.js`
- [Notifications](https://github.com/farhodoff/zyra/blob/main/backend/src/controllers/notificationController.js): `backend/src/controllers/notificationController.js`

### Persistence

- [User records](https://github.com/farhodoff/zyra/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Project records](https://github.com/farhodoff/zyra/blob/main/backend/src/models/Project.js): `backend/src/models/Project.js`
- [Task records](https://github.com/farhodoff/zyra/blob/main/backend/src/models/Task.js): `backend/src/models/Task.js`
- [Comment records](https://github.com/farhodoff/zyra/blob/main/backend/src/models/Comment.js): `backend/src/models/Comment.js`
- [Notification records](https://github.com/farhodoff/zyra/blob/main/backend/src/models/Notification.js): `backend/src/models/Notification.js`

### Other components

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

## Connections

- Team member → Application routing: uses (evidence: `frontend/src/App.jsx`)
- Application routing → Sign-in and registration: routes to (evidence: `frontend/src/App.jsx`)
- Application routing → Project dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Application routing → Kanban project view: routes to (evidence: `frontend/src/App.jsx`)
- Application routing → User profile: routes to (evidence: `frontend/src/App.jsx`)
- Application routing → Authentication state: loads session (evidence: `frontend/src/App.jsx`)
- Sign-in and registration → Authentication state: uses
- Project dashboard → Project state: uses (evidence: `frontend/src/pages/Dashboard.jsx`)
- Kanban project view → Project state: uses (evidence: `frontend/src/pages/ProjectView.jsx`)
- Kanban project view → Task state: uses (evidence: `frontend/src/pages/ProjectView.jsx`)
- Kanban project view → Task details: opens (evidence: `frontend/src/pages/ProjectView.jsx`)
- Kanban project view → Realtime client: subscribes (evidence: `frontend/src/pages/ProjectView.jsx`)
- Task details → Task state: uses (evidence: `frontend/src/components/TaskDetailsModal.jsx`)
- Authentication state → HTTP API client: calls (evidence: `frontend/src/store/authStore.js`)
- Project state → HTTP API client: calls (evidence: `frontend/src/store/projectStore.js`)
- Task state → HTTP API client: calls (evidence: `frontend/src/store/taskStore.js`)
- HTTP API client → Express and Socket.IO server: sends HTTP requests
- Express and Socket.IO server → JWT authorization: protects routes
- Express and Socket.IO server → Authentication: routes requests (evidence: `backend/src/index.js`)
- Express and Socket.IO server → Project and membership: routes requests (evidence: `backend/src/index.js`)
- Express and Socket.IO server → Task and attachments: routes requests (evidence: `backend/src/index.js`)
- Express and Socket.IO server → Comments and mentions: routes requests (evidence: `backend/src/index.js`)
- Express and Socket.IO server → Notifications: routes requests (evidence: `backend/src/index.js`)
- Express and Socket.IO server → Room event handling: registers (evidence: `backend/src/index.js`)
- JWT authorization → User records: loads user (evidence: `backend/src/middleware/authMiddleware.js`)
- Authentication → User records: reads and writes (evidence: `backend/src/controllers/authController.js`)
- Project and membership → Project records: reads and writes (evidence: `backend/src/controllers/projectController.js`)
- Project and membership → User records: looks up members (evidence: `backend/src/controllers/projectController.js`)
- Task and attachments → Task records: reads and writes (evidence: `backend/src/controllers/taskController.js`)
- Task and attachments → Project records: checks membership (evidence: `backend/src/controllers/taskController.js`)
- Comments and mentions → Comment records: reads and writes (evidence: `backend/src/controllers/commentController.js`)
- Comments and mentions → Task records: loads task (evidence: `backend/src/controllers/commentController.js`)
- Comments and mentions → Notification records: creates alerts (evidence: `backend/src/controllers/commentController.js`)
- Notifications → Notification records: manages alerts (evidence: `backend/src/controllers/notificationController.js`)
- Room event handling → Realtime client: synchronizes events
- User records → MongoDB: persists
- Project records → MongoDB: persists
- Task records → MongoDB: persists
- Comment records → MongoDB: persists
- Notification records → MongoDB: persists
