# akashksankar/bharat-virtual-moot-court architecture

> Architecture diagram of the GitHub repository akashksankar/bharat-virtual-moot-court, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akashksankar/bharat-virtual-moot-court
- Repository: https://github.com/akashksankar/bharat-virtual-moot-court

## Overview

#### Purpose and Runtime
CourtVerse is a virtual courtroom practice UI for legal education: users create or join simulated hearings, assume courtroom roles, and work through evidence, objections, transcripts, judgment, and evaluation. The implemented repository is a React/TypeScript Vite client with a TypeScript server entry point, rather than the full backend architecture described in the README.

Primary startup paths:
- Client bootstrap: `src/main.tsx`
- Root application orchestration: `src/App.tsx`
- Server process entry: `server.ts`
- Browser build shell: `index.html`

#### Application Shell and Session Entry
`App.tsx` is the top-level control boundary for navigating between landing, room-creation/joining, and active courtroom experiences. The landing and modal components form the session-entry workflow; room/session state is likely held in client component state or passed through props, as no dedicated store directory exists.

Key paths:
- `src/App.tsx`
- `src/components/LandingPage.tsx`
- `src/components/CreateRoomModal.tsx`
- `src/components/JoinModal.tsx`
- `src/components/Navbar.tsx`

#### Courtroom Composition and Role Interaction
The active hearing is assembled around a courtroom view/layout rather than a conventional meeting UI. Layout components place participants and expose courtroom-specific controls such as speaking order, invitations, and judge actions. Role-aware UI is represented through reusable participant cards and judge controls.

Key paths:
- `src/components/CourtroomView.tsx`
- `src/components/courtroom/CourtroomLayout.tsx`
- `src/components/courtroom/ParticipantCard.tsx`
- `src/components/courtroom/SpeakingQueue.tsx`
- `src/components/judge/JudgeControlPanel.tsx`

#### Case, Evidence, and Hearing Record
Case content is presented as structured, client-side domain data. Evidence management and document viewing support exhibit-oriented proceedings; the timeline, case summary, transcript, and judgment editor represent the persistent conceptual record of a hearing. The repository includes demo data, but no visible database/model layer.

Key paths:
- `src/types.ts`
- `src/data/demoData.ts`
- `src/components/case/CaseSummaryPanel.tsx`
- `src/components/evidence/EvidenceManager.tsx`
- `src/components/evidence/DocumentViewer.tsx`
- `src/components/timeline/HearingTimeline.tsx`
- `src/components/transcript/StenographerPanel.tsx`
- `src/components/judgment/JudgmentEditor.tsx`

#### Proceedings and Learning Features
During a hearing, participants communicate through courtroom chat, can raise formal objections, receive AI-facing assistance, and receive evaluation or practice-oriented feedback. These are feature modules attached to the courtroom experience, not separately exposed services in the file tree.

Key paths:
- `src/components/chat/CourtroomChat.tsx`
- `src/components/objection/ObjectionModal.tsx`
- `src/components/ai/AICaseAssistant.tsx`
- `src/components/evaluation/EvaluationPanel.tsx`
- `src/components/practice/StudentPracticeMode.tsx`

#### Media, Speech, and Export Boundaries
Browser-specific integration is isolated in utilities: WebRTC for peer media/session mechanics, speech recognition for transcription input, sound effects for interaction feedback, and PDF generation for exporting material. These are important boundaries because they depend on browser APIs or external runtime configuration rather than React rendering alone.

Key paths:
- `src/utils/webrtc.ts`
- `src/utils/speechRecognition.ts`
- `src/utils/pdfExport.ts`
- `src/utils/sfx.ts`

#### Infrastructure and External Dependencies
The client uses Vite/Bun-era project tooling (`vite.config.ts`, `bun.lock`) and is intended to run alongside `server.ts`. The README proposes Node/Express, Socket.IO signaling, WebRTC, AI APIs, PostgreSQL, Redis, storage, and TURN infrastructure, with credentials configured through `.env`; however, database, Socket.IO, API route, and persistence modules are not present in this tree. Treat those integrations as runtime/roadmap dependencies unless confirmed in `server.ts` and package metadata.

