# yashrawate/trial architecture

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

- Interactive diagram: https://gitdiagram.com/yashrawate/trial
- Repository: https://github.com/yashrawate/trial

## Overview

AdmitAI combines an admissions CRM with Priya, a multilingual voice-calling agent. The principal workflow is a prospective student’s call: speech is processed into a response, admission details and visit preferences are collected, and call information is synchronized to CRM views. The repository also includes broader CRM capabilities for leads, applications, marketing, competitive intelligence, analytics, and reporting. Evidence is uneven: README relationships and sampled imports support the main connections; unsampled subsystems are represented by their exact enclosing directories without speculative internal links.

Main entry points: [`crm/priya-livekit/agent.py`](https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/agent.py) (Priya voice agent), [`crm/frontend/src/App.jsx`](https://github.com/yashrawate/trial/blob/main/crm/frontend/src/App.jsx) (CRM dashboard), [`crm/backend/server.js`](https://github.com/yashrawate/trial/blob/main/crm/backend/server.js) (Backend API), [`crm/frontend/src/pages`](https://github.com/yashrawate/trial/tree/main/crm/frontend/src/pages) (CRM views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["CRM experience"]
  node_browser["CRM dashboard<br/>[App.jsx]"]
  node_crmviews["CRM views"]
  node_state["Client state<br/>[useStore.js]"]
  node_crmapi["CRM API client<br/>[crmApi.js]"]
  node_priyaapi["Priya API client<br/>[priyaApi.js]"]
end

subgraph group_backend["CRM backend"]
  node_server["Backend API<br/>[server.js]"]
  node_crmroute["Unified CRM routes<br/>[unifiedCrm.js]"]
  node_webhook["Call webhook<br/>[priyaWebhook.js]"]
  node_mongo[("MongoDB<br/>[db.js]")]
end

subgraph group_voice["Voice runtime"]
  node_voiceagent["Priya voice agent<br/>[agent.py]"]
  node_telephony["Twilio and LiveKit"]
  node_audio["Audio and interruption"]
  node_speech["Speech services<br/>[sarvam.js]"]
end

subgraph group_conversation["Conversation intelligence"]
  node_session["Session management<br/>[session_manager.py]"]
  node_context["Context and memory<br/>[context_engine.py]"]
  node_language["Language handling"]
  node_llm["LLM and call flow<br/>[groqService.js]"]
end

subgraph group_knowledge["Knowledge and analytics"]
  node_knowledgebase["University knowledge<br/>[university_data.py]"]
  node_rag["Retrieval and vectors<br/>[ragStore.js]"]
  node_admissions["Admission workflows"]
  node_marketing["Marketing workflows<br/>[marketing.js]"]
  node_competitive["Competitive intelligence<br/>[competitive.js]"]
  node_analytics["Analytics and reports<br/>[analytics.js]"]
end

node_student(("Prospective student"))

node_student -->|"calls"| node_telephony
node_telephony -->|"streams audio"| node_voiceagent
node_voiceagent -->|"uses speech"| node_speech
node_voiceagent -.->|"reasons with"| node_llm
node_voiceagent -->|"consults facts"| node_knowledgebase
node_voiceagent -.->|"manages sessions"| node_session
node_voiceagent -.->|"processes audio"| node_audio
node_voiceagent -->|"handles languages"| node_language
node_session -.->|"tracks context"| node_context
node_llm -->|"retrieves context"| node_rag
node_browser -->|"routes users"| node_crmviews
node_crmviews -->|"reads state"| node_state
node_state -->|"loads calls"| node_priyaapi
node_browser -->|"uses CRM API"| node_crmapi
node_crmapi -->|"REST requests"| node_server
node_priyaapi -->|"dashboard sync"| node_server
node_server -->|"mounts routes"| node_crmroute
node_server -->|"mounts webhook"| node_webhook
node_webhook -->|"receives call data"| node_voiceagent
node_server -->|"connects database"| node_mongo
node_crmroute -.->|"persists CRM data"| node_mongo
node_browser -.->|"manages admissions"| node_admissions
node_browser -.->|"manages campaigns"| node_marketing
node_browser -.->|"views competitors"| node_competitive
node_browser -.->|"views reporting"| node_analytics

click node_browser "https://github.com/yashrawate/trial/blob/main/crm/frontend/src/App.jsx"
click node_crmviews "https://github.com/yashrawate/trial/tree/main/crm/frontend/src/pages"
click node_state "https://github.com/yashrawate/trial/blob/main/crm/frontend/src/store/useStore.js"
click node_crmapi "https://github.com/yashrawate/trial/blob/main/crm/frontend/src/lib/crmApi.js"
click node_priyaapi "https://github.com/yashrawate/trial/blob/main/crm/frontend/src/lib/priyaApi.js"
click node_server "https://github.com/yashrawate/trial/blob/main/crm/backend/server.js"
click node_crmroute "https://github.com/yashrawate/trial/blob/main/crm/backend/routes/unifiedCrm.js"
click node_webhook "https://github.com/yashrawate/trial/blob/main/crm/backend/routes/priyaWebhook.js"
click node_mongo "https://github.com/yashrawate/trial/blob/main/crm/backend/config/db.js"
click node_voiceagent "https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/agent.py"
click node_audio "https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/priya/audio/acoustic_pipeline.py"
click node_speech "https://github.com/yashrawate/trial/blob/main/crm/backend/services/sarvam.js"
click node_session "https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/session_manager.py"
click node_context "https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/priya/memory/context_engine.py"
click node_language "https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/language_handler.py"
click node_llm "https://github.com/yashrawate/trial/blob/main/crm/backend/services/groqService.js"
click node_knowledgebase "https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/university_data.py"
click node_rag "https://github.com/yashrawate/trial/blob/main/crm/backend/services/ragStore.js"
click node_admissions "https://github.com/yashrawate/trial/blob/main/crm/backend/routes/studentRegistrations.js"
click node_marketing "https://github.com/yashrawate/trial/blob/main/crm/backend/routes/marketing.js"
click node_competitive "https://github.com/yashrawate/trial/blob/main/crm/backend/routes/competitive.js"
click node_analytics "https://github.com/yashrawate/trial/blob/main/crm/backend/routes/analytics.js"

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,node_crmviews,node_state,node_crmapi,node_priyaapi toneBlue
class node_server,node_crmroute,node_webhook,node_mongo toneAmber
class node_voiceagent,node_telephony,node_audio,node_speech toneMint
class node_session,node_context,node_language,node_llm toneRose
class node_knowledgebase,node_rag,node_admissions,node_marketing,node_competitive,node_analytics,node_student toneIndigo
```

## Components

### CRM experience

- [CRM dashboard](https://github.com/yashrawate/trial/blob/main/crm/frontend/src/App.jsx): `crm/frontend/src/App.jsx`
- [CRM views](https://github.com/yashrawate/trial/tree/main/crm/frontend/src/pages): `crm/frontend/src/pages`
- [Client state](https://github.com/yashrawate/trial/blob/main/crm/frontend/src/store/useStore.js): `crm/frontend/src/store/useStore.js`
- [CRM API client](https://github.com/yashrawate/trial/blob/main/crm/frontend/src/lib/crmApi.js): `crm/frontend/src/lib/crmApi.js`
- [Priya API client](https://github.com/yashrawate/trial/blob/main/crm/frontend/src/lib/priyaApi.js): `crm/frontend/src/lib/priyaApi.js`

### CRM backend

- [Backend API](https://github.com/yashrawate/trial/blob/main/crm/backend/server.js): `crm/backend/server.js`
- [Unified CRM routes](https://github.com/yashrawate/trial/blob/main/crm/backend/routes/unifiedCrm.js): `crm/backend/routes/unifiedCrm.js`
- [Call webhook](https://github.com/yashrawate/trial/blob/main/crm/backend/routes/priyaWebhook.js): `crm/backend/routes/priyaWebhook.js`
- [MongoDB](https://github.com/yashrawate/trial/blob/main/crm/backend/config/db.js): `crm/backend/config/db.js`

### Voice runtime

- [Priya voice agent](https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/agent.py): `crm/priya-livekit/agent.py`
- **Twilio and LiveKit**
- [Audio and interruption](https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/priya/audio/acoustic_pipeline.py): `crm/priya-livekit/priya/audio/acoustic_pipeline.py`
- [Speech services](https://github.com/yashrawate/trial/blob/main/crm/backend/services/sarvam.js): `crm/backend/services/sarvam.js`

### Conversation intelligence

- [Session management](https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/session_manager.py): `crm/priya-livekit/session_manager.py`
- [Context and memory](https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/priya/memory/context_engine.py): `crm/priya-livekit/priya/memory/context_engine.py`
- [Language handling](https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/language_handler.py): `crm/priya-livekit/language_handler.py`
- [LLM and call flow](https://github.com/yashrawate/trial/blob/main/crm/backend/services/groqService.js): `crm/backend/services/groqService.js`

### Knowledge and analytics

- [University knowledge](https://github.com/yashrawate/trial/blob/main/crm/priya-livekit/university_data.py): `crm/priya-livekit/university_data.py`
- [Retrieval and vectors](https://github.com/yashrawate/trial/blob/main/crm/backend/services/ragStore.js): `crm/backend/services/ragStore.js`
- [Admission workflows](https://github.com/yashrawate/trial/blob/main/crm/backend/routes/studentRegistrations.js): `crm/backend/routes/studentRegistrations.js`
- [Marketing workflows](https://github.com/yashrawate/trial/blob/main/crm/backend/routes/marketing.js): `crm/backend/routes/marketing.js`
- [Competitive intelligence](https://github.com/yashrawate/trial/blob/main/crm/backend/routes/competitive.js): `crm/backend/routes/competitive.js`
- [Analytics and reports](https://github.com/yashrawate/trial/blob/main/crm/backend/routes/analytics.js): `crm/backend/routes/analytics.js`

### Other components

- **Prospective student**

## Connections

- Prospective student → Twilio and LiveKit: calls (evidence: `README.md`)
- Twilio and LiveKit → Priya voice agent: streams audio (evidence: `README.md`)
- Priya voice agent → Speech services: uses speech (evidence: `README.md`)
- Priya voice agent → LLM and call flow: reasons with
- Priya voice agent → University knowledge: consults facts (evidence: `README.md`)
- Priya voice agent → Session management: manages sessions
- Priya voice agent → Audio and interruption: processes audio
- Priya voice agent → Language handling: handles languages (evidence: `README.md`)
- Session management → Context and memory: tracks context
- LLM and call flow → Retrieval and vectors: retrieves context (evidence: `crm/backend/services/groqService.js`)
- CRM dashboard → CRM views: routes users (evidence: `crm/frontend/src/App.jsx`)
- CRM views → Client state: reads state (evidence: `crm/frontend/src/pages/Analytics/index.jsx`)
- Client state → Priya API client: loads calls (evidence: `crm/frontend/src/store/useStore.js`)
- CRM dashboard → CRM API client: uses CRM API
- CRM API client → Backend API: REST requests (evidence: `README.md`)
- Priya API client → Backend API: dashboard sync (evidence: `README.md`)
- Backend API → Unified CRM routes: mounts routes (evidence: `crm/backend/server.js`)
- Backend API → Call webhook: mounts webhook (evidence: `crm/backend/server.js`)
- Call webhook → Priya voice agent: receives call data (evidence: `README.md`)
- Backend API → MongoDB: connects database (evidence: `crm/backend/server.js`)
- Unified CRM routes → MongoDB: persists CRM data
- CRM dashboard → Admission workflows: manages admissions
- CRM dashboard → Marketing workflows: manages campaigns
- CRM dashboard → Competitive intelligence: views competitors
- CRM dashboard → Analytics and reports: views reporting
