Lexiverse
Lexiverse - AI contextual reading engine for English learners. Your next article is your next review.
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗AI-Powered Clinical Simulation Platform for Medical Students
Practice patient consultations, order diagnostics, and develop clinical reasoning — before your first real patient.
🌐 Live at medikarya.in
MediKarya is a clinical education platform built for MBBS and medical students in India. It places students in the role of a doctor, facing a structured virtual patient case. Students conduct a simulated consultation via an AI-powered patient, order investigations from a real test library, submit a diagnosis and management plan, and receive detailed, scored feedback.
The platform is designed to reinforce structured clinical reasoning, patient safety awareness, and diagnostic discipline — with formative feedback that mimics the rigour of faculty assessment.
100dvh simulation UI and safe-area padding| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS v4 + Radix UI primitives |
| Authentication | Clerk |
| Database | Supabase (PostgreSQL) |
| AI | Google Gemini (gemini-3.1-flash-lite for patient chat and quizzes, gemini-3.8-flash for classic-case evaluation) |
| Payments | Razorpay Subscriptions |
| Animations | Framer Motion + CSS |
| Smooth Scroll | Lenis |
| PWA | Serwist (@serwist/next) |
| Analytics | Vercel Speed Insights + Microsoft Clarity |
| Deployment | Self-hosted VPS / Vercel-compatible |
medikarya/
├── app/ # Next.js App Router pages & API routes
│ ├── page.tsx # Landing page (/)
│ ├── layout.tsx # Root layout (Clerk, fonts, analytics, JSON-LD)
│ ├── dashboard/ # Authenticated student area
│ │ └── cases/ # Case library + individual case pages
│ ├── admin/ # Admin panel (role-restricted)
│ ├── login/ & signup/ # Clerk authentication pages
│ ├── contact/ contribute/ # Marketing & community pages
│ ├── blog/ tutorials/ # Content pages
│ ├── early-contributors/ # Founding contributor recognition page
│ └── api/ # API routes
│ ├── cases/ # GET /api/cases, GET /api/cases/[id]
│ ├── chat/patient/ # POST patient chat + GET opening line
│ ├── tests/ # POST generate test result
│ ├── payments/ # Razorpay: create/verify/cancel subscription, webhook
│ ├── plan/ # GET the signed-in student's plan and today's usage
│ └── clerk-webhook/ # POST Clerk user creation webhook
│
├── components/ # Shared React components
│ ├── cases/ # Simulation UI (chat, test ordering, feedback)
│ └── ui/ # Radix UI-based design system components
│
├── engine/ # Evaluation & chat engine
│ ├── chatEngine.ts # Patient chat orchestrator
│ └── evaluation/
│ ├── EvaluationEngine.ts # 4-layer evaluation orchestrator
│ ├── DeterministicScorer.ts # Algorithmic test + history scoring
│ ├── IntentExtractor.ts # Clinical intent mapping & specificity
│ ├── ReasoningPromptBuilder.ts # LLM prompt construction
│ └── types.ts # Shared TypeScript interfaces
│
├── cases/
│ └── lib/red-flag-detector.ts # Tiered red flag penalty resolution
│
├── data/
│ └── cases/index.ts # All case data + CaseData type definition
│
├── app/actions/
│ └── evaluate.ts # Server action: run evaluation + persist to Supabase
│
├── hooks/ # Custom React hooks
├── lib/ # Utilities: Supabase client, simulation engine (lib/simulation),
│ # plan rules and access (lib/plans), payments (lib/payments)
├── types/ # Global TypeScript type definitions
└── public/ # Static assets
git clone https://github.com/your-org/medikarya.git
cd medikarya
npm install
Create a .env.local file in the project root:
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Clerk (Authentication)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_...
CLERK_SECRET_KEY=sk_...
CLERK_WEBHOOK_SECRET=whsec_...
# Clerk redirect paths
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/login
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/signup
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
# Supabase (server-side only)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SECRET_KEY=...
# Google Gemini (patient chat, evaluation, quizzes)
GEMINI_API_KEY=AIza...
# Razorpay. Test and live mode are separate: keys, plans and webhooks all differ.
RAZORPAY_KEY_ID=rzp_test_...
RAZORPAY_KEY_SECRET=...
NEXT_PUBLIC_RAZORPAY_KEY_ID=rzp_test_...
RAZORPAY_WEBHOOK_SECRET=...
# One Razorpay plan per tier and billing period
RAZORPAY_PLAN_ID_INTERN=plan_...
RAZORPAY_PLAN_ID_RESIDENT=plan_...
RAZORPAY_PLAN_ID_INTERN_YEARLY=plan_...
RAZORPAY_PLAN_ID_RESIDENT_YEARLY=plan_...
npm run dev
Open http://localhost:3000.
The main tables (SQL for the newer ones is in scripts/, run in the Supabase SQL editor):
user_profiles
Stores user metadata synced from Clerk via webhook: user_id, email, name, role (student | admin), total_xp, current_streak, longest_streak, last_active_date.
case_attempts
Stores every completed evaluation: user_id, case_id, score, xp_earned, time_taken, feedback_json (full structured result), completed_at.
cases — the case library (case_json); a row wins over a bundled JSON file with the same id.
subscriptions — one row per Razorpay subscription (scripts/create_subscriptions_table.sql, scripts/add_subscription_cancel_at.sql).
case_starts — one row per student, case and day, which the plan limits count (scripts/create_case_starts_table.sql).
All cases live in data/cases/index.ts as a TypeScript array. To add a new case:
cases array conforming to the CaseData typeevaluation_config (required history, test classifications, accepted diagnoses, red flags)For full field-by-field documentation, see CASE_SYSTEM_README.md.
The scoring pipeline runs across 4 layers:
| Layer | Mechanism | Domains Scored |
|---|---|---|
| 1 — Intent Extraction | Rule-based NLP | Maps questions to clinical intents; scores specificity & redundancy |
| 2 — Deterministic Scoring | Algorithmic | Test ordering (0–20 pts) + 70% of History (0–17.5 pts) |
| 3 — LLM Scoring | Google Gemini | Clinical Reasoning (30), Diagnosis (15), Management (10), History Q (0–7.5) |
| 4 — Safety Penalties | Hybrid rule + LLM | Red flag missed penalty (−2 to −5 per flag) |
Total: 100 marks across Clinical Reasoning (30), History (25), Diagnosis (15), Testing (20), Management (10), minus safety penalties.
For the full technical and pedagogical reference, see EVALUATION_ENGINE.md.
| Document | Contents |
|---|---|
CASE_SYSTEM_README.md | Complete case flow, data architecture, API routes, components, and guide to adding new cases |
EVALUATION_ENGINE.md | Detailed scoring rubric, intent extraction, deterministic + LLM layers, red flag system, and design philosophy |
AI_INTEGRATION_GUIDE.md | Guide to the AI integrations and how to extend or replace the LLM layer |
npm run dev # Start development server (Turbopack; restarts itself if it grows heavy, see scripts/dev.mjs)
npm run dev:webpack # Same, on webpack
npm run build # Production build
npm run start # Start production server
npm run lint # Run ESLint
This project is private and proprietary. All rights reserved by the MediKarya team.
MediKarya v2.0 — April 2026
Built for medical students in India. Made with ❤️ and clinical rigour.