# hasnain-a7/nextprojectflow architecture

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

- Interactive diagram: https://gitdiagram.com/hasnain-a7/nextprojectflow
- Repository: https://github.com/hasnain-a7/nextprojectflow

## Overview

Project Flow is a project and task management web app. Users authenticate, enter a protected workspace, and manage projects and tasks; the workspace also presents deadlines, schedules, profile information, and project collaboration. Firebase Auth and Firestore back identity and project data, while a separate chat API calls Gemini. The README is generic Next.js starter text, so product capabilities are inferred from the route tree and sampled components; unsampled route wiring is not asserted.

Main entry points: [`app/context/projectContext.tsx`](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/context/projectContext.tsx) (Project data context), [`app/(protected)/layout.tsx`](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/layout.tsx) (Protected workspace shell), [`app/context/AuthContext.tsx`](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/context/AuthContext.tsx) (Auth context), [`app/config/Firebase.ts`](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/config/Firebase.ts) (Firebase setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and shell"]
  node_signin["Sign in<br/>[page.tsx]"]
  node_signup["Sign up<br/>[page.tsx]"]
  node_authctx["Auth context<br/>[AuthContext.tsx]"]
  node_protected["Protected workspace shell<br/>[layout.tsx]"]
end

subgraph group_work["Project and task work"]
  node_projectctx["Project data context<br/>[projectContext.tsx]"]
  node_projects["Project list<br/>[page.tsx]"]
  node_projectdetail["Project details<br/>[page.tsx]"]
  node_dashboard["Project dashboard<br/>[page.tsx]"]
  node_projectmodal["Project editor<br/>[ProjectModol.tsx]"]
  node_taskmodal["Task editor<br/>[TaskModol.tsx]"]
  node_taskdetail["Task details<br/>[TrelloModol.tsx]"]
end

subgraph group_overview["Planning and overview"]
  node_home["Workspace overview<br/>[page.tsx]"]
  node_schedule["Schedule<br/>[page.tsx]"]
  node_profile["Profile<br/>[page.tsx]"]
end

subgraph group_collaboration["Collaboration and AI"]
  node_projectchat["Project chat"]
  node_chatpage["AI chat page<br/>[page.tsx]"]
  node_chatapi["Chat API<br/>[route.ts]"]
end

subgraph group_services["External services"]
  node_firebaseconfig["Firebase setup<br/>[Firebase.ts]"]
  node_firebaseauth["Firebase Auth"]
  node_firestore[("Cloud Firestore")]
  node_gemini["Google Gemini"]
end

node_user(("User"))

node_user -->|"enters credentials"| node_signin
node_user -->|"registers"| node_signup
node_signin -->|"uses auth"| node_authctx
node_signup -->|"uses auth"| node_authctx
node_authctx -->|"uses clients"| node_firebaseconfig
node_firebaseconfig -->|"configures"| node_firebaseauth
node_firebaseconfig -->|"configures"| node_firestore
node_authctx -->|"authenticates"| node_firebaseauth
node_authctx -->|"writes profile"| node_firestore
node_authctx -->|"provides identity"| node_protected
node_protected -->|"hosts routes"| node_home
node_protected -->|"hosts routes"| node_projects
node_protected -->|"hosts routes"| node_schedule
node_protected -->|"hosts routes"| node_profile
node_protected -->|"workspace data"| node_projectctx
node_projectctx -->|"reads and writes"| node_firestore
node_projects -->|"uses projects"| node_projectctx
node_projectdetail -->|"uses project data"| node_projectctx
node_dashboard -->|"uses project data"| node_projectctx
node_home -->|"uses project data"| node_projectctx
node_schedule -->|"uses project data"| node_projectctx
node_projectmodal -->|"edits projects"| node_projectctx
node_taskmodal -->|"edits tasks"| node_projectctx
node_taskdetail -->|"shows task detail"| node_projectdetail
node_user -->|"opens collaboration"| node_projectchat
node_projectchat -->|"reads and writes chat"| node_firestore
node_user -->|"asks questions"| node_chatpage
node_chatpage -->|"posts messages"| node_chatapi
node_chatapi -->|"generates response"| node_gemini

click node_signin "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(auth)/SignIn/page.tsx"
click node_signup "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(auth)/SignUp/page.tsx"
click node_authctx "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/context/AuthContext.tsx"
click node_protected "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/layout.tsx"
click node_firebaseconfig "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/config/Firebase.ts"
click node_projectctx "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/context/projectContext.tsx"
click node_projects "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/projects/page.tsx"
click node_projectdetail "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/projects/%5BprojectId%5D/page.tsx"
click node_dashboard "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/dashboard/%5BprojectId%5D/page.tsx"
click node_projectmodal "https://github.com/hasnain-a7/nextprojectflow/blob/main/components/modols/ProjectModol.tsx"
click node_taskmodal "https://github.com/hasnain-a7/nextprojectflow/blob/main/components/modols/TaskModol.tsx"
click node_taskdetail "https://github.com/hasnain-a7/nextprojectflow/blob/main/components/modols/TrelloModol.tsx"
click node_home "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/Home/page.tsx"
click node_schedule "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/schedule/page.tsx"
click node_profile "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/profile/page.tsx"
click node_projectchat "https://github.com/hasnain-a7/nextprojectflow/blob/main/components/modols/ProjectChatModal.tsx"
click node_chatpage "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/chatai/page.tsx"
click node_chatapi "https://github.com/hasnain-a7/nextprojectflow/blob/main/app/api/chat/route.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_signin,node_signup,node_authctx,node_protected,node_user toneBlue
class node_projectctx,node_projects,node_projectdetail,node_dashboard,node_projectmodal,node_taskmodal,node_taskdetail toneAmber
class node_home,node_schedule,node_profile toneMint
class node_projectchat,node_chatpage,node_chatapi toneRose
class node_firebaseconfig,node_firebaseauth,node_firestore,node_gemini toneIndigo
```

## Components

### Identity and shell

- [Sign in](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(auth)/SignIn/page.tsx): `app/(auth)/SignIn/page.tsx`
- [Sign up](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(auth)/SignUp/page.tsx): `app/(auth)/SignUp/page.tsx`
- [Auth context](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/context/AuthContext.tsx): `app/context/AuthContext.tsx`
- [Protected workspace shell](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/layout.tsx): `app/(protected)/layout.tsx`

### Project and task work

- [Project data context](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/context/projectContext.tsx): `app/context/projectContext.tsx`
- [Project list](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/projects/page.tsx): `app/(protected)/projects/page.tsx`
- [Project details](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/projects/%5BprojectId%5D/page.tsx): `app/(protected)/projects/[projectId]/page.tsx`
- [Project dashboard](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/dashboard/%5BprojectId%5D/page.tsx): `app/(protected)/dashboard/[projectId]/page.tsx`
- [Project editor](https://github.com/hasnain-a7/nextprojectflow/blob/main/components/modols/ProjectModol.tsx): `components/modols/ProjectModol.tsx`
- [Task editor](https://github.com/hasnain-a7/nextprojectflow/blob/main/components/modols/TaskModol.tsx): `components/modols/TaskModol.tsx`
- [Task details](https://github.com/hasnain-a7/nextprojectflow/blob/main/components/modols/TrelloModol.tsx): `components/modols/TrelloModol.tsx`

### Planning and overview

- [Workspace overview](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/Home/page.tsx): `app/(protected)/Home/page.tsx`
- [Schedule](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/schedule/page.tsx): `app/(protected)/schedule/page.tsx`
- [Profile](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/profile/page.tsx): `app/(protected)/profile/page.tsx`

### Collaboration and AI

- [Project chat](https://github.com/hasnain-a7/nextprojectflow/blob/main/components/modols/ProjectChatModal.tsx): `components/modols/ProjectChatModal.tsx`
- [AI chat page](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/(protected)/chatai/page.tsx): `app/(protected)/chatai/page.tsx`
- [Chat API](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/api/chat/route.ts): `app/api/chat/route.ts`

### External services

- [Firebase setup](https://github.com/hasnain-a7/nextprojectflow/blob/main/app/config/Firebase.ts): `app/config/Firebase.ts`
- **Firebase Auth**
- **Cloud Firestore**
- **Google Gemini**

### Other components

- **User**

## Connections

- User → Sign in: enters credentials
- User → Sign up: registers
- Sign in → Auth context: uses auth
- Sign up → Auth context: uses auth
- Auth context → Firebase setup: uses clients
- Firebase setup → Firebase Auth: configures
- Firebase setup → Cloud Firestore: configures
- Auth context → Firebase Auth: authenticates
- Auth context → Cloud Firestore: writes profile
- Auth context → Protected workspace shell: provides identity
- Protected workspace shell → Workspace overview: hosts routes
- Protected workspace shell → Project list: hosts routes
- Protected workspace shell → Schedule: hosts routes
- Protected workspace shell → Profile: hosts routes
- Protected workspace shell → Project data context: workspace data
- Project data context → Cloud Firestore: reads and writes
- Project list → Project data context: uses projects
- Project details → Project data context: uses project data
- Project dashboard → Project data context: uses project data
- Workspace overview → Project data context: uses project data
- Schedule → Project data context: uses project data
- Project editor → Project data context: edits projects
- Task editor → Project data context: edits tasks
- Task details → Project details: shows task detail
- User → Project chat: opens collaboration
- Project chat → Cloud Firestore: reads and writes chat
- User → AI chat page: asks questions
- AI chat page → Chat API: posts messages
- Chat API → Google Gemini: generates response
