# sifat202/reachedu architecture

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

- Interactive diagram: https://gitdiagram.com/sifat202/reachedu
- Repository: https://github.com/sifat202/reachedu

## Overview

ReachEdu is a React learning-platform frontend: visitors browse learning tracks and courses, learners authenticate and view an account dashboard, and teacher-role users can access course-upload and revenue areas. The app mounts shared authentication state and a route table, with a shared Axios client attaching Firebase ID tokens to backend requests. The README describes only the React/Vite template, so product capabilities and routes here are grounded in the source index and sampled router; unsampled page behavior and backend internals are not established.

Main entry points: [`src/Router/Router.jsx`](https://github.com/sifat202/reachedu/blob/main/src/Router/Router.jsx) (Route table), [`src/Api/Api.jsx`](https://github.com/sifat202/reachedu/blob/main/src/Api/Api.jsx) (Authenticated API client), [`src/Auth/AuthProvider.jsx`](https://github.com/sifat202/reachedu/blob/main/src/Auth/AuthProvider.jsx) (Auth state), [`src/main.jsx`](https://github.com/sifat202/reachedu/blob/main/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell and routing"]
  node_entry["React entry<br/>[main.jsx]"]
  node_router["Route table<br/>[Router.jsx]"]
  node_layout["Shared layout<br/>[Homelayout.jsx]"]
  node_navbar["Role navigation<br/>[Navbar.jsx]"]
  node_api["Authenticated API client<br/>[Api.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_authprovider["Auth state<br/>[AuthProvider.jsx]"]
  node_authservice["Firebase auth operations<br/>[AuthService.js]"]
  node_authconfig["Firebase auth client<br/>[firebase.config.js]"]
  node_login["Login and registration<br/>[Login.jsx]"]
  node_teachercheck["Teacher access guard<br/>[TeacherRoute.jsx]"]
end

subgraph group_learning["Learning experience"]
  node_home["Home<br/>[Home.jsx]"]
  node_tracks["Learning tracks<br/>[Tracks.jsx]"]
  node_course["My courses<br/>[Course.jsx]"]
  node_catalog["Course catalog<br/>[MoreCourses.jsx]"]
  node_coursecard["Course card<br/>[CourseCard.jsx]"]
  node_details["Course details<br/>[CourseDetails.jsx]"]
  node_getcourse["Course access<br/>[GetCourse.jsx]"]
  node_dashboard["Learner dashboard<br/>[Dashboard.jsx]"]
end

subgraph group_teaching["Teacher tools"]
  node_upload["Course upload<br/>[Upload.jsx]"]
  node_revenue["Teacher revenue<br/>[Revenue.jsx]"]
end

node_learner(("Learner / teacher"))
node_backend{{"ReachEdu API"}}

node_learner -->|"opens app"| node_entry
node_entry -->|"wraps routes"| node_authprovider
node_entry -->|"mounts router"| node_router
node_router -->|"routes through"| node_layout
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_tracks
node_router -->|"routes to"| node_course
node_router -->|"routes to"| node_catalog
node_router -->|"routes to"| node_details
node_router -->|"routes to"| node_getcourse
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_dashboard
node_router -->|"guards teacher pages"| node_teachercheck
node_router -->|"routes through guard"| node_upload
node_router -->|"routes through guard"| node_revenue
node_layout -->|"renders"| node_navbar
node_navbar -->|"reads auth state"| node_authprovider
node_navbar -->|"fetches user role"| node_api
node_login -->|"calls auth actions"| node_authprovider
node_login -->|"creates student record"| node_api
node_authprovider -->|"delegates auth"| node_authservice
node_authprovider -->|"observes auth state"| node_authconfig
node_authservice -->|"uses auth client"| node_authconfig
node_teachercheck -->|"reads auth state"| node_authprovider
node_teachercheck -->|"checks teacher role"| node_api
node_api -->|"gets ID token"| node_authconfig
node_api -->|"sends HTTP requests"| node_backend
node_catalog -->|"loads courses"| node_api
node_catalog -->|"renders cards"| node_coursecard
node_details -->|"loads course data"| node_api
node_dashboard -->|"loads and updates profile"| node_api
node_dashboard -->|"uses user and logout"| node_authprovider
node_upload -->|"uses course API"| node_api

click node_entry "https://github.com/sifat202/reachedu/blob/main/src/main.jsx"
click node_router "https://github.com/sifat202/reachedu/blob/main/src/Router/Router.jsx"
click node_layout "https://github.com/sifat202/reachedu/blob/main/src/Homelayout/Homelayout.jsx"
click node_navbar "https://github.com/sifat202/reachedu/blob/main/src/Components/Navbar.jsx"
click node_authprovider "https://github.com/sifat202/reachedu/blob/main/src/Auth/AuthProvider.jsx"
click node_authservice "https://github.com/sifat202/reachedu/blob/main/src/Auth/AuthService.js"
click node_authconfig "https://github.com/sifat202/reachedu/blob/main/Firebase/firebase.config.js"
click node_login "https://github.com/sifat202/reachedu/blob/main/src/Authlayout/Login.jsx"
click node_teachercheck "https://github.com/sifat202/reachedu/blob/main/src/Router/RouteProtections/TeacherRoute.jsx"
click node_api "https://github.com/sifat202/reachedu/blob/main/src/Api/Api.jsx"
click node_home "https://github.com/sifat202/reachedu/blob/main/src/Pages/Home.jsx"
click node_tracks "https://github.com/sifat202/reachedu/blob/main/src/Pages/Tracks.jsx"
click node_course "https://github.com/sifat202/reachedu/blob/main/src/Pages/Course.jsx"
click node_catalog "https://github.com/sifat202/reachedu/blob/main/src/Pages/MoreCourses.jsx"
click node_coursecard "https://github.com/sifat202/reachedu/blob/main/src/Components/CourseCard.jsx"
click node_details "https://github.com/sifat202/reachedu/blob/main/src/Pages/CourseDetails.jsx"
click node_getcourse "https://github.com/sifat202/reachedu/blob/main/src/Components/GetCourse.jsx"
click node_dashboard "https://github.com/sifat202/reachedu/blob/main/src/Pages/Dashboard.jsx"
click node_upload "https://github.com/sifat202/reachedu/blob/main/src/Pages/Upload.jsx"
click node_revenue "https://github.com/sifat202/reachedu/blob/main/src/Pages/Revenue.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_entry,node_router,node_layout,node_navbar,node_api toneBlue
class node_authprovider,node_authservice,node_authconfig,node_login,node_teachercheck toneAmber
class node_home,node_tracks,node_course,node_catalog,node_coursecard,node_details,node_getcourse,node_dashboard,node_backend toneMint
class node_upload,node_revenue toneRose
class node_learner toneIndigo
```

## Components

### App shell and routing

- [React entry](https://github.com/sifat202/reachedu/blob/main/src/main.jsx): `src/main.jsx`
- [Route table](https://github.com/sifat202/reachedu/blob/main/src/Router/Router.jsx): `src/Router/Router.jsx`
- [Shared layout](https://github.com/sifat202/reachedu/blob/main/src/Homelayout/Homelayout.jsx): `src/Homelayout/Homelayout.jsx`
- [Role navigation](https://github.com/sifat202/reachedu/blob/main/src/Components/Navbar.jsx): `src/Components/Navbar.jsx`
- [Authenticated API client](https://github.com/sifat202/reachedu/blob/main/src/Api/Api.jsx): `src/Api/Api.jsx`

### Identity and access

- [Auth state](https://github.com/sifat202/reachedu/blob/main/src/Auth/AuthProvider.jsx): `src/Auth/AuthProvider.jsx`
- [Firebase auth operations](https://github.com/sifat202/reachedu/blob/main/src/Auth/AuthService.js): `src/Auth/AuthService.js`
- [Firebase auth client](https://github.com/sifat202/reachedu/blob/main/Firebase/firebase.config.js): `Firebase/firebase.config.js`
- [Login and registration](https://github.com/sifat202/reachedu/blob/main/src/Authlayout/Login.jsx): `src/Authlayout/Login.jsx`
- [Teacher access guard](https://github.com/sifat202/reachedu/blob/main/src/Router/RouteProtections/TeacherRoute.jsx): `src/Router/RouteProtections/TeacherRoute.jsx`

### Learning experience

- [Home](https://github.com/sifat202/reachedu/blob/main/src/Pages/Home.jsx): `src/Pages/Home.jsx`
- [Learning tracks](https://github.com/sifat202/reachedu/blob/main/src/Pages/Tracks.jsx): `src/Pages/Tracks.jsx`
- [My courses](https://github.com/sifat202/reachedu/blob/main/src/Pages/Course.jsx): `src/Pages/Course.jsx`
- [Course catalog](https://github.com/sifat202/reachedu/blob/main/src/Pages/MoreCourses.jsx): `src/Pages/MoreCourses.jsx`
- [Course card](https://github.com/sifat202/reachedu/blob/main/src/Components/CourseCard.jsx): `src/Components/CourseCard.jsx`
- [Course details](https://github.com/sifat202/reachedu/blob/main/src/Pages/CourseDetails.jsx): `src/Pages/CourseDetails.jsx`
- [Course access](https://github.com/sifat202/reachedu/blob/main/src/Components/GetCourse.jsx): `src/Components/GetCourse.jsx`
- [Learner dashboard](https://github.com/sifat202/reachedu/blob/main/src/Pages/Dashboard.jsx): `src/Pages/Dashboard.jsx`

### Teacher tools

- [Course upload](https://github.com/sifat202/reachedu/blob/main/src/Pages/Upload.jsx): `src/Pages/Upload.jsx`
- [Teacher revenue](https://github.com/sifat202/reachedu/blob/main/src/Pages/Revenue.jsx): `src/Pages/Revenue.jsx`

### Other components

- **Learner / teacher**
- **ReachEdu API**

## Connections

- Learner / teacher → React entry: opens app (evidence: `src/main.jsx`)
- React entry → Auth state: wraps routes (evidence: `src/main.jsx`)
- React entry → Route table: mounts router (evidence: `src/main.jsx`)
- Route table → Shared layout: routes through (evidence: `src/Router/Router.jsx`)
- Route table → Home: routes to (evidence: `src/Router/Router.jsx`)
- Route table → Learning tracks: routes to (evidence: `src/Router/Router.jsx`)
- Route table → My courses: routes to (evidence: `src/Router/Router.jsx`)
- Route table → Course catalog: routes to (evidence: `src/Router/Router.jsx`)
- Route table → Course details: routes to (evidence: `src/Router/Router.jsx`)
- Route table → Course access: routes to (evidence: `src/Router/Router.jsx`)
- Route table → Login and registration: routes to (evidence: `src/Router/Router.jsx`)
- Route table → Learner dashboard: routes to (evidence: `src/Router/Router.jsx`)
- Route table → Teacher access guard: guards teacher pages (evidence: `src/Router/Router.jsx`)
- Route table → Course upload: routes through guard (evidence: `src/Router/Router.jsx`)
- Route table → Teacher revenue: routes through guard (evidence: `src/Router/Router.jsx`)
- Shared layout → Role navigation: renders (evidence: `src/Homelayout/Homelayout.jsx`)
- Role navigation → Auth state: reads auth state (evidence: `src/Components/Navbar.jsx`)
- Role navigation → Authenticated API client: fetches user role (evidence: `src/Components/Navbar.jsx`)
- Login and registration → Auth state: calls auth actions (evidence: `src/Authlayout/Login.jsx`)
- Login and registration → Authenticated API client: creates student record (evidence: `src/Authlayout/Login.jsx`)
- Auth state → Firebase auth operations: delegates auth (evidence: `src/Auth/AuthProvider.jsx`)
- Auth state → Firebase auth client: observes auth state (evidence: `src/Auth/AuthProvider.jsx`)
- Firebase auth operations → Firebase auth client: uses auth client (evidence: `src/Auth/AuthService.js`)
- Teacher access guard → Auth state: reads auth state (evidence: `src/Router/RouteProtections/TeacherRoute.jsx`)
- Teacher access guard → Authenticated API client: checks teacher role (evidence: `src/Router/RouteProtections/TeacherRoute.jsx`)
- Authenticated API client → Firebase auth client: gets ID token (evidence: `src/Api/Api.jsx`)
- Authenticated API client → ReachEdu API: sends HTTP requests (evidence: `src/Api/Api.jsx`)
- Course catalog → Authenticated API client: loads courses (evidence: `src/Pages/MoreCourses.jsx`)
- Course catalog → Course card: renders cards (evidence: `src/Pages/MoreCourses.jsx`)
- Course details → Authenticated API client: loads course data (evidence: `src/Pages/CourseDetails.jsx`)
- Learner dashboard → Authenticated API client: loads and updates profile (evidence: `src/Pages/Dashboard.jsx`)
- Learner dashboard → Auth state: uses user and logout (evidence: `src/Pages/Dashboard.jsx`)
- Course upload → Authenticated API client: uses course API (evidence: `src/Pages/Upload.jsx`)
