[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1422":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":14,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":28,"discoverSource":29},1422,"medkit-app","bedriyan\u002Fmedkit-app","bedriyan","A voice-first AI patient simulator bringing the future of medical education to your browser, built with Claude Opus 4.7.","https:\u002F\u002Fmedkit-app.vercel.app\u002F",null,"TypeScript",279,55,6,1,0,2,7,38,5.24,false,"main",true,[],"2026-06-12 02:00:27","# medkit\n\nBrowser-based ER + polyclinic clinical training simulator. You play the doctor: new patients arrive at triage, you talk to them in real time, order tests, treat, disposition. An attending physician (Claude Opus 4.7) watches and grades your decisions.\n\n> Hackathon submission. Cases are plausible but synthetic — no clinical claims.\n\n---\n\n## About\n\nMedkit is a voice-first AI patient simulator for medical students and newly graduated doctors. You take the history, order labs, read imaging, diagnose, and prescribe — talking to AI patients in real time. After each session, an attending grader powered by Claude Opus 4.7 marks your communication, history-taking, and clinical reasoning, citing published guidelines (NICE, ESC, AHA, GINA, GOLD) from a curated registry so the grading can't fabricate sources.\n\nThe format is modelled on OSCE training with standardised patients, which works well but is expensive, scheduled rarely, requires physical attendance, and isn't available in many countries — leaving most trainees globally with little or no access. Medkit makes the same kind of practice available on demand in the browser.\n\nBuilt in three days for the Opus 4.7 hackathon by a medical-doctor-turned-software-engineer ([@bedriyan](https:\u002F\u002Fgithub.com\u002Fbedriyan)), using Claude Code with Opus 4.7.\n\n---\n\n## What's inside\n\n| Layer | Tech |\n|---|---|\n| Frontend | React 18 + TypeScript + Vite, Three.js (`@react-three\u002Ffiber`, `@react-three\u002Fdrei`) |\n| Voice transport | LiveKit Cloud (WebRTC) via `livekit-client` |\n| Voice worker | Python `livekit-agents` — Deepgram Nova-3 STT → Claude Haiku 4.5 → Cartesia Sonic-2 TTS |\n| HTTP backend | FastAPI on `127.0.0.1:8787` — Managed Agents proxy + LiveKit JWT mint |\n| Attending grader | Claude **Opus 4.7** as a Managed Agent (`medkit-attending`) |\n| State | Single `Store` class with `useSyncExternalStore` (no Redux\u002FZustand) |\n\nTwo flows:\n- **ER** — multiple beds, real-time voice with each patient, tests resolve over simulated minutes.\n- **Polyclinic** — one outpatient at a time, tests resolve instantly.\n\n---\n\n## Prerequisites\n\n- **Node.js 22+** (TS files are run natively via type-stripping)\n- **Python 3.11+**\n- A modern browser with mic permission (Chrome\u002FEdge recommended for WebRTC)\n\n---\n\n## API keys you'll need\n\nAll keys are server-side only — the browser never sees them. Get one of each:\n\n| Service | What it does | Where to get it | Free tier? |\n|---|---|---|---|\n| **Anthropic** | Powers the attending grader (Opus 4.7) and patient voice persona (Haiku 4.5) | https:\u002F\u002Fconsole.anthropic.com → API Keys | Pay-as-you-go, no free tier |\n| **LiveKit Cloud** | Real-time WebRTC transport between browser ↔ voice worker | https:\u002F\u002Fcloud.livekit.io → create project → Settings → Keys (gives `URL`, `API Key`, `API Secret`) | Yes — generous free tier |\n| **Deepgram** | Streaming speech-to-text inside the voice worker | https:\u002F\u002Fconsole.deepgram.com → API Keys | Yes — $200 free credit |\n| **Cartesia** | Streaming text-to-speech inside the voice worker | https:\u002F\u002Fplay.cartesia.ai → API Keys | Yes — free credit on signup |\n\n---\n\n## Setup\n\n### 1. Frontend\n\n```bash\nnpm install\n```\n\n### 2. Backend (two separate venvs)\n\nThe FastAPI server and the LiveKit voice worker have very different dependency trees, so they each get their own venv.\n\n```bash\ncd backend\n\n# FastAPI server — small (FastAPI + Anthropic + livekit-api)\npython -m venv .venv\n.venv\u002FScripts\u002Fpython -m pip install -r requirements.txt\n\n# Voice worker — larger (livekit-agents + Deepgram\u002FCartesia\u002FSilero plugins)\npython -m venv .venv-voice\n.venv-voice\u002FScripts\u002Fpython -m pip install -r voice_agent_requirements.txt\n```\n\n> On macOS\u002FLinux replace `.venv\u002FScripts\u002Fpython` with `.venv\u002Fbin\u002Fpython`.\n\n### 3. Configure secrets\n\n```bash\ncp backend\u002F.env.example backend\u002F.env.local\n```\n\nFill in `backend\u002F.env.local`:\n\n```env\nANTHROPIC_API_KEY=sk-ant-...\nLIVEKIT_URL=wss:\u002F\u002Fyour-project.livekit.cloud\nLIVEKIT_API_KEY=APIxxxx\nLIVEKIT_API_SECRET=...\nDEEPGRAM_API_KEY=...\nCARTESIA_API_KEY=...\n\n# Leave these blank on first run — see \"Bootstrap the Managed Agent\" below\nMEDKIT_AGENT_ID=\nMEDKIT_ENV_ID=\n```\n\n### 4. Bootstrap the Managed Agent (one-time)\n\nStart the FastAPI server, then create the persistent attending agent:\n\n```bash\nbackend\u002F.venv\u002FScripts\u002Fpython backend\u002Fserver.py\n# In another terminal:\ncurl -X POST http:\u002F\u002F127.0.0.1:8787\u002Fagent\u002Fbootstrap\n```\n\nThe response contains an `agent_id` and `environment_id`. Paste them back into `backend\u002F.env.local` as `MEDKIT_AGENT_ID` \u002F `MEDKIT_ENV_ID` and **restart the server**. Subsequent runs are no-ops.\n\n---\n\n## Run (three terminals)\n\n```bash\n# Terminal 1 — frontend\nnpm run dev\n# Vite serves http:\u002F\u002Flocalhost:5173\n\n# Terminal 2 — FastAPI backend\nbackend\u002F.venv\u002FScripts\u002Fpython backend\u002Fserver.py\n# Listens on http:\u002F\u002F127.0.0.1:8787 (proxied by Vite at \u002Fagent\u002F* and \u002Fvoice\u002F*)\n\n# Terminal 3 — LiveKit voice worker\nbackend\u002F.venv-voice\u002FScripts\u002Fpython backend\u002Fvoice_agent.py dev\n# Logs \"registered worker\" once connected to LiveKit Cloud\n```\n\nAll three must be up for voice. The frontend works without the worker — you'll just lose real-time voice (text chat still works).\n\nOpen http:\u002F\u002Flocalhost:5173 and grant microphone permission when prompted.\n\n---\n\n## Useful scripts\n\n```bash\nnpm run build      # tsc + vite build\nnpm run preview    # preview production build\nnpm run verify     # deterministic invariants over src\u002Fdata\u002F* — run after editing cases\u002Ftests\u002Ftreatments\nnpm run test       # custom-tools + loop-commands tests\n```\n\n---\n\n## Project layout\n\n```\nsrc\u002F\n  game\u002F               # Store, types, single source of truth\n  data\u002F               # Patients, tests, treatments, medications, guidelines (pure data)\n  components\u002F         # React UI\n  components\u002Fthree\u002F   # Three.js scenes (ER room, polyclinic)\n  voice\u002F              # LiveKit conversation + persona builders\n  agents\u002F             # Managed Agent client + custom-tool UI renderer\nbackend\u002F\n  server.py           # FastAPI: Managed Agents proxy + \u002Fvoice\u002Ftoken\n  voice_agent.py      # LiveKit Agents worker (Deepgram → Haiku → Cartesia)\n.claude\u002Fskills\u002F       # Authoring skills (patient generator, rubric author, guideline curator, ...)\nscripts\u002Fverify\u002F       # Deterministic data-integrity checks\n```\n\n---\n\n## Model routing\n\n| Call | Model | Why |\n|---|---|---|\n| Patient voice persona | Haiku 4.5 | Fast, cheap, good enough for in-character reply |\n| `medkit-attending` grading | **Opus 4.7** | Clinical reasoning, precision matters |\n\n---\n\n## Notes\n\n- **Group policy on Windows:** scripts call `node node_modules\u002F\u003Cpkg>\u002Fbin\u002F\u003Centry>.js` instead of the `.bin` shims because some corporate machines block `.exe` wrappers under `node_modules\u002F`. Keep this pattern when adding new scripts.\n- **Prompt caching is on** in the patient-persona path — set `cache_control: { type: 'ephemeral' }` on system prompts when you add new Claude calls.\n- **Out of scope:** multi-agent handoffs, persistent user accounts, anything claiming clinical accuracy.\n\n---\n\n## License\n\nPrivate — hackathon submission. Not licensed for redistribution.\n","medkit-app是一个基于浏览器的急诊和多科室临床培训模拟器，旨在通过语音优先的人工智能技术为医学生和新医生提供实践机会。项目利用Claude Opus 4.7构建，核心功能包括实时与AI患者对话、下达检查命令、诊断及治疗，并由系统根据专业指南自动评分。采用的技术栈包括React+TypeScript前端、LiveKit Cloud进行WebRTC语音传输、Python处理语音工作流等。适合用于医学教育场景，特别是缺乏标准化病人练习资源的地方，能够随时随地提供高质量的临床技能训练体验。","2026-06-11 02:43:37","CREATED_QUERY"]