Key paths:
- `server.ts`
- `.env.example`
- `package.json`
- `vite.config.ts`

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_browser_shell["Browser Build Shell<br/>HTML shell<br/>[index.html]"]
  node_client_bootstrap["Client Bootstrap<br/>React entry<br/>[main.tsx]"]
  node_server["Server Process<br/>TypeScript server entry<br/>[server.ts]"]
end

subgraph group_entry["Session Entry"]
  node_app["Application Shell<br/>React orchestrator<br/>[App.tsx]"]
  node_landing["Landing<br/>session entry UI<br/>[LandingPage.tsx]"]
  node_create_room["Create Room<br/>modal UI"]
  node_join_room["Join Room<br/>modal UI<br/>[JoinModal.tsx]"]
end

subgraph group_courtroom["Active Courtroom"]
  node_courtroom_view["Courtroom View<br/>hearing UI<br/>[CourtroomView.tsx]"]
  node_courtroom_layout["Courtroom Layout<br/>layout component"]
  node_participants["Participants &amp; Speaking<br/>role interaction UI"]
  node_judge_controls["Judge Controls<br/>judge action UI"]
end

subgraph group_record["Case &amp; Hearing Record"]
  node_case_data["Case Domain Data<br/>[demoData.ts]"]
  node_case_evidence["Case &amp; Evidence<br/>case exhibit UI"]
  node_hearing_record["Hearing Record<br/>recording and judgment UI"]
end

subgraph group_features["Proceeding Features"]
  node_proceedings["Proceeding Tools<br/>hearing feature UI<br/>[CourtroomChat.tsx]"]
  node_learning["Learning Tools<br/>education feature UI"]
end

subgraph group_browser["Browser Integrations"]
  node_webrtc{{"WebRTC Media<br/>browser API utility<br/>[webrtc.ts]"}}
  node_speech{{"Speech Recognition<br/>browser API utility"}}
  node_export{{"PDF Export<br/>export utility<br/>[pdfExport.ts]"}}
end

node_browser_shell -->|"loads"| node_client_bootstrap
node_client_bootstrap -->|"mounts"| node_app
node_app -->|"shows"| node_landing
node_landing -->|"opens"| node_create_room
node_landing -->|"opens"| node_join_room
node_create_room -->|"enters hearing"| node_courtroom_view
node_join_room -->|"enters hearing"| node_courtroom_view
node_app -->|"orchestrates"| node_courtroom_view
node_courtroom_view -->|"composes"| node_courtroom_layout
node_courtroom_layout -->|"places"| node_participants
node_courtroom_layout -->|"exposes"| node_judge_controls
node_courtroom_view -->|"presents"| node_case_evidence
node_courtroom_view -->|"maintains"| node_hearing_record
node_courtroom_view -->|"attaches"| node_proceedings
node_courtroom_view -->|"attaches"| node_learning
node_case_data -->|"supplies"| node_case_evidence
node_case_data -->|"supplies"| node_hearing_record
node_courtroom_view -->|"uses media"| node_webrtc
node_hearing_record -->|"uses input"| node_speech
node_hearing_record -->|"exports"| node_export
node_server -.->|"runtime companion"| node_browser_shell

