# ferhatenyani/darsov2 architecture

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

- Interactive diagram: https://gitdiagram.com/ferhatenyani/darsov2
- Repository: https://github.com/ferhatenyani/darsov2

## Overview

Darso is a two-sided tutoring platform for students and teachers. Students discover tutors, manage learning requests and sessions, communicate, and handle payments and reviews; teachers maintain profiles, manage sessions, and track professional activity. The tree documents these product areas, while the README identifies Supabase as the backing database. Sampled code confirms the Supabase server-client boundary and email-link authentication flow; unsampled page wiring is not inferred, so the graph keeps those areas as distinct capabilities.

Main entry points: [`src/app/auth/callback/route.ts`](https://github.com/ferhatenyani/darsov2/blob/main/src/app/auth/callback/route.ts) (Email-link callback), [`src/app/(auth)/sign-up/page.tsx`](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(auth)/sign-up/page.tsx) (Sign in and signup), [`src/lib/auth/routes.ts`](https://github.com/ferhatenyani/darsov2/blob/main/src/lib/auth/routes.ts) (Role routing), [`src/app/(app)/student/discover/page.tsx`](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/discover/page.tsx) (Tutor discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_landing["Landing site<br/>[page.tsx]"]
  node_auth_pages["Sign in and signup<br/>[page.tsx]"]
  node_auth_callback["Email-link callback<br/>[route.ts]"]
  node_auth_routes["Role routing<br/>[routes.ts]"]
end

subgraph group_student["Student experience"]
  node_student_discovery["Tutor discovery<br/>[page.tsx]"]
  node_student_dashboard["Student dashboard<br/>[page.tsx]"]
  node_student_sessions["Student sessions<br/>[page.tsx]"]
  node_student_payments["Payments and invoices<br/>[page.tsx]"]
  node_student_messages["Student messaging<br/>[page.tsx]"]
  node_student_reviews["Student reviews<br/>[page.tsx]"]
  node_student_support["Student help<br/>[page.tsx]"]
end

subgraph group_teacher["Teacher workspace"]
  node_teacher_profile["Teacher profile<br/>[page.tsx]"]
  node_teacher_preview["Public teacher profile<br/>[page.tsx]"]
  node_teacher_sessions["Teacher sessions<br/>[page.tsx]"]
  node_teacher_earnings["Earnings and stats<br/>[page.tsx]"]
  node_teacher_verification["Teacher verification<br/>[page.tsx]"]
  node_teacher_agency["Agency workspace<br/>[page.tsx]"]
  node_teacher_messages["Teacher messaging<br/>[page.tsx]"]
  node_teacher_reviews["Teacher reviews<br/>[page.tsx]"]
end

subgraph group_shared["Shared platform services"]
  node_reference_data["Reference data<br/>[reference.ts]"]
  node_server_client["Supabase server client<br/>[server.ts]"]
end

node_visitor(("Visitor"))
node_student_actor(("Student"))
node_teacher_actor(("Teacher"))
node_supabase[("Supabase")]

node_visitor -->|"visits"| node_landing
node_student_actor -->|"signs up"| node_auth_pages
node_teacher_actor -->|"signs up"| node_auth_pages
node_auth_pages -->|"email link"| node_auth_callback
node_auth_callback -->|"creates client"| node_server_client
node_auth_callback -->|"resolves role"| node_auth_routes
node_auth_callback -->|"exchanges or verifies"| node_supabase
node_auth_routes -->|"reads profile role"| node_supabase
node_student_actor -->|"discovers tutors"| node_student_discovery
node_student_actor -->|"uses"| node_student_dashboard
node_student_actor -->|"manages sessions"| node_student_sessions
node_student_actor -->|"manages payments"| node_student_payments
node_student_actor -->|"messages"| node_student_messages
node_student_actor -->|"reviews tutors"| node_student_reviews
node_student_actor -->|"gets help"| node_student_support
node_teacher_actor -->|"edits profile"| node_teacher_profile
node_teacher_actor -->|"manages sessions"| node_teacher_sessions
node_teacher_actor -->|"tracks earnings"| node_teacher_earnings
node_teacher_actor -->|"submits verification"| node_teacher_verification
node_teacher_actor -->|"uses"| node_teacher_agency
node_teacher_actor -->|"messages"| node_teacher_messages
node_teacher_actor -->|"reviews feedback"| node_teacher_reviews
node_student_discovery -.->|"uses reference data"| node_reference_data
node_teacher_profile -.->|"uses reference data"| node_reference_data
node_server_client -->|"queries with RLS"| node_supabase

click node_landing "https://github.com/ferhatenyani/darsov2/blob/main/src/app/page.tsx"
click node_auth_pages "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(auth)/sign-up/page.tsx"
click node_auth_callback "https://github.com/ferhatenyani/darsov2/blob/main/src/app/auth/callback/route.ts"
click node_auth_routes "https://github.com/ferhatenyani/darsov2/blob/main/src/lib/auth/routes.ts"
click node_student_discovery "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/discover/page.tsx"
click node_student_dashboard "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/page.tsx"
click node_student_sessions "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/sessions/page.tsx"
click node_student_payments "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/payments/page.tsx"
click node_student_messages "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/messages/page.tsx"
click node_student_reviews "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/reviews/page.tsx"
click node_student_support "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/help/page.tsx"
click node_teacher_profile "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/profile/page.tsx"
click node_teacher_preview "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/preview/%5Busername%5D/page.tsx"
click node_teacher_sessions "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/sessions/page.tsx"
click node_teacher_earnings "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/earnings/page.tsx"
click node_teacher_verification "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/verification/page.tsx"
click node_teacher_agency "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/agency/page.tsx"
click node_teacher_messages "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/messages/page.tsx"
click node_teacher_reviews "https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/reviews/page.tsx"
click node_reference_data "https://github.com/ferhatenyani/darsov2/blob/main/src/lib/data/reference.ts"
click node_server_client "https://github.com/ferhatenyani/darsov2/blob/main/src/lib/supabase/server.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_landing,node_auth_pages,node_auth_callback,node_auth_routes toneBlue
class node_student_discovery,node_student_dashboard,node_student_sessions,node_student_payments,node_student_messages,node_student_reviews,node_student_support,node_supabase toneAmber
class node_teacher_profile,node_teacher_preview,node_teacher_sessions,node_teacher_earnings,node_teacher_verification,node_teacher_agency,node_teacher_messages,node_teacher_reviews toneMint
class node_reference_data,node_server_client toneRose
class node_visitor,node_student_actor,node_teacher_actor toneIndigo
```

## Components

### Entry and identity

- [Landing site](https://github.com/ferhatenyani/darsov2/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Sign in and signup](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(auth)/sign-up/page.tsx): `src/app/(auth)/sign-up/page.tsx`
- [Email-link callback](https://github.com/ferhatenyani/darsov2/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`
- [Role routing](https://github.com/ferhatenyani/darsov2/blob/main/src/lib/auth/routes.ts): `src/lib/auth/routes.ts`

### Student experience

- [Tutor discovery](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/discover/page.tsx): `src/app/(app)/student/discover/page.tsx`
- [Student dashboard](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/page.tsx): `src/app/(app)/student/page.tsx`
- [Student sessions](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/sessions/page.tsx): `src/app/(app)/student/sessions/page.tsx`
- [Payments and invoices](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/payments/page.tsx): `src/app/(app)/student/payments/page.tsx`
- [Student messaging](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/messages/page.tsx): `src/app/(app)/student/messages/page.tsx`
- [Student reviews](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/reviews/page.tsx): `src/app/(app)/student/reviews/page.tsx`
- [Student help](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/student/help/page.tsx): `src/app/(app)/student/help/page.tsx`

### Teacher workspace

- [Teacher profile](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/profile/page.tsx): `src/app/(app)/teacher/profile/page.tsx`
- [Public teacher profile](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/preview/%5Busername%5D/page.tsx): `src/app/(app)/teacher/preview/[username]/page.tsx`
- [Teacher sessions](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/sessions/page.tsx): `src/app/(app)/teacher/sessions/page.tsx`
- [Earnings and stats](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/earnings/page.tsx): `src/app/(app)/teacher/earnings/page.tsx`
- [Teacher verification](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/verification/page.tsx): `src/app/(app)/teacher/verification/page.tsx`
- [Agency workspace](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/agency/page.tsx): `src/app/(app)/teacher/agency/page.tsx`
- [Teacher messaging](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/messages/page.tsx): `src/app/(app)/teacher/messages/page.tsx`
- [Teacher reviews](https://github.com/ferhatenyani/darsov2/blob/main/src/app/(app)/teacher/reviews/page.tsx): `src/app/(app)/teacher/reviews/page.tsx`

### Shared platform services

- [Reference data](https://github.com/ferhatenyani/darsov2/blob/main/src/lib/data/reference.ts): `src/lib/data/reference.ts`
- [Supabase server client](https://github.com/ferhatenyani/darsov2/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`

### Other components

- **Visitor**
- **Student**
- **Teacher**
- **Supabase**

## Connections

- Visitor → Landing site: visits
- Student → Sign in and signup: signs up
- Teacher → Sign in and signup: signs up
- Sign in and signup → Email-link callback: email link
- Email-link callback → Supabase server client: creates client
- Email-link callback → Role routing: resolves role
- Email-link callback → Supabase: exchanges or verifies
- Role routing → Supabase: reads profile role
- Student → Tutor discovery: discovers tutors
- Student → Student dashboard: uses
- Student → Student sessions: manages sessions
- Student → Payments and invoices: manages payments
- Student → Student messaging: messages
- Student → Student reviews: reviews tutors
- Student → Student help: gets help
- Teacher → Teacher profile: edits profile
- Teacher → Teacher sessions: manages sessions
- Teacher → Earnings and stats: tracks earnings
- Teacher → Teacher verification: submits verification
- Teacher → Agency workspace: uses
- Teacher → Teacher messaging: messages
- Teacher → Teacher reviews: reviews feedback
- Tutor discovery → Reference data: uses reference data
- Teacher profile → Reference data: uses reference data
- Supabase server client → Supabase: queries with RLS
