medcards-ai/README.md
AI-powered medical residency exam preparation platform for Brazilian medical students
MEDCARDS.AI is not a traditional course platform. It's an intelligent study companion that adapts to each student's learning journey, delivering personalized clinical case training powered by Claude AI.
Students don't access modules or lessons. They engage with an AI coach that knows:
Three core screens:
Frontend: Next.js 14 (App Router) + Tailwind CSS + Shadcn UI
Backend: Next.js Server Actions (no separate backend)
Database: Supabase (PostgreSQL with RLS)
AI: Anthropic Claude Sonnet 4 API
Deploy: Vercel (one-click deployment)
Deploy time: 30 minutes from zero to production.
medcards-ai/
βββ src/
β βββ app/ # Next.js App Router
β β βββ (auth)/ # Authentication routes
β β βββ dashboard/ # Battle Dashboard
β β βββ arena/ # Training Arena
β β βββ war-room/ # AI Tutor Chat
β β βββ layout.tsx # Root layout
β βββ components/ # React components
β β βββ ui/ # Shadcn UI components
β β βββ dashboard/ # Dashboard-specific
β β βββ arena/ # Arena-specific
β β βββ shared/ # Shared components
β βββ lib/ # Core business logic
β β βββ ai/ # Claude AI integration
β β β βββ claude.ts # AI functions (coach, feedback, tutor)
β β βββ supabase/ # Database utilities
β β β βββ client.ts # Supabase clients
β β βββ adaptive/ # Adaptive engine logic
β β βββ gamification/ # Badges & progression
β β βββ utils/ # Helpers
β βββ types/ # TypeScript types
β βββ database.ts # Database schema types
βββ supabase/
β βββ schema.sql # Database schema
β βββ seed-cases.sql # Initial clinical cases
β βββ migrations/ # Database migrations
βββ prompts/
β βββ coach-prompt.md # AI Coach instructions
β βββ feedback-prompt.md # AI Feedback generator
β βββ tutor-prompt.md # AI Tutor (chat)
βββ public/ # Static assets
βββ .env.example # Environment template
βββ package.json
βββ tsconfig.json
βββ tailwind.config.ts
βββ README.md
git clone <repository-url>
cd medcards-ai
npm install
# Copy schema to Supabase SQL Editor and run
cat supabase/schema.sql
cat supabase/seed-cases.sql
cp .env.example .env.local
Edit .env.local:
NEXT_PUBLIC_SUPABASE_URL=your-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
ANTHROPIC_API_KEY=sk-ant-your-api-key
npm run dev
# Connect to Vercel
npx vercel
# Deploy
npx vercel --prod
Add environment variables in Vercel dashboard.
Done. Your platform is live.
Purpose: Select next optimal case for each student
Algorithm:
1. Calculate competency by specialty (weighted by recency)
2. Identify gaps (success_rate < 65%)
3. Select next case:
- 60%: Address critical gaps
- 30%: Reinforce strengths
- 10%: Explore new areas
4. Claude AI validates selection and prepares coaching
Location: src/lib/adaptive/engine.ts
Three Specialized Prompts:
Coach Prompt (prompts/coach-prompt.md)
Feedback Prompt (prompts/feedback-prompt.md)
Tutor Prompt (prompts/tutor-prompt.md)
Integration: src/lib/ai/claude.ts
Badges:
Progression:
Location: src/lib/gamification/
users
clinical_cases
interactions
chat_history
badges + user_badges
Full schema: supabase/schema.sql
#0A2463): Medical trust, main actions#06D6A0): Success, correct answers#EF4444): Errors, critical alertsMathematical scale (8px base): 8, 16, 24, 32, 48, 64 Creates subconscious visual consistency.
Config: tailwind.config.ts
8 weeks to MVP (following spec in CLAUDE.md):
# Development
npm run dev # Start dev server
npm run build # Production build
npm run type-check # TypeScript validation
npm run lint # ESLint
# Database
npm run db:migrate # Run migrations (if using Supabase CLI)
npm run db:seed # Seed initial cases
# Deployment
npx vercel --prod # Deploy to production
Track only these four weekly:
Retention Day 7: % users returning after 1 week
Cases per Session: How many cases per study session
Time to First Win: Minutes until first 3-case streak
Conversion FreeβPaid: % paying after 50 cases
Ignore: Total users, page views, time on app (vanity metrics)
Manual testing during development (indie hacker MVP approach)
Philosophy: Ship fast, test what breaks in production, then add tests.
| File | Purpose |
|---|---|
supabase/schema.sql | Complete database schema |
prompts/coach-prompt.md | AI case selection instructions |
prompts/feedback-prompt.md | AI answer analysis instructions |
prompts/tutor-prompt.md | AI chat conversation instructions |
src/lib/ai/claude.ts | Claude API integration |
src/lib/supabase/client.ts | Database utilities |
src/types/database.ts | TypeScript type definitions |
tailwind.config.ts | Design system configuration |
This is an indie hacker project optimized for solo development. Contributions welcome but keep these principles:
[Add your license here]
MEDCARDS.AI is built by developers who understand:
Our mission: Get you approved with minimum study time and maximum confidence.
Start training: [Deploy your instance or visit medcards.ai]
Built with β€οΈ for Brazilian medical residents
Stack: Next.js 14 β’ Supabase β’ Claude AI β’ Vercel