# ta3allam/ta3 architecture

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

- Interactive diagram: https://gitdiagram.com/ta3allam/ta3
- Repository: https://github.com/ta3allam/ta3

## Overview

Ta3 is an Arabic learning marketplace and creator community. The main user journey is sign-in, role-based access to a dashboard, then learning through courses and community or discovering and buying courses; creators and administrators have distinct management and reporting workflows. The graph also preserves documented cohort events, regional payments, mobile/offline support, and health diagnostics. Source excerpts show routing and selected auth, course, and event-store relationships; other feature links rely on README descriptions, so unsampled internal calls are not inferred.

Main entry points: [`src/contexts/AuthContext.tsx`](https://github.com/ta3allam/ta3/blob/main/src/contexts/AuthContext.tsx) (Identity and roles), [`src/pages/marketplace/Marketplace.tsx`](https://github.com/ta3allam/ta3/blob/main/src/pages/marketplace/Marketplace.tsx) (Course marketplace), [`src/App.tsx`](https://github.com/ta3allam/ta3/blob/main/src/App.tsx) (Role routing), [`src/contexts/CourseContext.tsx`](https://github.com/ta3allam/ta3/blob/main/src/contexts/CourseContext.tsx) (Course state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shell"]
  node_login["Sign-in<br/>[Login.tsx]"]
  node_auth["Identity and roles<br/>[AuthContext.tsx]"]
  node_routes["Role routing<br/>[App.tsx]"]
  node_guard["Access guard<br/>[RequireAuth.tsx]"]
  node_shell["Dashboard shell"]
  node_profile["Profile and certificates"]
  node_primitives["Shared UI primitives"]
  node_user_types["User and certificate types<br/>[user.ts]"]
end

subgraph group_learning["Learning and community"]
  node_course_data["Course state<br/>[CourseContext.tsx]"]
  node_course_engine["Course data engine<br/>[MockDataEngine.ts]"]
  node_classroom["Course classroom<br/>[Courses.tsx]"]
  node_groups["Course groups<br/>[Groups.tsx]"]
  node_community["Community feed<br/>[CommunityFeed.tsx]"]
  node_cohorts["Cohort events<br/>[CohortEvents.tsx]"]
  node_event_stage["Live event stage"]
end

subgraph group_commerce["Marketplace and finance"]
  node_marketplace["Course marketplace<br/>[Marketplace.tsx]"]
  node_affiliate["Affiliate catalog"]
  node_checkout["Checkout and receipts<br/>[CheckoutDialog.tsx]"]
  node_payments["Payment verification"]
end

subgraph group_operations["Creator and admin operations"]
  node_creator["Creator studio"]
  node_analytics["Creator analytics"]
  node_metrics["Metrics engine"]
  node_admin["Admin governance<br/>[AdminDashboard.tsx]"]
end

subgraph group_platform["Resilience and diagnostics"]
  node_mobile["Mobile and offline"]
  node_health["System diagnostics"]
end

node_learner(("Platform users"))

node_learner -->|"starts"| node_login
node_login -->|"authenticates"| node_auth
node_auth -->|"sets role"| node_routes
node_routes -->|"routes through"| node_guard
node_guard -->|"checks session"| node_auth
node_routes -.->|"opens dashboards"| node_shell
node_auth -->|"supplies identity"| node_profile
node_auth -->|"uses role types"| node_user_types
node_classroom -.->|"uses course state"| node_course_data
node_groups -->|"reads course state"| node_course_data
node_course_data -.->|"loads course data"| node_course_engine
node_learner -.->|"takes lessons"| node_classroom
node_learner -->|"joins discussions"| node_community
node_learner -->|"views events"| node_cohorts
node_cohorts -.->|"opens live stage"| node_event_stage
node_learner -->|"discovers courses"| node_marketplace
node_marketplace -.->|"offers affiliate catalog"| node_affiliate
node_marketplace -.->|"starts checkout"| node_checkout
node_checkout -->|"submits receipt"| node_payments
node_creator -.->|"reviews performance"| node_analytics
node_analytics -.->|"derives reports"| node_metrics
node_admin -->|"verifies payments"| node_payments
node_creator -->|"publishes courses"| node_marketplace
node_learner -->|"uses offline mode"| node_mobile
node_admin -.->|"checks platform health"| node_health
node_shell -.->|"renders shared UI"| node_primitives
node_profile -->|"uses certificate types"| node_user_types

click node_login "https://github.com/ta3allam/ta3/blob/main/src/pages/Login.tsx"
click node_auth "https://github.com/ta3allam/ta3/blob/main/src/contexts/AuthContext.tsx"
click node_routes "https://github.com/ta3allam/ta3/blob/main/src/App.tsx"
click node_guard "https://github.com/ta3allam/ta3/blob/main/src/components/layout/RequireAuth.tsx"
click node_shell "https://github.com/ta3allam/ta3/blob/main/src/components/layout/DashboardLayout.tsx"
click node_profile "https://github.com/ta3allam/ta3/blob/main/src/pages/profile/UserProfilePage.tsx"
click node_course_data "https://github.com/ta3allam/ta3/blob/main/src/contexts/CourseContext.tsx"
click node_course_engine "https://github.com/ta3allam/ta3/blob/main/src/lib/MockDataEngine.ts"
click node_classroom "https://github.com/ta3allam/ta3/blob/main/src/pages/courses/Courses.tsx"
click node_groups "https://github.com/ta3allam/ta3/blob/main/src/pages/courses/Groups.tsx"
click node_community "https://github.com/ta3allam/ta3/blob/main/src/pages/community/CommunityFeed.tsx"
click node_cohorts "https://github.com/ta3allam/ta3/blob/main/src/pages/cohorts/CohortEvents.tsx"
click node_event_stage "https://github.com/ta3allam/ta3/blob/main/src/components/cohorts/LiveSessionStageModal.tsx"
click node_marketplace "https://github.com/ta3allam/ta3/blob/main/src/pages/marketplace/Marketplace.tsx"
click node_affiliate "https://github.com/ta3allam/ta3/blob/main/src/data/affiliateCourses.ts"
click node_checkout "https://github.com/ta3allam/ta3/blob/main/src/components/marketplace/CheckoutDialog.tsx"
click node_payments "https://github.com/ta3allam/ta3/blob/main/src/components/admin/PaymentVerificationQueue.tsx"
click node_creator "https://github.com/ta3allam/ta3/blob/main/src/pages/creator/CreatorDashboard.tsx"
click node_analytics "https://github.com/ta3allam/ta3/blob/main/src/pages/analytics/CreatorAnalytics.tsx"
click node_metrics "https://github.com/ta3allam/ta3/blob/main/src/lib/analytics/creatorMetricsEngine.ts"
click node_admin "https://github.com/ta3allam/ta3/blob/main/src/pages/admin/AdminDashboard.tsx"
click node_mobile "https://github.com/ta3allam/ta3/blob/main/src/components/common/MobileOfflineBanner.tsx"
click node_health "https://github.com/ta3allam/ta3/blob/main/src/lib/diagnostics/systemHealthEngine.ts"
click node_primitives "https://github.com/ta3allam/ta3/tree/main/src/components/ui"
click node_user_types "https://github.com/ta3allam/ta3/blob/main/src/types/user.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_login,node_auth,node_routes,node_guard,node_shell,node_profile,node_primitives,node_user_types,node_learner toneBlue
class node_course_data,node_course_engine,node_classroom,node_groups,node_community,node_cohorts,node_event_stage toneAmber
class node_marketplace,node_affiliate,node_checkout,node_payments toneMint
class node_creator,node_analytics,node_metrics,node_admin toneRose
class node_mobile,node_health toneIndigo
```

## Components

### Access and shell

- [Sign-in](https://github.com/ta3allam/ta3/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Identity and roles](https://github.com/ta3allam/ta3/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [Role routing](https://github.com/ta3allam/ta3/blob/main/src/App.tsx): `src/App.tsx`
- [Access guard](https://github.com/ta3allam/ta3/blob/main/src/components/layout/RequireAuth.tsx): `src/components/layout/RequireAuth.tsx`
- [Dashboard shell](https://github.com/ta3allam/ta3/blob/main/src/components/layout/DashboardLayout.tsx): `src/components/layout/DashboardLayout.tsx`
- [Profile and certificates](https://github.com/ta3allam/ta3/blob/main/src/pages/profile/UserProfilePage.tsx): `src/pages/profile/UserProfilePage.tsx`
- [Shared UI primitives](https://github.com/ta3allam/ta3/tree/main/src/components/ui): `src/components/ui`
- [User and certificate types](https://github.com/ta3allam/ta3/blob/main/src/types/user.ts): `src/types/user.ts`

### Learning and community

- [Course state](https://github.com/ta3allam/ta3/blob/main/src/contexts/CourseContext.tsx): `src/contexts/CourseContext.tsx`
- [Course data engine](https://github.com/ta3allam/ta3/blob/main/src/lib/MockDataEngine.ts): `src/lib/MockDataEngine.ts`
- [Course classroom](https://github.com/ta3allam/ta3/blob/main/src/pages/courses/Courses.tsx): `src/pages/courses/Courses.tsx`
- [Course groups](https://github.com/ta3allam/ta3/blob/main/src/pages/courses/Groups.tsx): `src/pages/courses/Groups.tsx`
- [Community feed](https://github.com/ta3allam/ta3/blob/main/src/pages/community/CommunityFeed.tsx): `src/pages/community/CommunityFeed.tsx`
- [Cohort events](https://github.com/ta3allam/ta3/blob/main/src/pages/cohorts/CohortEvents.tsx): `src/pages/cohorts/CohortEvents.tsx`
- [Live event stage](https://github.com/ta3allam/ta3/blob/main/src/components/cohorts/LiveSessionStageModal.tsx): `src/components/cohorts/LiveSessionStageModal.tsx`

### Marketplace and finance

- [Course marketplace](https://github.com/ta3allam/ta3/blob/main/src/pages/marketplace/Marketplace.tsx): `src/pages/marketplace/Marketplace.tsx`
- [Affiliate catalog](https://github.com/ta3allam/ta3/blob/main/src/data/affiliateCourses.ts): `src/data/affiliateCourses.ts`
- [Checkout and receipts](https://github.com/ta3allam/ta3/blob/main/src/components/marketplace/CheckoutDialog.tsx): `src/components/marketplace/CheckoutDialog.tsx`
- [Payment verification](https://github.com/ta3allam/ta3/blob/main/src/components/admin/PaymentVerificationQueue.tsx): `src/components/admin/PaymentVerificationQueue.tsx`

### Creator and admin operations

- [Creator studio](https://github.com/ta3allam/ta3/blob/main/src/pages/creator/CreatorDashboard.tsx): `src/pages/creator/CreatorDashboard.tsx`
- [Creator analytics](https://github.com/ta3allam/ta3/blob/main/src/pages/analytics/CreatorAnalytics.tsx): `src/pages/analytics/CreatorAnalytics.tsx`
- [Metrics engine](https://github.com/ta3allam/ta3/blob/main/src/lib/analytics/creatorMetricsEngine.ts): `src/lib/analytics/creatorMetricsEngine.ts`
- [Admin governance](https://github.com/ta3allam/ta3/blob/main/src/pages/admin/AdminDashboard.tsx): `src/pages/admin/AdminDashboard.tsx`

### Resilience and diagnostics

- [Mobile and offline](https://github.com/ta3allam/ta3/blob/main/src/components/common/MobileOfflineBanner.tsx): `src/components/common/MobileOfflineBanner.tsx`
- [System diagnostics](https://github.com/ta3allam/ta3/blob/main/src/lib/diagnostics/systemHealthEngine.ts): `src/lib/diagnostics/systemHealthEngine.ts`

### Other components

- **Platform users**

## Connections

- Platform users → Sign-in: starts
- Sign-in → Identity and roles: authenticates (evidence: `src/pages/Login.tsx`)
- Identity and roles → Role routing: sets role (evidence: `src/App.tsx`)
- Role routing → Access guard: routes through (evidence: `src/App.tsx`)
- Access guard → Identity and roles: checks session (evidence: `src/components/layout/RequireAuth.tsx`)
- Role routing → Dashboard shell: opens dashboards
- Identity and roles → Profile and certificates: supplies identity (evidence: `src/pages/profile/UserProfilePage.tsx`)
- Identity and roles → User and certificate types: uses role types (evidence: `src/contexts/AuthContext.tsx`)
- Course classroom → Course state: uses course state
- Course groups → Course state: reads course state (evidence: `src/pages/courses/Groups.tsx`)
- Course state → Course data engine: loads course data (evidence: `src/contexts/CourseContext.tsx`)
- Platform users → Course classroom: takes lessons
- Platform users → Community feed: joins discussions
- Platform users → Cohort events: views events
- Cohort events → Live event stage: opens live stage
- Platform users → Course marketplace: discovers courses
- Course marketplace → Affiliate catalog: offers affiliate catalog
- Course marketplace → Checkout and receipts: starts checkout
- Checkout and receipts → Payment verification: submits receipt
- Creator studio → Creator analytics: reviews performance
- Creator analytics → Metrics engine: derives reports
- Admin governance → Payment verification: verifies payments
- Creator studio → Course marketplace: publishes courses
- Platform users → Mobile and offline: uses offline mode
- Admin governance → System diagnostics: checks platform health
- Dashboard shell → Shared UI primitives: renders shared UI (evidence: `src/components/layout/DashboardLayout.tsx`)
- Profile and certificates → User and certificate types: uses certificate types (evidence: `src/pages/profile/UserProfilePage.tsx`)
