# afra012/tutorsphere architecture

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

- Interactive diagram: https://gitdiagram.com/afra012/tutorsphere
- Repository: https://github.com/afra012/tutorsphere
- Video tour (about a minute): https://gitdiagram.com/afra012/tutorsphere/video

## Overview

TutorSphere is a two-sided tutor marketplace: students discover tutors or post requirements, tutors advertise services or respond to requirements, and both sides manage direct hire requests. The React application routes users to role-specific workflows and exchanges REST requests with Laravel, which applies business rules and persists marketplace data. Authentication, reviews, chat, subscriptions, location, and administration are additional product branches documented in the README. Backend wiring beyond the sampled controllers is represented only where documented; several feature-to-endpoint links use enclosing controller paths because their implementations were not sampled.

Main entry points: [`frontend/src/api/axios.js`](https://github.com/afra012/tutorsphere/blob/main/frontend/src/api/axios.js) (API client), [`backend/config/database.php`](https://github.com/afra012/tutorsphere/blob/main/backend/config/database.php) (Application database), [`frontend/src/App.jsx`](https://github.com/afra012/tutorsphere/blob/main/frontend/src/App.jsx) (Routes and app), [`frontend/src/pages/StudentDashboard`](https://github.com/afra012/tutorsphere/tree/main/frontend/src/pages/StudentDashboard) (Student dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React experience"]
  node_app["Routes and app<br/>[App.jsx]"]
  node_api_client["API client<br/>[axios.js]"]
  node_student_ui["Student dashboard"]
  node_tutor_ui["Tutor dashboard"]
  node_auth_ui["Sign-in and register"]
  node_chat_ui["Chat interface<br/>[Chat.jsx]"]
  node_review_ui["Review interface<br/>[Review.jsx]"]
  node_admin_ui["Admin dashboard"]
end

subgraph group_marketplace["Tutor marketplace"]
  node_profile["Profiles and tutor search"]
  node_tutor_posts["Tutor service posts"]
  node_requirements["Student requirements"]
  node_hire_requests["Hire requests"]
  node_reviews["Ratings and reviews"]
end

subgraph group_operations["Platform operations"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_chat["Chat messages"]
  node_subscriptions["Subscriptions"]
  node_admin_api["Administration"]
  node_location["Location service"]
end

subgraph group_persistence["Backend and data"]
  node_database[("Application database<br/>[database.php]")]
end

node_student(("Student"))
node_tutor(("Tutor"))
node_admin(("Administrator"))
node_google["Google sign-in"]

node_student -->|"uses"| node_app
node_tutor -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"routes to"| node_student_ui
node_app -->|"routes to"| node_tutor_ui
node_app -->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_chat_ui
node_app -->|"routes to"| node_admin_ui
node_student_ui -->|"requests data"| node_api_client
node_tutor_ui -->|"requests data"| node_api_client
node_auth_ui -->|"requests auth"| node_api_client
node_chat_ui -->|"requests messages"| node_api_client
node_review_ui -->|"requests reviews"| node_api_client
node_admin_ui -->|"requests admin"| node_api_client
node_student_ui -->|"opens reviews"| node_review_ui
node_api_client -->|"REST requests"| node_profile
node_api_client -->|"REST requests"| node_tutor_posts
node_api_client -->|"REST requests"| node_requirements
node_api_client -->|"REST requests"| node_hire_requests
node_api_client -->|"REST requests"| node_reviews
node_api_client -->|"REST requests"| node_auth
node_api_client -->|"REST requests"| node_chat
node_api_client -->|"REST requests"| node_subscriptions
node_api_client -->|"REST requests"| node_admin_api
node_auth_ui -.->|"OAuth callback"| node_google
node_profile -->|"reads and writes"| node_database
node_tutor_posts -->|"reads and writes"| node_database
node_requirements -->|"reads and writes"| node_database
node_hire_requests -->|"reads and writes"| node_database
node_reviews -->|"reads and writes"| node_database
node_auth -->|"reads and writes"| node_database
node_chat -->|"reads and writes"| node_database
node_subscriptions -->|"reads and writes"| node_database
node_admin_api -->|"reads and writes"| node_database
node_location -->|"creates and updates"| node_database

click node_app "https://github.com/afra012/tutorsphere/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/afra012/tutorsphere/blob/main/frontend/src/api/axios.js"
click node_student_ui "https://github.com/afra012/tutorsphere/tree/main/frontend/src/pages/StudentDashboard"
click node_tutor_ui "https://github.com/afra012/tutorsphere/tree/main/frontend/src/pages/TeacherDashboard"
click node_auth_ui "https://github.com/afra012/tutorsphere/tree/main/frontend/src/pages/Auth"
click node_chat_ui "https://github.com/afra012/tutorsphere/blob/main/frontend/src/pages/Chat/Chat.jsx"
click node_review_ui "https://github.com/afra012/tutorsphere/blob/main/frontend/src/pages/Reviews/Review.jsx"
click node_admin_ui "https://github.com/afra012/tutorsphere/tree/main/frontend/src/pages/AdminDashboard"
click node_profile "https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/FindTutorController.php"
click node_tutor_posts "https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/TutorPostController.php"
click node_requirements "https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/TeacherPostRequestController.php"
click node_hire_requests "https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/TuitionRequestController.php"
click node_reviews "https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/ReviewController.php"
click node_auth "https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/AuthController.php"
click node_chat "https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/ChatMessageController.php"
click node_subscriptions "https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/SubscriptionController.php"
click node_admin_api "https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/AdminController.php"
click node_location "https://github.com/afra012/tutorsphere/blob/main/backend/app/Services/LocationService.php"
click node_database "https://github.com/afra012/tutorsphere/blob/main/backend/config/database.php"

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_app,node_api_client,node_student_ui,node_tutor_ui,node_auth_ui,node_chat_ui,node_review_ui,node_admin_ui toneBlue
class node_profile,node_tutor_posts,node_requirements,node_hire_requests,node_reviews toneAmber
class node_auth,node_chat,node_subscriptions,node_admin_api,node_location toneMint
class node_database toneRose
class node_student,node_tutor,node_admin,node_google toneIndigo
```

## Components

### React experience

- [Routes and app](https://github.com/afra012/tutorsphere/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/afra012/tutorsphere/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`
- [Student dashboard](https://github.com/afra012/tutorsphere/tree/main/frontend/src/pages/StudentDashboard): `frontend/src/pages/StudentDashboard`
- [Tutor dashboard](https://github.com/afra012/tutorsphere/tree/main/frontend/src/pages/TeacherDashboard): `frontend/src/pages/TeacherDashboard`
- [Sign-in and register](https://github.com/afra012/tutorsphere/tree/main/frontend/src/pages/Auth): `frontend/src/pages/Auth`
- [Chat interface](https://github.com/afra012/tutorsphere/blob/main/frontend/src/pages/Chat/Chat.jsx): `frontend/src/pages/Chat/Chat.jsx`
- [Review interface](https://github.com/afra012/tutorsphere/blob/main/frontend/src/pages/Reviews/Review.jsx): `frontend/src/pages/Reviews/Review.jsx`
- [Admin dashboard](https://github.com/afra012/tutorsphere/tree/main/frontend/src/pages/AdminDashboard): `frontend/src/pages/AdminDashboard`

### Tutor marketplace

- [Profiles and tutor search](https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/FindTutorController.php): `backend/app/Http/Controllers/FindTutorController.php`
- [Tutor service posts](https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/TutorPostController.php): `backend/app/Http/Controllers/TutorPostController.php`
- [Student requirements](https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/TeacherPostRequestController.php): `backend/app/Http/Controllers/TeacherPostRequestController.php`
- [Hire requests](https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/TuitionRequestController.php): `backend/app/Http/Controllers/TuitionRequestController.php`
- [Ratings and reviews](https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/ReviewController.php): `backend/app/Http/Controllers/ReviewController.php`

### Platform operations

- [Authentication](https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/AuthController.php): `backend/app/Http/Controllers/AuthController.php`
- [Chat messages](https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/ChatMessageController.php): `backend/app/Http/Controllers/ChatMessageController.php`
- [Subscriptions](https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/SubscriptionController.php): `backend/app/Http/Controllers/SubscriptionController.php`
- [Administration](https://github.com/afra012/tutorsphere/blob/main/backend/app/Http/Controllers/AdminController.php): `backend/app/Http/Controllers/AdminController.php`
- [Location service](https://github.com/afra012/tutorsphere/blob/main/backend/app/Services/LocationService.php): `backend/app/Services/LocationService.php`

### Backend and data

- [Application database](https://github.com/afra012/tutorsphere/blob/main/backend/config/database.php): `backend/config/database.php`

### Other components

- **Student**
- **Tutor**
- **Administrator**
- **Google sign-in**

## Connections

- Student → Routes and app: uses
- Tutor → Routes and app: uses
- Administrator → Routes and app: uses
- Routes and app → Student dashboard: routes to
- Routes and app → Tutor dashboard: routes to
- Routes and app → Sign-in and register: routes to
- Routes and app → Chat interface: routes to
- Routes and app → Admin dashboard: routes to
- Student dashboard → API client: requests data
- Tutor dashboard → API client: requests data
- Sign-in and register → API client: requests auth
- Chat interface → API client: requests messages
- Review interface → API client: requests reviews
- Admin dashboard → API client: requests admin
- Student dashboard → Review interface: opens reviews
- API client → Profiles and tutor search: REST requests
- API client → Tutor service posts: REST requests
- API client → Student requirements: REST requests
- API client → Hire requests: REST requests
- API client → Ratings and reviews: REST requests
- API client → Authentication: REST requests
- API client → Chat messages: REST requests
- API client → Subscriptions: REST requests
- API client → Administration: REST requests
- Sign-in and register → Google sign-in: OAuth callback
- Profiles and tutor search → Application database: reads and writes
- Tutor service posts → Application database: reads and writes
- Student requirements → Application database: reads and writes
- Hire requests → Application database: reads and writes
- Ratings and reviews → Application database: reads and writes
- Authentication → Application database: reads and writes
- Chat messages → Application database: reads and writes
- Subscriptions → Application database: reads and writes
- Administration → Application database: reads and writes
- Location service → Application database: creates and updates
