# mohammad-alhayek/devflow architecture

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

- Interactive diagram: https://gitdiagram.com/mohammad-alhayek/devflow
- Repository: https://github.com/mohammad-alhayek/devflow

## Overview

This is a project and task management web app: users sign in, manage projects, create and assign tasks, and developers can view their assigned work and update task status. The sampled implementation shows project/task requests passing through API routes, authentication and validation, services, repositories, and Prisma. The tree and source index also identify personal-task and developer-directory features, but their implementation details were not sampled; those connections are shown only where supported or marked unverified.

Main entry points: [`components/tasks/TaskSection.js`](https://github.com/mohammad-alhayek/devflow/blob/main/components/tasks/TaskSection.js) (Project tasks), [`services/task.service.js`](https://github.com/mohammad-alhayek/devflow/blob/main/services/task.service.js) (Task service), [`middlewares/auth.middleware.js`](https://github.com/mohammad-alhayek/devflow/blob/main/middlewares/auth.middleware.js) (Session guard), [`app/api/auth/login/route.js`](https://github.com/mohammad-alhayek/devflow/blob/main/app/api/auth/login/route.js) (Auth endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_auth_pages["Sign-in pages<br/>[page.js]"]
  node_project_pages["Project screens<br/>[page.js]"]
  node_task_section["Project tasks<br/>[TaskSection.js]"]
  node_task_form["Task form<br/>[TaskForm.js]"]
  node_task_search["Task search<br/>[SearchInput.js]"]
  node_my_tasks["Assigned work<br/>[page.js]"]
  node_kanban["Kanban board<br/>[KanbanBoard.js]"]
end

subgraph group_api["API routes"]
  node_auth_api["Auth endpoints<br/>[route.js]"]
  node_project_api["Project endpoints<br/>[route.js]"]
  node_task_api["Project task endpoints<br/>[route.js]"]
  node_my_task_api["Assigned-task endpoints<br/>[route.js]"]
  node_developer_api["Developer directory<br/>[route.js]"]
end

subgraph group_domain["Domain logic"]
  node_auth_guard["Session guard<br/>[auth.middleware.js]"]
  node_session_tokens["JWT sessions<br/>[auth.js]"]
  node_auth_validation["Auth validation<br/>[auth.validator.js]"]
  node_auth_service["Account service<br/>[auth.service.js]"]
  node_project_validation["Project validation"]
  node_task_validation["Task validation<br/>[task.validator.js]"]
  node_project_service["Project service<br/>[project.service.js]"]
  node_task_service["Task service<br/>[task.service.js]"]
  node_user_service["User service<br/>[user.service.js]"]
end

subgraph group_data["Persistence"]
  node_project_repo["Project repository"]
  node_task_repo["Task repository<br/>[task.repository.js]"]
  node_user_repo["User repository<br/>[user.repository.js]"]
  node_prisma["Prisma client<br/>[prisma.js]"]
end

node_user(("User"))
node_database[("Database")]

node_user -->|"uses"| node_auth_pages
node_user -->|"manages"| node_project_pages
node_auth_pages -.->|"submits credentials"| node_auth_api
node_project_pages -.->|"shows tasks"| node_task_section
node_task_section -->|"fetches and saves"| node_task_api
node_task_section -->|"fetches assignees"| node_developer_api
node_task_section -->|"opens"| node_task_form
node_task_section -->|"filters with"| node_task_search
node_user -.->|"reviews assigned work"| node_my_tasks
node_my_tasks -.->|"displays board"| node_kanban
node_my_tasks -.->|"requests assignments"| node_my_task_api
node_auth_api -->|"validates input"| node_auth_validation
node_auth_api -->|"authenticates"| node_auth_service
node_auth_api -->|"creates session"| node_session_tokens
node_auth_service -->|"reads and creates users"| node_user_repo
node_auth_guard -->|"verifies token"| node_session_tokens
node_project_api -->|"checks session"| node_auth_guard
node_project_api -->|"validates input"| node_project_validation
node_project_api -->|"manages projects"| node_project_service
node_task_api -->|"checks session"| node_auth_guard
node_task_api -->|"validates input"| node_task_validation
node_task_api -->|"manages tasks"| node_task_service
node_my_task_api -->|"checks session"| node_auth_guard
node_my_task_api -->|"loads assigned work"| node_task_service
node_developer_api -->|"checks session"| node_auth_guard
node_developer_api -->|"lists developers"| node_user_service
node_project_service -->|"uses"| node_project_repo
node_task_service -->|"reads and writes tasks"| node_task_repo
node_task_service -->|"checks project ownership"| node_project_repo
node_task_service -->|"checks assignees"| node_user_repo
node_user_service -->|"uses"| node_user_repo
node_project_repo -->|"queries through"| node_prisma
node_task_repo -->|"queries through"| node_prisma
node_user_repo -->|"queries through"| node_prisma
node_prisma -.->|"persists data"| node_database

click node_auth_pages "https://github.com/mohammad-alhayek/devflow/blob/main/app/login/page.js"
click node_project_pages "https://github.com/mohammad-alhayek/devflow/blob/main/app/(app)/projects/page.js"
click node_task_section "https://github.com/mohammad-alhayek/devflow/blob/main/components/tasks/TaskSection.js"
click node_task_form "https://github.com/mohammad-alhayek/devflow/blob/main/components/tasks/TaskForm.js"
click node_task_search "https://github.com/mohammad-alhayek/devflow/blob/main/components/common/SearchInput.js"
click node_my_tasks "https://github.com/mohammad-alhayek/devflow/blob/main/app/(app)/my-tasks/page.js"
click node_kanban "https://github.com/mohammad-alhayek/devflow/blob/main/components/my-tasks/KanbanBoard.js"
click node_auth_api "https://github.com/mohammad-alhayek/devflow/blob/main/app/api/auth/login/route.js"
click node_project_api "https://github.com/mohammad-alhayek/devflow/blob/main/app/api/projects/route.js"
click node_task_api "https://github.com/mohammad-alhayek/devflow/blob/main/app/api/projects/%5Bid%5D/tasks/route.js"
click node_my_task_api "https://github.com/mohammad-alhayek/devflow/blob/main/app/api/my-tasks/projects/route.js"
click node_developer_api "https://github.com/mohammad-alhayek/devflow/blob/main/app/api/users/developers/route.js"
click node_auth_guard "https://github.com/mohammad-alhayek/devflow/blob/main/middlewares/auth.middleware.js"
click node_session_tokens "https://github.com/mohammad-alhayek/devflow/blob/main/lib/auth.js"
click node_auth_validation "https://github.com/mohammad-alhayek/devflow/blob/main/validators/auth.validator.js"
click node_auth_service "https://github.com/mohammad-alhayek/devflow/blob/main/services/auth.service.js"
click node_project_validation "https://github.com/mohammad-alhayek/devflow/blob/main/validators/project.validator.js"
click node_task_validation "https://github.com/mohammad-alhayek/devflow/blob/main/validators/task.validator.js"
click node_project_service "https://github.com/mohammad-alhayek/devflow/blob/main/services/project.service.js"
click node_task_service "https://github.com/mohammad-alhayek/devflow/blob/main/services/task.service.js"
click node_user_service "https://github.com/mohammad-alhayek/devflow/blob/main/services/user.service.js"
click node_project_repo "https://github.com/mohammad-alhayek/devflow/blob/main/repositories/project.repository.js"
click node_task_repo "https://github.com/mohammad-alhayek/devflow/blob/main/repositories/task.repository.js"
click node_user_repo "https://github.com/mohammad-alhayek/devflow/blob/main/repositories/user.repository.js"
click node_prisma "https://github.com/mohammad-alhayek/devflow/blob/main/lib/prisma.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_auth_pages,node_project_pages,node_task_section,node_task_form,node_task_search,node_my_tasks,node_kanban,node_user toneBlue
class node_auth_api,node_project_api,node_task_api,node_my_task_api,node_developer_api,node_database toneAmber
class node_auth_guard,node_session_tokens,node_auth_validation,node_auth_service,node_project_validation,node_task_validation,node_project_service,node_task_service,node_user_service toneMint
class node_project_repo,node_task_repo,node_user_repo,node_prisma toneRose
```

## Components

### Web experience

- [Sign-in pages](https://github.com/mohammad-alhayek/devflow/blob/main/app/login/page.js): `app/login/page.js`
- [Project screens](https://github.com/mohammad-alhayek/devflow/blob/main/app/(app)/projects/page.js): `app/(app)/projects/page.js`
- [Project tasks](https://github.com/mohammad-alhayek/devflow/blob/main/components/tasks/TaskSection.js): `components/tasks/TaskSection.js`
- [Task form](https://github.com/mohammad-alhayek/devflow/blob/main/components/tasks/TaskForm.js): `components/tasks/TaskForm.js`
- [Task search](https://github.com/mohammad-alhayek/devflow/blob/main/components/common/SearchInput.js): `components/common/SearchInput.js`
- [Assigned work](https://github.com/mohammad-alhayek/devflow/blob/main/app/(app)/my-tasks/page.js): `app/(app)/my-tasks/page.js`
- [Kanban board](https://github.com/mohammad-alhayek/devflow/blob/main/components/my-tasks/KanbanBoard.js): `components/my-tasks/KanbanBoard.js`

### API routes

- [Auth endpoints](https://github.com/mohammad-alhayek/devflow/blob/main/app/api/auth/login/route.js): `app/api/auth/login/route.js`
- [Project endpoints](https://github.com/mohammad-alhayek/devflow/blob/main/app/api/projects/route.js): `app/api/projects/route.js`
- [Project task endpoints](https://github.com/mohammad-alhayek/devflow/blob/main/app/api/projects/%5Bid%5D/tasks/route.js): `app/api/projects/[id]/tasks/route.js`
- [Assigned-task endpoints](https://github.com/mohammad-alhayek/devflow/blob/main/app/api/my-tasks/projects/route.js): `app/api/my-tasks/projects/route.js`
- [Developer directory](https://github.com/mohammad-alhayek/devflow/blob/main/app/api/users/developers/route.js): `app/api/users/developers/route.js`

### Domain logic

- [Session guard](https://github.com/mohammad-alhayek/devflow/blob/main/middlewares/auth.middleware.js): `middlewares/auth.middleware.js`
- [JWT sessions](https://github.com/mohammad-alhayek/devflow/blob/main/lib/auth.js): `lib/auth.js`
- [Auth validation](https://github.com/mohammad-alhayek/devflow/blob/main/validators/auth.validator.js): `validators/auth.validator.js`
- [Account service](https://github.com/mohammad-alhayek/devflow/blob/main/services/auth.service.js): `services/auth.service.js`
- [Project validation](https://github.com/mohammad-alhayek/devflow/blob/main/validators/project.validator.js): `validators/project.validator.js`
- [Task validation](https://github.com/mohammad-alhayek/devflow/blob/main/validators/task.validator.js): `validators/task.validator.js`
- [Project service](https://github.com/mohammad-alhayek/devflow/blob/main/services/project.service.js): `services/project.service.js`
- [Task service](https://github.com/mohammad-alhayek/devflow/blob/main/services/task.service.js): `services/task.service.js`
- [User service](https://github.com/mohammad-alhayek/devflow/blob/main/services/user.service.js): `services/user.service.js`

### Persistence

- [Project repository](https://github.com/mohammad-alhayek/devflow/blob/main/repositories/project.repository.js): `repositories/project.repository.js`
- [Task repository](https://github.com/mohammad-alhayek/devflow/blob/main/repositories/task.repository.js): `repositories/task.repository.js`
- [User repository](https://github.com/mohammad-alhayek/devflow/blob/main/repositories/user.repository.js): `repositories/user.repository.js`
- [Prisma client](https://github.com/mohammad-alhayek/devflow/blob/main/lib/prisma.js): `lib/prisma.js`

### Other components

- **User**
- **Database**

## Connections

- User → Sign-in pages: uses
- User → Project screens: manages
- Sign-in pages → Auth endpoints: submits credentials
- Project screens → Project tasks: shows tasks
- Project tasks → Project task endpoints: fetches and saves (evidence: `components/tasks/TaskSection.js`)
- Project tasks → Developer directory: fetches assignees (evidence: `components/tasks/TaskSection.js`)
- Project tasks → Task form: opens (evidence: `components/tasks/TaskSection.js`)
- Project tasks → Task search: filters with (evidence: `components/tasks/TaskSection.js`)
- User → Assigned work: reviews assigned work
- Assigned work → Kanban board: displays board
- Assigned work → Assigned-task endpoints: requests assignments
- Auth endpoints → Auth validation: validates input (evidence: `app/api/auth/login/route.js`)
- Auth endpoints → Account service: authenticates (evidence: `app/api/auth/login/route.js`)
- Auth endpoints → JWT sessions: creates session (evidence: `app/api/auth/login/route.js`)
- Account service → User repository: reads and creates users (evidence: `services/auth.service.js`)
- Session guard → JWT sessions: verifies token (evidence: `middlewares/auth.middleware.js`)
- Project endpoints → Session guard: checks session (evidence: `app/api/projects/route.js`)
- Project endpoints → Project validation: validates input (evidence: `app/api/projects/route.js`)
- Project endpoints → Project service: manages projects (evidence: `app/api/projects/route.js`)
- Project task endpoints → Session guard: checks session (evidence: `app/api/projects/[id]/tasks/route.js`)
- Project task endpoints → Task validation: validates input (evidence: `app/api/projects/[id]/tasks/route.js`)
- Project task endpoints → Task service: manages tasks (evidence: `app/api/projects/[id]/tasks/route.js`)
- Assigned-task endpoints → Session guard: checks session (evidence: `app/api/my-tasks/projects/route.js`)
- Assigned-task endpoints → Task service: loads assigned work (evidence: `app/api/my-tasks/projects/route.js`)
- Developer directory → Session guard: checks session (evidence: `app/api/users/developers/route.js`)
- Developer directory → User service: lists developers (evidence: `app/api/users/developers/route.js`)
- Project service → Project repository: uses (evidence: `services/project.service.js`)
- Task service → Task repository: reads and writes tasks (evidence: `services/task.service.js`)
- Task service → Project repository: checks project ownership (evidence: `services/task.service.js`)
- Task service → User repository: checks assignees (evidence: `services/task.service.js`)
- User service → User repository: uses (evidence: `services/user.service.js`)
- Project repository → Prisma client: queries through (evidence: `repositories/project.repository.js`)
- Task repository → Prisma client: queries through (evidence: `repositories/task.repository.js`)
- User repository → Prisma client: queries through (evidence: `repositories/user.repository.js`)
- Prisma client → Database: persists data
