# fathy-said/capstone architecture

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

- Interactive diagram: https://gitdiagram.com/fathy-said/capstone
- Repository: https://github.com/fathy-said/capstone

## Overview

#### Purpose and Runtime
Trend-pm is a Vite-built React/TypeScript single-page application for capstone/project management. Its structure supports role-specific workflows for administrators, students, and supervisors: dashboards, projects, teams/tasks, reports, archives, users, and chat. The browser client is bootstrapped by `src/main.tsx`, renders the root application in `src/App.tsx`, and is served through `index.html`.

#### Application Composition and Routing
The route graph is centralized in `src/router/index.tsx`. Domain route aggregators partition navigation by feature and role:
- Dashboard: `src/pages/Dashboard/route.tsx`
- Projects: `src/pages/Project/route.tsx`
- Teams: `src/pages/Teams/route.tsx`
- Users: `src/pages/users/route.tsx`
- Archive: `src/pages/Archive/route.tsx`

Role-specific route modules beneath each domain select distinct pages rather than sharing a single generic screen, e.g. `src/pages/Project/Admin/admin-route.tsx`, `src/pages/Project/Student/student-route.tsx`, and `src/pages/Project/SuperVisor/superVisor-route.tsx`.

#### Authentication, Authorization, and Access Boundaries
Authentication state is represented in `src/store/auth.ts` and exposed through `src/hooks/auth.ts` and `src/hooks/useAuth.ts`. `src/components/AuthorizedRoute/Index.tsx` is the route-level access boundary, while permission evaluation is separated into `src/hooks/permissions.ts`, `src/hooks/HandlePermissions.tsx`, and `src/components/PermissionPage/PermissionPage.tsx`. Auth-oriented screens are grouped in `src/layouts/Auth/Index.tsx`, with login and password recovery flows at `src/pages/Login/Index.tsx`, `src/pages/ForgetPassword/Index.tsx`, and `src/pages/ResetPassword/Index.tsx`.

#### Shells and Shared UI Layer
Authenticated pages use the main application shell in `src/layouts/Main/Index.tsx`, composed around shared navigation elements such as `src/components/Header/Index.tsx` and `src/components/SideMenu/Index.tsx`. Reusable interaction primitives—forms, tables, dialogs, loading states, notifications, and media—form the presentation boundary: `src/components/AppTable/Index.tsx`, `src/components/FormInputs`, `src/components/ModalDialog/Index.tsx`, `src/components/CustomToast/index.tsx`, and `src/components/AppImage/Index.tsx`. Styling is component-local CSS plus Tailwind entry styles at `src/assets/css/tailwindcss.css`.

#### Project and Team Execution Workflows
Projects are managed through role-specific project pages, including administrator management in `src/pages/Project/Admin/adminProject.tsx`, student project/team formation in `src/pages/Project/Student/ProjectPage.tsx` and `src/pages/Project/Student/CreateTeamPanel.tsx`, and supervisor project creation/details in `src/pages/Project/SuperVisor/CreateProject.tsx` and `src/pages/Project/SuperVisor/ProjectDetails.tsx`.

Team delivery centers on task boards, task detail/editing, membership, and supervisor reporting. Student task-board composition resides in `src/pages/Teams/Student/components/TaskBoard.tsx`, `src/pages/Teams/Student/components/TaskColumn.tsx`, and `src/pages/Teams/Student/components/TaskForm.tsx`; supervisor report workflows are in `src/pages/Teams/SuperVisor/Report/Reports.tsx` and `src/pages/Teams/SuperVisor/Report/CreateReport.tsx`.

#### State, Client Boundary, and Services
The repository is a frontend client; no backend implementation or infrastructure manifests are present. The likely API boundary is concentrated under `src/client/index.ts`, with feature hooks such as `src/hooks/archive.ts` and `src/hooks/useNotifications.ts` mediating UI behavior and remote/client operations. Shared utility/state transformations live in `src/store/utils.ts`, `src/utils/transform.ts`, and `src/utils/types.ts`. Environment values are supplied through `.env` and `.env.example`.

#### Build and Assets
Vite is configured by `vite.config.ts`; the app uses TypeScript, PostCSS, and Tailwind configuration (`tsconfig.json`, `postcss.config.cjs`, `tailwind.config.js`). Static/public assets are under `public/images`, while bundled images and SVG icons are under `src/assets/Images` and `src/assets/icons`. The README identifies SVGO as the SVG optimization tool for the icon asset pipeline.

