# suryansdev/ocd-repo architecture

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

- Interactive diagram: https://gitdiagram.com/suryansdev/ocd-repo
- Repository: https://github.com/suryansdev/ocd-repo

## Overview

Open Code Developers is a coding-practice tracker for learners and mentors. Learners sign up, complete onboarding, and use a dashboard to track assigned work and platform progress; mentors and administrators manage users, assign tasks, and schedule rollouts. Server routes handle task and profile operations, while synchronization updates coding-platform statistics and task streaks. The README is too sparse to confirm additional capabilities. Connections below are limited to routes, imports, and calls visible in the provided excerpts or source index; unsampled route internals are not inferred.

Main entry points: [`src/lib/syncEngine.ts`](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/syncEngine.ts) (Platform and streak sync), [`src/lib/supabase/client.ts`](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/supabase/client.ts) (Browser Supabase client), [`src/lib/supabase/admin.ts`](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/supabase/admin.ts) (Admin Supabase client), [`src/app/api/tasks/route.ts`](https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/tasks/route.ts) (Task operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_authpages["Sign-in and onboarding<br/>[page.tsx]"]
  node_dashboard["Progress dashboard<br/>[page.tsx]"]
  node_profile["Profile management<br/>[page.tsx]"]
  node_adminui["Admin console<br/>[page.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
end

subgraph group_work["Tasks and scheduling"]
  node_calendar["Rollout calendar"]
  node_tasksapi["Task operations<br/>[route.ts]"]
  node_scheduleapi["Scheduled tasks<br/>[route.ts]"]
  node_menteeapi["Mentee lookup<br/>[route.ts]"]
  node_parser["Task link parser<br/>[taskParser.ts]"]
  node_dates["IST date utilities<br/>[dateUtils.ts]"]
  node_cses["CSES helpers<br/>[cses.ts]"]
end

subgraph group_sync["Progress synchronization"]
  node_syncapi["Sync endpoints<br/>[route.ts]"]
  node_leaderboardapi["Leaderboard sync<br/>[route.ts]"]
  node_profileapi["Profile API<br/>[route.ts]"]
  node_verifyapi["Handle verification<br/>[route.ts]"]
  node_engine["Platform and streak sync<br/>[syncEngine.ts]"]
  node_handles["Handle normalization<br/>[handles.ts]"]
end

subgraph group_services["Identity and persistence"]
  node_database[("Supabase data store")]
  node_browserclient["Browser Supabase client<br/>[client.ts]"]
  node_adminclient["Admin Supabase client<br/>[admin.ts]"]
end

node_learner(("Learner or mentor"))
node_codeforces{{"Codeforces"}}
node_leetcode{{"LeetCode"}}

node_learner -->|"signs up"| node_authpages
node_authpages -->|"authenticates with"| node_browserclient
node_dashboard -->|"reads data"| node_browserclient
node_profile -->|"updates profile"| node_browserclient
node_adminui -->|"manages users"| node_browserclient
node_dashboard -->|"renders"| node_navbar
node_adminui -->|"renders"| node_navbar
node_profile -->|"renders"| node_navbar
node_dashboard -->|"renders"| node_calendar
node_calendar -->|"formats tasks"| node_parser
node_calendar -->|"formats dates"| node_dates
node_tasksapi -->|"parses links"| node_parser
node_tasksapi -->|"validates schedule dates"| node_dates
node_tasksapi -->|"rolls out due tasks"| node_engine
node_scheduleapi -->|"parses links"| node_parser
node_parser -->|"uses"| node_cses
node_tasksapi -->|"creates client"| node_adminclient
node_scheduleapi -->|"uses"| node_adminclient
node_menteeapi -->|"uses"| node_adminclient
node_syncapi -->|"runs sync"| node_engine
node_leaderboardapi -->|"runs sync"| node_engine
node_profileapi -->|"uses"| node_engine
node_verifyapi -->|"normalizes handles"| node_handles
node_profileapi -->|"normalizes handles"| node_handles
node_leaderboardapi -->|"normalizes handles"| node_handles
node_engine -->|"cleans handles"| node_handles
node_engine -->|"gets IST date"| node_dates
node_engine -->|"creates client"| node_adminclient
node_browserclient -->|"connects to"| node_database
node_adminclient -->|"connects to"| node_database
node_engine -->|"fetches profile data"| node_codeforces
node_engine -->|"fetches profile data"| node_leetcode

click node_authpages "https://github.com/suryansdev/ocd-repo/blob/main/src/app/login/page.tsx"
click node_dashboard "https://github.com/suryansdev/ocd-repo/blob/main/src/app/dashboard/page.tsx"
click node_profile "https://github.com/suryansdev/ocd-repo/blob/main/src/app/profile/page.tsx"
click node_adminui "https://github.com/suryansdev/ocd-repo/blob/main/src/app/admin/page.tsx"
click node_navbar "https://github.com/suryansdev/ocd-repo/blob/main/src/components/Navbar.tsx"
click node_calendar "https://github.com/suryansdev/ocd-repo/blob/main/src/components/ScheduleCalendar.tsx"
click node_tasksapi "https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/tasks/route.ts"
click node_scheduleapi "https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/tasks/schedule/route.ts"
click node_menteeapi "https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/tasks/mentees/route.ts"
click node_parser "https://github.com/suryansdev/ocd-repo/blob/main/src/lib/taskParser.ts"
click node_dates "https://github.com/suryansdev/ocd-repo/blob/main/src/lib/dateUtils.ts"
click node_syncapi "https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/cron/sync/route.ts"
click node_leaderboardapi "https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/leaderboard/sync/route.ts"
click node_profileapi "https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/users/profile/route.ts"
click node_verifyapi "https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/verify/route.ts"
click node_engine "https://github.com/suryansdev/ocd-repo/blob/main/src/lib/syncEngine.ts"
click node_handles "https://github.com/suryansdev/ocd-repo/blob/main/src/lib/handles.ts"
click node_cses "https://github.com/suryansdev/ocd-repo/blob/main/src/lib/cses.ts"
click node_browserclient "https://github.com/suryansdev/ocd-repo/blob/main/src/lib/supabase/client.ts"
click node_adminclient "https://github.com/suryansdev/ocd-repo/blob/main/src/lib/supabase/admin.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_authpages,node_dashboard,node_profile,node_adminui,node_navbar toneBlue
class node_calendar,node_tasksapi,node_scheduleapi,node_menteeapi,node_parser,node_dates,node_cses toneAmber
class node_syncapi,node_leaderboardapi,node_profileapi,node_verifyapi,node_engine,node_handles toneMint
class node_database,node_browserclient,node_adminclient toneRose
class node_learner,node_codeforces,node_leetcode toneIndigo
```

## Components

### User experience

- [Sign-in and onboarding](https://github.com/suryansdev/ocd-repo/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Progress dashboard](https://github.com/suryansdev/ocd-repo/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Profile management](https://github.com/suryansdev/ocd-repo/blob/main/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [Admin console](https://github.com/suryansdev/ocd-repo/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Navigation](https://github.com/suryansdev/ocd-repo/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`

### Tasks and scheduling

- [Rollout calendar](https://github.com/suryansdev/ocd-repo/blob/main/src/components/ScheduleCalendar.tsx): `src/components/ScheduleCalendar.tsx`
- [Task operations](https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/tasks/route.ts): `src/app/api/tasks/route.ts`
- [Scheduled tasks](https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/tasks/schedule/route.ts): `src/app/api/tasks/schedule/route.ts`
- [Mentee lookup](https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/tasks/mentees/route.ts): `src/app/api/tasks/mentees/route.ts`
- [Task link parser](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/taskParser.ts): `src/lib/taskParser.ts`
- [IST date utilities](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/dateUtils.ts): `src/lib/dateUtils.ts`
- [CSES helpers](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/cses.ts): `src/lib/cses.ts`

### Progress synchronization

- [Sync endpoints](https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/cron/sync/route.ts): `src/app/api/cron/sync/route.ts`
- [Leaderboard sync](https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/leaderboard/sync/route.ts): `src/app/api/leaderboard/sync/route.ts`
- [Profile API](https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/users/profile/route.ts): `src/app/api/users/profile/route.ts`
- [Handle verification](https://github.com/suryansdev/ocd-repo/blob/main/src/app/api/verify/route.ts): `src/app/api/verify/route.ts`
- [Platform and streak sync](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/syncEngine.ts): `src/lib/syncEngine.ts`
- [Handle normalization](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/handles.ts): `src/lib/handles.ts`

### Identity and persistence

- **Supabase data store**
- [Browser Supabase client](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Admin Supabase client](https://github.com/suryansdev/ocd-repo/blob/main/src/lib/supabase/admin.ts): `src/lib/supabase/admin.ts`

### Other components

- **Learner or mentor**
- **Codeforces**
- **LeetCode**

## Connections

- Learner or mentor → Sign-in and onboarding: signs up (evidence: `src/app/login/page.tsx`)
- Sign-in and onboarding → Browser Supabase client: authenticates with (evidence: `src/app/login/page.tsx`)
- Progress dashboard → Browser Supabase client: reads data (evidence: `src/app/dashboard/page.tsx`)
- Profile management → Browser Supabase client: updates profile (evidence: `src/app/profile/page.tsx`)
- Admin console → Browser Supabase client: manages users (evidence: `src/app/admin/page.tsx`)
- Progress dashboard → Navigation: renders (evidence: `src/app/dashboard/page.tsx`)
- Admin console → Navigation: renders (evidence: `src/app/admin/page.tsx`)
- Profile management → Navigation: renders (evidence: `src/app/profile/page.tsx`)
- Progress dashboard → Rollout calendar: renders (evidence: `src/app/dashboard/page.tsx`)
- Rollout calendar → Task link parser: formats tasks (evidence: `src/components/ScheduleCalendar.tsx`)
- Rollout calendar → IST date utilities: formats dates (evidence: `src/components/ScheduleCalendar.tsx`)
- Task operations → Task link parser: parses links (evidence: `src/app/api/tasks/route.ts`)
- Task operations → IST date utilities: validates schedule dates (evidence: `src/app/api/tasks/route.ts`)
- Task operations → Platform and streak sync: rolls out due tasks (evidence: `src/app/api/tasks/route.ts`)
- Scheduled tasks → Task link parser: parses links (evidence: `src/app/api/tasks/schedule/route.ts`)
- Task link parser → CSES helpers: uses (evidence: `src/lib/taskParser.ts`)
- Task operations → Admin Supabase client: creates client (evidence: `src/app/api/tasks/route.ts`)
- Scheduled tasks → Admin Supabase client: uses (evidence: `src/app/api/tasks/schedule/route.ts`)
- Mentee lookup → Admin Supabase client: uses (evidence: `src/app/api/tasks/mentees/route.ts`)
- Sync endpoints → Platform and streak sync: runs sync (evidence: `src/app/api/cron/sync/route.ts`)
- Leaderboard sync → Platform and streak sync: runs sync (evidence: `src/app/api/leaderboard/sync/route.ts`)
- Profile API → Platform and streak sync: uses (evidence: `src/app/api/users/profile/route.ts`)
- Handle verification → Handle normalization: normalizes handles (evidence: `src/app/api/verify/route.ts`)
- Profile API → Handle normalization: normalizes handles (evidence: `src/app/api/users/profile/route.ts`)
- Leaderboard sync → Handle normalization: normalizes handles (evidence: `src/app/api/leaderboard/sync/route.ts`)
- Platform and streak sync → Handle normalization: cleans handles (evidence: `src/lib/syncEngine.ts`)
- Platform and streak sync → IST date utilities: gets IST date (evidence: `src/lib/syncEngine.ts`)
- Platform and streak sync → Admin Supabase client: creates client (evidence: `src/lib/syncEngine.ts`)
- Browser Supabase client → Supabase data store: connects to (evidence: `src/lib/supabase/client.ts`)
- Admin Supabase client → Supabase data store: connects to (evidence: `src/lib/supabase/admin.ts`)
- Platform and streak sync → Codeforces: fetches profile data (evidence: `src/lib/syncEngine.ts`)
- Platform and streak sync → LeetCode: fetches profile data (evidence: `src/lib/syncEngine.ts`)