click node_browser_shell "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/index.html"
click node_client_bootstrap "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/main.tsx"
click node_app "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/App.tsx"
click node_landing "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/LandingPage.tsx"
click node_create_room "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/CreateRoomModal.tsx"
click node_join_room "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/JoinModal.tsx"
click node_courtroom_view "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/CourtroomView.tsx"
click node_courtroom_layout "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/courtroom/CourtroomLayout.tsx"
click node_participants "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/courtroom/ParticipantCard.tsx"
click node_judge_controls "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/judge/JudgeControlPanel.tsx"
click node_case_data "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/data/demoData.ts"
click node_case_evidence "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/evidence/EvidenceManager.tsx"
click node_hearing_record "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/transcript/StenographerPanel.tsx"
click node_proceedings "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/chat/CourtroomChat.tsx"
click node_learning "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/ai/AICaseAssistant.tsx"
click node_webrtc "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/utils/webrtc.ts"
click node_speech "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/utils/speechRecognition.ts"
click node_export "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/utils/pdfExport.ts"
click node_server "https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/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_browser_shell,node_client_bootstrap,node_server toneBlue
class node_app,node_landing,node_create_room,node_join_room toneAmber
class node_courtroom_view,node_courtroom_layout,node_participants,node_judge_controls toneMint
class node_case_data,node_case_evidence,node_hearing_record toneRose
class node_proceedings,node_learning toneIndigo
class node_webrtc,node_speech,node_export toneTeal
```

## Components

### Runtime

- [Browser Build Shell](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/index.html): HTML shell · `index.html`
- [Client Bootstrap](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/main.tsx): React entry · `src/main.tsx`
- [Server Process](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/server.ts): TypeScript server entry · Implemented server boundary; broader backend integrations are not confirmed. · `server.ts`

### Session Entry

- [Application Shell](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/App.tsx): React orchestrator · Controls landing, session entry, and hearing views. · `src/App.tsx`
- [Landing](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/LandingPage.tsx): session entry UI · `src/components/LandingPage.tsx`
- [Create Room](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/CreateRoomModal.tsx): modal UI · `src/components/CreateRoomModal.tsx`
- [Join Room](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/JoinModal.tsx): modal UI · `src/components/JoinModal.tsx`

### Active Courtroom

- [Courtroom View](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/CourtroomView.tsx): hearing UI · `src/components/CourtroomView.tsx`
- [Courtroom Layout](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/courtroom/CourtroomLayout.tsx): layout component · `src/components/courtroom/CourtroomLayout.tsx`
- [Participants & Speaking](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/courtroom/ParticipantCard.tsx): role interaction UI · Participant cards and speaking queue expose courtroom roles and order. · `src/components/courtroom/ParticipantCard.tsx`
- [Judge Controls](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/judge/JudgeControlPanel.tsx): judge action UI · `src/components/judge/JudgeControlPanel.tsx`

### Case & Hearing Record

- [Case Domain Data](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/data/demoData.ts): TypeScript types and demo data · Client-side case data; no repository database layer is present. · `src/data/demoData.ts`
- [Case & Evidence](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/evidence/EvidenceManager.tsx): case exhibit UI · Case summary, exhibit management, and document viewing. · `src/components/evidence/EvidenceManager.tsx`
- [Hearing Record](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/transcript/StenographerPanel.tsx): recording and judgment UI · Timeline, transcript, and judgment editing form the conceptual hearing record. · `src/components/transcript/StenographerPanel.tsx`

### Proceeding Features

- [Proceeding Tools](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/chat/CourtroomChat.tsx): hearing feature UI · Courtroom chat and formal objection workflow. · `src/components/chat/CourtroomChat.tsx`
- [Learning Tools](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/components/ai/AICaseAssistant.tsx): education feature UI · AI assistance, evaluation, and student practice features. · `src/components/ai/AICaseAssistant.tsx`

### Browser Integrations

- [WebRTC Media](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/utils/webrtc.ts): browser API utility · Peer media and session mechanics boundary. · `src/utils/webrtc.ts`
- [Speech Recognition](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/utils/speechRecognition.ts): browser API utility · Transcription-input boundary. · `src/utils/speechRecognition.ts`
- [PDF Export](https://github.com/akashksankar/bharat-virtual-moot-court/blob/main/src/utils/pdfExport.ts): export utility · `src/utils/pdfExport.ts`

## Connections

- Browser Build Shell → Client Bootstrap: loads
- Client Bootstrap → Application Shell: mounts
- Application Shell → Landing: shows
- Landing → Create Room: opens
- Landing → Join Room: opens
- Create Room → Courtroom View: enters hearing
- Join Room → Courtroom View: enters hearing
- Application Shell → Courtroom View: orchestrates
- Courtroom View → Courtroom Layout: composes
- Courtroom Layout → Participants & Speaking: places
- Courtroom Layout → Judge Controls: exposes
- Courtroom View → Case & Evidence: presents
- Courtroom View → Hearing Record: maintains
- Courtroom View → Proceeding Tools: attaches
- Courtroom View → Learning Tools: attaches
- Case Domain Data → Case & Evidence: supplies
- Case Domain Data → Hearing Record: supplies
- Courtroom View → WebRTC Media: uses media
- Hearing Record → Speech Recognition: uses input
- Hearing Record → PDF Export: exports
- Server Process → Browser Build Shell: runtime companion