Main entry points: [`src/client/index.ts`](https://github.com/fathy-said/capstone/blob/main/src/client/index.ts) (API client boundary), [`src/App.tsx`](https://github.com/fathy-said/capstone/blob/main/src/App.tsx) (Root application), [`src/router/index.tsx`](https://github.com/fathy-said/capstone/blob/main/src/router/index.tsx) (Route graph), [`src/pages/Dashboard/route.tsx`](https://github.com/fathy-said/capstone/blob/main/src/pages/Dashboard/route.tsx) (Domain route aggregators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Browser Runtime"]
  node_html["Vite HTML entry<br/>entry document<br/>[index.html]"]
  node_main["React bootstrap<br/>React entry<br/>[main.tsx]"]
  node_app["Root application<br/>React root<br/>[App.tsx]"]
  node_main_layout["Authenticated shell<br/>main layout<br/>[Index.tsx]"]
  node_shared_ui["Shared UI primitives<br/>component library<br/>[Index.tsx]"]
  node_assets["Styles &amp; bundled assets<br/>asset pipeline<br/>[tailwindcss.css]"]
end

subgraph group_navigation["Routing &amp; Access"]
  node_router["Route graph<br/>router<br/>[index.tsx]"]
  node_domain_routes["Domain route aggregators<br/>route modules<br/>[route.tsx]"]
  node_authorized_route{{"Authorized route<br/>access boundary<br/>[Index.tsx]"}}
  node_auth_state["Auth state &amp; hooks<br/>client state<br/>[auth.ts]"]
  node_permissions["Permission evaluation<br/>authorization<br/>[permissions.ts]"]
  node_auth_layout["Authentication screens<br/>auth layout<br/>[Index.tsx]"]
end

subgraph group_workflows["Role Workflows"]
  node_project_workflows["Project workflows<br/>role-specific pages<br/>[route.tsx]"]
  node_team_tasks["Student task board<br/>team workflow<br/>[TaskBoard.tsx]"]
  node_supervisor_reports["Supervisor reports<br/>report workflow<br/>[Reports.tsx]"]
end

subgraph group_client["Client Services"]
  node_archive_notifications["Archive &amp; notifications<br/>feature hooks<br/>[archive.ts]"]
  node_api_client{{"API client boundary<br/>HTTP client<br/>[index.ts]"}}
  node_transforms["State transformations<br/>shared utilities<br/>[utils.ts]"]
  node_external_api(("Remote backend API<br/>external service"))
end

node_html -->|"loads"| node_main
node_main -->|"renders"| node_app
node_app -->|"mounts"| node_router
node_app -->|"reads auth"| node_auth_state
node_router -->|"aggregates"| node_domain_routes
node_router -->|"guards protected routes"| node_authorized_route
node_authorized_route -->|"checks session"| node_auth_state
node_authorized_route -->|"evaluates access"| node_permissions
node_router -->|"routes unauthenticated flows"| node_auth_layout
node_authorized_route -->|"admits authenticated pages"| node_main_layout
node_main_layout -->|"uses"| node_shared_ui
node_domain_routes -->|"projects"| node_project_workflows
node_domain_routes -->|"teams"| node_team_tasks
node_domain_routes -->|"reporting"| node_supervisor_reports
node_project_workflows -->|"composes"| node_shared_ui
node_team_tasks -->|"composes"| node_shared_ui
node_supervisor_reports -->|"composes"| node_shared_ui
node_project_workflows -->|"remote operations"| node_api_client
node_team_tasks -->|"task operations"| node_api_client
node_supervisor_reports -->|"report operations"| node_api_client
node_archive_notifications -->|"uses"| node_api_client
node_api_client -.->|"requests"| node_external_api
node_api_client -->|"normalizes data"| node_transforms
node_app -->|"applies styles and assets"| node_assets

click node_html "https://github.com/fathy-said/capstone/blob/main/index.html"
click node_main "https://github.com/fathy-said/capstone/blob/main/src/main.tsx"
click node_app "https://github.com/fathy-said/capstone/blob/main/src/App.tsx"
click node_router "https://github.com/fathy-said/capstone/blob/main/src/router/index.tsx"
click node_domain_routes "https://github.com/fathy-said/capstone/blob/main/src/pages/Dashboard/route.tsx"
click node_authorized_route "https://github.com/fathy-said/capstone/blob/main/src/components/AuthorizedRoute/Index.tsx"
click node_auth_state "https://github.com/fathy-said/capstone/blob/main/src/store/auth.ts"
click node_permissions "https://github.com/fathy-said/capstone/blob/main/src/hooks/permissions.ts"
click node_auth_layout "https://github.com/fathy-said/capstone/blob/main/src/layouts/Auth/Index.tsx"
click node_main_layout "https://github.com/fathy-said/capstone/blob/main/src/layouts/Main/Index.tsx"
click node_shared_ui "https://github.com/fathy-said/capstone/blob/main/src/components/AppTable/Index.tsx"
click node_project_workflows "https://github.com/fathy-said/capstone/blob/main/src/pages/Project/route.tsx"
click node_team_tasks "https://github.com/fathy-said/capstone/blob/main/src/pages/Teams/Student/components/TaskBoard.tsx"
click node_supervisor_reports "https://github.com/fathy-said/capstone/blob/main/src/pages/Teams/SuperVisor/Report/Reports.tsx"
click node_archive_notifications "https://github.com/fathy-said/capstone/blob/main/src/hooks/archive.ts"
click node_api_client "https://github.com/fathy-said/capstone/blob/main/src/client/index.ts"
click node_transforms "https://github.com/fathy-said/capstone/blob/main/src/store/utils.ts"
click node_assets "https://github.com/fathy-said/capstone/blob/main/src/assets/css/tailwindcss.css"

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_html,node_main,node_app,node_main_layout,node_shared_ui,node_assets toneBlue
class node_router,node_domain_routes,node_authorized_route,node_auth_state,node_permissions,node_auth_layout toneAmber
class node_project_workflows,node_team_tasks,node_supervisor_reports toneMint
class node_archive_notifications,node_api_client,node_transforms,node_external_api toneRose
```

## Components

### Browser Runtime

- [Vite HTML entry](https://github.com/fathy-said/capstone/blob/main/index.html): entry document · `index.html`
- [React bootstrap](https://github.com/fathy-said/capstone/blob/main/src/main.tsx): React entry · `src/main.tsx`
- [Root application](https://github.com/fathy-said/capstone/blob/main/src/App.tsx): React root · `src/App.tsx`
- [Authenticated shell](https://github.com/fathy-said/capstone/blob/main/src/layouts/Main/Index.tsx): main layout · Composes shared header and side navigation. · `src/layouts/Main/Index.tsx`
- [Shared UI primitives](https://github.com/fathy-said/capstone/blob/main/src/components/AppTable/Index.tsx): component library · Tables, forms, dialogs, notifications, loading, and media. · `src/components/AppTable/Index.tsx`
- [Styles & bundled assets](https://github.com/fathy-said/capstone/blob/main/src/assets/css/tailwindcss.css): asset pipeline · Tailwind entry styles and bundled images/icons. · `src/assets/css/tailwindcss.css`

### Routing & Access

- [Route graph](https://github.com/fathy-said/capstone/blob/main/src/router/index.tsx): router · Centralizes application navigation. · `src/router/index.tsx`
- [Domain route aggregators](https://github.com/fathy-said/capstone/blob/main/src/pages/Dashboard/route.tsx): route modules · Partitions dashboard, projects, teams, users, and archive navigation. · `src/pages/Dashboard/route.tsx`
- [Authorized route](https://github.com/fathy-said/capstone/blob/main/src/components/AuthorizedRoute/Index.tsx): access boundary · `src/components/AuthorizedRoute/Index.tsx`
- [Auth state & hooks](https://github.com/fathy-said/capstone/blob/main/src/store/auth.ts): client state · Auth state is exposed to UI through authentication hooks. · `src/store/auth.ts`
- [Permission evaluation](https://github.com/fathy-said/capstone/blob/main/src/hooks/permissions.ts): authorization · `src/hooks/permissions.ts`
- [Authentication screens](https://github.com/fathy-said/capstone/blob/main/src/layouts/Auth/Index.tsx): auth layout · Hosts login and password recovery flows. · `src/layouts/Auth/Index.tsx`

### Role Workflows

- [Project workflows](https://github.com/fathy-said/capstone/blob/main/src/pages/Project/route.tsx): role-specific pages · Admin management, student team formation, and supervisor project work. · `src/pages/Project/route.tsx`
- [Student task board](https://github.com/fathy-said/capstone/blob/main/src/pages/Teams/Student/components/TaskBoard.tsx): team workflow · Board, columns, and task forms support team delivery. · `src/pages/Teams/Student/components/TaskBoard.tsx`
- [Supervisor reports](https://github.com/fathy-said/capstone/blob/main/src/pages/Teams/SuperVisor/Report/Reports.tsx): report workflow · `src/pages/Teams/SuperVisor/Report/Reports.tsx`

### Client Services

- [Archive & notifications](https://github.com/fathy-said/capstone/blob/main/src/hooks/archive.ts): feature hooks · Feature hooks mediate archive and notification behavior. · `src/hooks/archive.ts`
- [API client boundary](https://github.com/fathy-said/capstone/blob/main/src/client/index.ts): HTTP client · Frontend boundary for remote operations; no backend is in this repository. · `src/client/index.ts`
- [State transformations](https://github.com/fathy-said/capstone/blob/main/src/store/utils.ts): shared utilities · Shared store and data transformation utilities. · `src/store/utils.ts`
- **Remote backend API**: external service · Implemented outside this frontend repository.

## Connections

- Vite HTML entry → React bootstrap: loads
- React bootstrap → Root application: renders
- Root application → Route graph: mounts
- Root application → Auth state & hooks: reads auth
- Route graph → Domain route aggregators: aggregates
- Route graph → Authorized route: guards protected routes
- Authorized route → Auth state & hooks: checks session
- Authorized route → Permission evaluation: evaluates access
- Route graph → Authentication screens: routes unauthenticated flows
- Authorized route → Authenticated shell: admits authenticated pages
- Authenticated shell → Shared UI primitives: uses
- Domain route aggregators → Project workflows: projects
- Domain route aggregators → Student task board: teams
- Domain route aggregators → Supervisor reports: reporting
- Project workflows → Shared UI primitives: composes
- Student task board → Shared UI primitives: composes
- Supervisor reports → Shared UI primitives: composes
- Project workflows → API client boundary: remote operations
- Student task board → API client boundary: task operations
- Supervisor reports → API client boundary: report operations
- Archive & notifications → API client boundary: uses
- API client boundary → Remote backend API: requests
- API client boundary → State transformations: normalizes data
- Root application → Styles & bundled assets: applies styles and assets
