# sokhibjonow/codov architecture

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

- Interactive diagram: https://gitdiagram.com/sokhibjonow/codov
- Repository: https://github.com/sokhibjonow/codov

## Overview

codov is a bilingual HTML/CSS/JavaScript learning platform. Its main learner journey is to access course lessons and assignments, work in a browser code editor with a live preview, then submit work for teacher review; teachers manage course content and assess submissions, while parents track learner progress. The map also includes chat, attendance, and uploads. Some major areas are represented by their exact app directories because their implementation files were not sampled; those links are documented or left out rather than inferred.

Main entry points: [`src/app/student`](https://github.com/sokhibjonow/codov/tree/main/src/app/student) (Student portal), [`src/app/admin`](https://github.com/sokhibjonow/codov/tree/main/src/app/admin) (Teacher portal), [`src/app/login`](https://github.com/sokhibjonow/codov/tree/main/src/app/login) (Sign in), [`src/lib/db.ts`](https://github.com/sokhibjonow/codov/blob/main/src/lib/db.ts) (PostgreSQL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and interface"]
  node_login["Sign in"]
  node_role_guard["Role access<br/>[proxy.ts]"]
  node_localization["Uzbek / Russian<br/>[server.ts]"]
end

subgraph group_learning["Learning workflow"]
  node_student_portal["Student portal"]
  node_lesson_content["Lessons and courses<br/>[learning.ts]"]
  node_assignment_workspace["Code workspace<br/>[Workspace.tsx]"]
  node_live_preview["Live preview<br/>[preview.ts]"]
  node_integrity["Work integrity<br/>[integrity.ts]"]
  node_autotests["Autotest checks<br/>[autotests.ts]"]
end

subgraph group_teaching["Teaching and review"]
  node_teacher_portal["Teacher portal"]
  node_submission_review["Submission review<br/>[ReviewForm.tsx]"]
  node_ai_review["AI assessment<br/>[review.ts]"]
  node_attachments_ui["Attachments manager"]
end

subgraph group_engagement["Communication and progress"]
  node_chat["Chat"]
  node_parent_portal["Parent portal"]
  node_progress["Progress reports<br/>[progress.ts]"]
end

subgraph group_platform["Platform services"]
  node_auth["Session auth<br/>[auth.ts]"]
  node_database[("PostgreSQL<br/>[db.ts]")]
  node_uploads_api["Upload endpoint<br/>[route.ts]"]
  node_upload_client["Upload client<br/>[upload-client.ts]"]
  node_file_access["Private file access<br/>[route.ts]"]
end

node_teacher(("Teacher"))
node_student(("Student"))
node_parent(("Parent"))

node_teacher -->|"signs in"| node_login
node_student -->|"signs in"| node_login
node_parent -->|"signs in"| node_login
node_login -.->|"enters portal"| node_role_guard
node_role_guard -->|"checks session"| node_auth
node_auth -->|"loads user"| node_database
node_student -->|"learns"| node_student_portal
node_student_portal -.->|"accesses lessons"| node_lesson_content
node_lesson_content -->|"reads course data"| node_database
node_student_portal -.->|"opens assignment"| node_assignment_workspace
node_assignment_workspace -.->|"renders code"| node_live_preview
node_assignment_workspace -->|"records activity"| node_integrity
node_teacher -->|"manages learning"| node_teacher_portal
node_teacher_portal -.->|"reviews work"| node_submission_review
node_submission_review -->|"requests assessment"| node_ai_review
node_ai_review -->|"uses test results"| node_autotests
node_ai_review -->|"uses activity data"| node_integrity
node_student -->|"communicates"| node_chat
node_teacher -->|"communicates"| node_chat
node_parent -->|"views child account"| node_parent_portal
node_parent_portal -->|"views progress"| node_progress
node_teacher_portal -.->|"manages materials"| node_attachments_ui
node_attachments_ui -->|"uploads files"| node_upload_client
node_upload_client -->|"sends upload"| node_uploads_api
node_uploads_api -->|"records attachment"| node_database
node_student_portal -.->|"opens files"| node_file_access
node_file_access -.->|"validates session"| node_database
node_student_portal -.->|"loads language"| node_localization
node_teacher_portal -.->|"loads language"| node_localization
node_parent_portal -.->|"loads language"| node_localization

click node_login "https://github.com/sokhibjonow/codov/tree/main/src/app/login"
click node_role_guard "https://github.com/sokhibjonow/codov/blob/main/src/proxy.ts"
click node_auth "https://github.com/sokhibjonow/codov/blob/main/src/lib/auth.ts"
click node_database "https://github.com/sokhibjonow/codov/blob/main/src/lib/db.ts"
click node_localization "https://github.com/sokhibjonow/codov/blob/main/src/i18n/server.ts"
click node_student_portal "https://github.com/sokhibjonow/codov/tree/main/src/app/student"
click node_lesson_content "https://github.com/sokhibjonow/codov/blob/main/src/lib/learning.ts"
click node_assignment_workspace "https://github.com/sokhibjonow/codov/blob/main/src/app/student/(focus)/assignments/%5Bid%5D/Workspace.tsx"
click node_live_preview "https://github.com/sokhibjonow/codov/blob/main/src/lib/preview.ts"
click node_integrity "https://github.com/sokhibjonow/codov/blob/main/src/lib/integrity.ts"
click node_autotests "https://github.com/sokhibjonow/codov/blob/main/src/lib/autotests.ts"
click node_teacher_portal "https://github.com/sokhibjonow/codov/tree/main/src/app/admin"
click node_submission_review "https://github.com/sokhibjonow/codov/blob/main/src/components/review/ReviewForm.tsx"
click node_ai_review "https://github.com/sokhibjonow/codov/blob/main/src/lib/ai/review.ts"
click node_chat "https://github.com/sokhibjonow/codov/tree/main/src/components/chat"
click node_parent_portal "https://github.com/sokhibjonow/codov/tree/main/src/app/parent"
click node_progress "https://github.com/sokhibjonow/codov/blob/main/src/lib/progress.ts"
click node_uploads_api "https://github.com/sokhibjonow/codov/blob/main/src/app/api/uploads/route.ts"
click node_upload_client "https://github.com/sokhibjonow/codov/blob/main/src/lib/upload-client.ts"
click node_file_access "https://github.com/sokhibjonow/codov/blob/main/src/app/files/%5B...path%5D/route.ts"
click node_attachments_ui "https://github.com/sokhibjonow/codov/blob/main/src/components/attachments/AttachmentsManager.tsx"

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_login,node_role_guard,node_localization toneBlue
class node_student_portal,node_lesson_content,node_assignment_workspace,node_live_preview,node_integrity,node_autotests toneAmber
class node_teacher_portal,node_submission_review,node_ai_review,node_attachments_ui toneMint
class node_chat,node_parent_portal,node_progress toneRose
class node_auth,node_database,node_uploads_api,node_upload_client,node_file_access,node_teacher,node_student,node_parent toneIndigo
```

## Components

### Access and interface

- [Sign in](https://github.com/sokhibjonow/codov/tree/main/src/app/login): `src/app/login`
- [Role access](https://github.com/sokhibjonow/codov/blob/main/src/proxy.ts): `src/proxy.ts`
- [Uzbek / Russian](https://github.com/sokhibjonow/codov/blob/main/src/i18n/server.ts): `src/i18n/server.ts`

### Learning workflow

- [Student portal](https://github.com/sokhibjonow/codov/tree/main/src/app/student): `src/app/student`
- [Lessons and courses](https://github.com/sokhibjonow/codov/blob/main/src/lib/learning.ts): `src/lib/learning.ts`
- [Code workspace](https://github.com/sokhibjonow/codov/blob/main/src/app/student/(focus)/assignments/%5Bid%5D/Workspace.tsx): `src/app/student/(focus)/assignments/[id]/Workspace.tsx`
- [Live preview](https://github.com/sokhibjonow/codov/blob/main/src/lib/preview.ts): `src/lib/preview.ts`
- [Work integrity](https://github.com/sokhibjonow/codov/blob/main/src/lib/integrity.ts): `src/lib/integrity.ts`
- [Autotest checks](https://github.com/sokhibjonow/codov/blob/main/src/lib/autotests.ts): `src/lib/autotests.ts`

### Teaching and review

- [Teacher portal](https://github.com/sokhibjonow/codov/tree/main/src/app/admin): `src/app/admin`
- [Submission review](https://github.com/sokhibjonow/codov/blob/main/src/components/review/ReviewForm.tsx): `src/components/review/ReviewForm.tsx`
- [AI assessment](https://github.com/sokhibjonow/codov/blob/main/src/lib/ai/review.ts): `src/lib/ai/review.ts`
- [Attachments manager](https://github.com/sokhibjonow/codov/blob/main/src/components/attachments/AttachmentsManager.tsx): `src/components/attachments/AttachmentsManager.tsx`

### Communication and progress

- [Chat](https://github.com/sokhibjonow/codov/tree/main/src/components/chat): `src/components/chat`
- [Parent portal](https://github.com/sokhibjonow/codov/tree/main/src/app/parent): `src/app/parent`
- [Progress reports](https://github.com/sokhibjonow/codov/blob/main/src/lib/progress.ts): `src/lib/progress.ts`

### Platform services

- [Session auth](https://github.com/sokhibjonow/codov/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [PostgreSQL](https://github.com/sokhibjonow/codov/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [Upload endpoint](https://github.com/sokhibjonow/codov/blob/main/src/app/api/uploads/route.ts): `src/app/api/uploads/route.ts`
- [Upload client](https://github.com/sokhibjonow/codov/blob/main/src/lib/upload-client.ts): `src/lib/upload-client.ts`
- [Private file access](https://github.com/sokhibjonow/codov/blob/main/src/app/files/%5B...path%5D/route.ts): `src/app/files/[...path]/route.ts`

### Other components

- **Teacher**
- **Student**
- **Parent**

## Connections

- Teacher → Sign in: signs in (evidence: `README.md`)
- Student → Sign in: signs in (evidence: `README.md`)
- Parent → Sign in: signs in (evidence: `README.md`)
- Sign in → Role access: enters portal
- Role access → Session auth: checks session (evidence: `src/proxy.ts`)
- Session auth → PostgreSQL: loads user (evidence: `src/lib/auth.ts`)
- Student → Student portal: learns (evidence: `README.md`)
- Student portal → Lessons and courses: accesses lessons
- Lessons and courses → PostgreSQL: reads course data (evidence: `src/lib/learning.ts`)
- Student portal → Code workspace: opens assignment
- Code workspace → Live preview: renders code
- Code workspace → Work integrity: records activity
- Teacher → Teacher portal: manages learning (evidence: `README.md`)
- Teacher portal → Submission review: reviews work
- Submission review → AI assessment: requests assessment (evidence: `src/components/review/ReviewForm.tsx`)
- AI assessment → Autotest checks: uses test results (evidence: `src/lib/ai/review.ts`)
- AI assessment → Work integrity: uses activity data (evidence: `src/lib/ai/review.ts`)
- Student → Chat: communicates (evidence: `README.md`)
- Teacher → Chat: communicates (evidence: `README.md`)
- Parent → Parent portal: views child account (evidence: `README.md`)
- Parent portal → Progress reports: views progress (evidence: `src/app/parent/page.tsx`)
- Teacher portal → Attachments manager: manages materials
- Attachments manager → Upload client: uploads files (evidence: `src/components/attachments/AttachmentsManager.tsx`)
- Upload client → Upload endpoint: sends upload (evidence: `src/lib/upload-client.ts`)
- Upload endpoint → PostgreSQL: records attachment (evidence: `src/app/api/uploads/route.ts`)
- Student portal → Private file access: opens files
- Private file access → PostgreSQL: validates session
- Student portal → Uzbek / Russian: loads language
- Teacher portal → Uzbek / Russian: loads language
- Parent portal → Uzbek / Russian: loads language (evidence: `src/app/parent/page.tsx`)
