# ashik-khan-atul/learning-zone-client architecture

> Architecture diagram of the GitHub repository ashik-khan-atul/learning-zone-client, 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/ashik-khan-atul/learning-zone-client
- Repository: https://github.com/ashik-khan-atul/learning-zone-client

## Overview

Learning Zone is a role-based coaching-management frontend. Users register or sign in, apply for student or teacher status, and admins review applications; role-aware dashboard routes then expose user management and routine workflows. The product also offers public learning activities, including a timed math game with a leaderboard, quizzes, and mini tools. The graph combines the documented capabilities with sampled routing, auth, role-check, and routine code; backend behavior is shown only where documented or directly referenced.

Main entry points: [`src/Router/router.jsx`](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Router/router.jsx) (Route registry), [`src/Hooks/useAuth.jsx`](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/useAuth.jsx) (Auth hook), [`src/Hooks/useAxiosSecure.jsx`](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/useAxiosSecure.jsx) (Authenticated API client), [`src/Pages/Home/Home.jsx`](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Pages/Home/Home.jsx) (Home and public pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation and access"]
  node_router["Route registry<br/>[router.jsx]"]
  node_dashboard["Dashboard shell"]
  node_guards["Role route guards"]
end

subgraph group_identity["Identity and roles"]
  node_auth["Auth provider<br/>[AuthProvider.jsx]"]
  node_firebase["Firebase auth<br/>[firebase.init.js]"]
  node_authhook["Auth hook<br/>[useAuth.jsx]"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_social["Google sign-in<br/>[SocialLogin.jsx]"]
  node_role["Role lookup<br/>[useUserRole.jsx]"]
  node_secureclient["Authenticated API client<br/>[useAxiosSecure.jsx]"]
  node_publicclient["Public API client"]
end

subgraph group_coaching["Coaching management"]
  node_studentapply["Student application<br/>[BecomeStudent.jsx]"]
  node_teacherapply["Teacher application<br/>[BecomeTeacher.jsx]"]
  node_applications["Application review"]
  node_members["Member management"]
  node_routinewrite["Routine manager<br/>[RoutineManager.jsx]"]
  node_routineview["Routine views"]
  node_profile["Profile<br/>[Profile.jsx]"]
end

subgraph group_learning["Learning activities"]
  node_math["Math challenge<br/>[MathChallenge.jsx]"]
  node_leaderboard["Math leaderboard"]
  node_quiz["Knowledge quiz<br/>[QuizSection.jsx]"]
  node_tools["Mini learning tools"]
end

subgraph group_site["Public site"]
  node_home["Home and public pages<br/>[Home.jsx]"]
  node_sitecontent["About, services, contact"]
end

node_visitor(("Visitor or user"))
node_backend["Learning Zone backend"]

node_visitor -->|"opens pages"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_sitecontent
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_dashboard
node_router -->|"routes to"| node_studentapply
node_router -->|"routes to"| node_teacherapply
node_router -->|"wraps protected pages"| node_guards
node_dashboard -->|"checks role"| node_role
node_guards -->|"checks access"| node_role
node_role -->|"requests role"| node_secureclient
node_secureclient -->|"gets credentials"| node_authhook
node_authhook -->|"reads context"| node_auth
node_auth -->|"uses Firebase auth"| node_firebase
node_login -->|"uses auth"| node_authhook
node_login -->|"offers Google sign-in"| node_social
node_social -->|"uses auth"| node_authhook
node_studentapply -->|"uses auth"| node_authhook
node_teacherapply -->|"uses auth"| node_authhook
node_studentapply -->|"submits application"| node_publicclient
node_teacherapply -->|"submits application"| node_publicclient
node_applications -->|"reviews applications"| node_secureclient
node_members -->|"manages members"| node_secureclient
node_routinewrite -->|"saves routines"| node_secureclient
node_routineview -->|"loads routines"| node_secureclient
node_routinewrite -->|"creates routine"| node_backend
node_applications -->|"updates approval status"| node_backend
node_members -->|"activates or deactivates"| node_backend
node_routineview -->|"reads routines"| node_backend
node_profile -->|"loads profile data"| node_publicclient
node_home -->|"features game"| node_math
node_home -->|"features quiz"| node_quiz
node_home -->|"features tools"| node_tools
node_math -->|"records scores"| node_leaderboard
node_leaderboard -->|"loads leaderboard"| node_publicclient
node_math -->|"persists scores"| node_backend

click node_router "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Router/router.jsx"
click node_dashboard "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Layout/DashboardLayout/DashboardLayout.jsx"
click node_guards "https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Routes"
click node_auth "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Provider/AuthProvider.jsx"
click node_firebase "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Firebase/firebase.init.js"
click node_authhook "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/useAuth.jsx"
click node_login "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/Login/Login.jsx"
click node_social "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Shared/SocialLogin/SocialLogin.jsx"
click node_role "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/useUserRole.jsx"
click node_secureclient "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/useAxiosSecure.jsx"
click node_publicclient "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/userAxiosPublic.jsx"
click node_studentapply "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/BecomeStudent/BecomeStudent.jsx"
click node_teacherapply "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/BecomeTeacher/BecomeTeacher.jsx"
click node_applications "https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Pages/DashboardPages/AdminDashPage"
click node_members "https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Pages/DashboardPages/AdminDashPage"
click node_routinewrite "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Pages/DashboardPages/Shared/Routine/RoutineManager.jsx"
click node_routineview "https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Pages/DashboardPages/Shared/Routine"
click node_profile "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Pages/DashboardPages/Profile/Profile.jsx"
click node_home "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Pages/Home/Home.jsx"
click node_sitecontent "https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Pages"
click node_math "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/MathChallenge/MathChallenge.jsx"
click node_leaderboard "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/MathGameLeaderBoard/MathGameLeaderBoard.jsx"
click node_quiz "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/QuizSection/QuizSection.jsx"
click node_tools "https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/MiniLearningTools/MiniLearningTools.jsx"

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_router,node_dashboard,node_guards,node_visitor toneBlue
class node_auth,node_firebase,node_authhook,node_login,node_social,node_role,node_secureclient,node_publicclient toneAmber
class node_studentapply,node_teacherapply,node_applications,node_members,node_routinewrite,node_routineview,node_profile toneMint
class node_math,node_leaderboard,node_quiz,node_tools toneRose
class node_home,node_sitecontent,node_backend toneIndigo
```

## Components

### Navigation and access

- [Route registry](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Router/router.jsx): `src/Router/router.jsx`
- [Dashboard shell](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Layout/DashboardLayout/DashboardLayout.jsx): `src/Layout/DashboardLayout/DashboardLayout.jsx`
- [Role route guards](https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Routes): `src/Routes`

### Identity and roles

- [Auth provider](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Provider/AuthProvider.jsx): `src/Provider/AuthProvider.jsx`
- [Firebase auth](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Firebase/firebase.init.js): `src/Firebase/firebase.init.js`
- [Auth hook](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/useAuth.jsx): `src/Hooks/useAuth.jsx`
- [Login and registration](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/Login/Login.jsx): `src/Components/Login/Login.jsx`
- [Google sign-in](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Shared/SocialLogin/SocialLogin.jsx): `src/Shared/SocialLogin/SocialLogin.jsx`
- [Role lookup](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/useUserRole.jsx): `src/Hooks/useUserRole.jsx`
- [Authenticated API client](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/useAxiosSecure.jsx): `src/Hooks/useAxiosSecure.jsx`
- [Public API client](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Hooks/userAxiosPublic.jsx): `src/Hooks/userAxiosPublic.jsx`

### Coaching management

- [Student application](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/BecomeStudent/BecomeStudent.jsx): `src/Components/BecomeStudent/BecomeStudent.jsx`
- [Teacher application](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/BecomeTeacher/BecomeTeacher.jsx): `src/Components/BecomeTeacher/BecomeTeacher.jsx`
- [Application review](https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Pages/DashboardPages/AdminDashPage): `src/Pages/DashboardPages/AdminDashPage`
- [Member management](https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Pages/DashboardPages/AdminDashPage): `src/Pages/DashboardPages/AdminDashPage`
- [Routine manager](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Pages/DashboardPages/Shared/Routine/RoutineManager.jsx): `src/Pages/DashboardPages/Shared/Routine/RoutineManager.jsx`
- [Routine views](https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Pages/DashboardPages/Shared/Routine): `src/Pages/DashboardPages/Shared/Routine`
- [Profile](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Pages/DashboardPages/Profile/Profile.jsx): `src/Pages/DashboardPages/Profile/Profile.jsx`

### Learning activities

- [Math challenge](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/MathChallenge/MathChallenge.jsx): `src/Components/MathChallenge/MathChallenge.jsx`
- [Math leaderboard](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/MathGameLeaderBoard/MathGameLeaderBoard.jsx): `src/Components/MathGameLeaderBoard/MathGameLeaderBoard.jsx`
- [Knowledge quiz](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/QuizSection/QuizSection.jsx): `src/Components/QuizSection/QuizSection.jsx`
- [Mini learning tools](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Components/MiniLearningTools/MiniLearningTools.jsx): `src/Components/MiniLearningTools/MiniLearningTools.jsx`

### Public site

- [Home and public pages](https://github.com/ashik-khan-atul/learning-zone-client/blob/main/src/Pages/Home/Home.jsx): `src/Pages/Home/Home.jsx`
- [About, services, contact](https://github.com/ashik-khan-atul/learning-zone-client/tree/main/src/Pages): `src/Pages`

### Other components

- **Visitor or user**
- **Learning Zone backend**

## Connections

- Visitor or user → Route registry: opens pages (evidence: `src/Router/router.jsx`)
- Route registry → Home and public pages: routes to (evidence: `src/Router/router.jsx`)
- Route registry → About, services, contact: routes to (evidence: `src/Router/router.jsx`)
- Route registry → Login and registration: routes to (evidence: `src/Router/router.jsx`)
- Route registry → Dashboard shell: routes to (evidence: `src/Router/router.jsx`)
- Route registry → Student application: routes to (evidence: `src/Router/router.jsx`)
- Route registry → Teacher application: routes to (evidence: `src/Router/router.jsx`)
- Route registry → Role route guards: wraps protected pages (evidence: `src/Router/router.jsx`)
- Dashboard shell → Role lookup: checks role (evidence: `src/Hooks/useUserRole.jsx`)
- Role route guards → Role lookup: checks access (evidence: `src/Routes/AdminRoutes.jsx`)
- Role lookup → Authenticated API client: requests role (evidence: `src/Hooks/useUserRole.jsx`)
- Authenticated API client → Auth hook: gets credentials (evidence: `src/Hooks/useAxiosSecure.jsx`)
- Auth hook → Auth provider: reads context (evidence: `src/Hooks/useAuth.jsx`)
- Auth provider → Firebase auth: uses Firebase auth (evidence: `src/Provider/AuthProvider.jsx`)
- Login and registration → Auth hook: uses auth (evidence: `src/Components/Login/Login.jsx`)
- Login and registration → Google sign-in: offers Google sign-in (evidence: `src/Components/Login/Login.jsx`)
- Google sign-in → Auth hook: uses auth (evidence: `src/Shared/SocialLogin/SocialLogin.jsx`)
- Student application → Auth hook: uses auth (evidence: `src/Components/BecomeStudent/BecomeStudent.jsx`)
- Teacher application → Auth hook: uses auth (evidence: `src/Components/BecomeTeacher/BecomeTeacher.jsx`)
- Student application → Public API client: submits application (evidence: `src/Components/BecomeStudent/BecomeStudent.jsx`)
- Teacher application → Public API client: submits application (evidence: `src/Components/BecomeTeacher/BecomeTeacher.jsx`)
- Application review → Authenticated API client: reviews applications (evidence: `src/Pages/DashboardPages/AdminDashPage/AppliedStudent/AppliedStudent.jsx`)
- Member management → Authenticated API client: manages members (evidence: `src/Pages/DashboardPages/AdminDashPage/AllStudent/AllStudent.jsx`)
- Routine manager → Authenticated API client: saves routines (evidence: `src/Pages/DashboardPages/Shared/Routine/RoutineManager.jsx`)
- Routine views → Authenticated API client: loads routines (evidence: `src/Pages/DashboardPages/Shared/Routine/ShowRoutine.jsx`)
- Routine manager → Learning Zone backend: creates routine (evidence: `src/Pages/DashboardPages/Shared/Routine/RoutineManager.jsx`)
- Application review → Learning Zone backend: updates approval status (evidence: `README.md`)
- Member management → Learning Zone backend: activates or deactivates (evidence: `README.md`)
- Routine views → Learning Zone backend: reads routines (evidence: `README.md`)
- Profile → Public API client: loads profile data (evidence: `src/Pages/DashboardPages/Profile/Profile.jsx`)
- Home and public pages → Math challenge: features game (evidence: `README.md`)
- Home and public pages → Knowledge quiz: features quiz (evidence: `README.md`)
- Home and public pages → Mini learning tools: features tools (evidence: `README.md`)
- Math challenge → Math leaderboard: records scores (evidence: `README.md`)
- Math leaderboard → Public API client: loads leaderboard (evidence: `src/Components/MathGameLeaderBoard/MathGameLeaderBoard.jsx`)
- Math challenge → Learning Zone backend: persists scores (evidence: `README.md`)
