An AI-powered healthcare simulation case generator built with Next.js 14, TypeScript, and Claude AI. This application helps medical educators create realistic, educational simulation cases for healthcare training with advanced AI-generated progression scenarios.
- Conditional Branching: Create decision-based scenarios with multiple pathways
- Time-Based Evolution: Generate natural disease progression without intervention
- Complication Scenarios: Build unexpected clinical events and crisis management training
- Context-Aware Generation: Uses existing patient data for personalized scenarios
- Real-time Progress Tracking: Visual feedback during AI generation process
- AI-Powered Case Generation: Leverage Claude AI to create realistic medical simulation cases
- Multi-Step Form Interface: Intuitive case creation workflow
- Tab-Based Case Display: Organized presentation of patient information, scenarios, and learning objectives
- Timeline Visualization: Interactive timeline with expandable details and branch pathways
- Modern UI/UX: Clean, responsive design built with Tailwind CSS
- Inline Timeline System: Toggle timelines without modal interruptions
- State Management: Efficient state handling with Zustand
- Form Validation: Robust form handling with React Hook Form
- Real-time Notifications: User feedback with React Hot Toast
- TypeScript: Full type safety throughout the application
- Decision points with multiple pathways (positive/negative/neutral outcomes)
- Realistic vital sign progressions based on patient data
- Critical decision windows with clinical timing
- Patient-specific risk factors and physiological responses
- Natural disease progression modeling without intervention
- Pathophysiology-based progression patterns
- Compensatory mechanism progression and decompensation points
- Patient-specific timing variations (age, comorbidities, medications)
- Unexpected clinical events and crisis management
- Risk factor-based complications with early warning signs
- Multiple management pathway options
- Realistic complication timing and recognition challenges
- Clinical Accuracy: Evidence-based timing and pathophysiology
- Personalization: Patient-specific factors (age, medications, conditions)
- Assessment Ready: Built-in instructor notes and teaching points
- Progressive Complexity: Multiple difficulty levels available
- Framework: Next.js 14 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: Zustand
- Form Handling: React Hook Form
- AI Integration: Anthropic Claude API
- Icons: Lucide React
- Notifications: React Hot Toast
- Development: ESLint, Prettier
- Node.js 18.0.0 or higher
- npm 8.0.0 or higher
- Anthropic API key
git clone <repository-url>
cd healthcare-simnpm installCreate a .env.local file in the root directory:
cp .env.local.example .env.localUpdate the .env.local file with your actual values:
# Anthropic Claude API Configuration
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# NextAuth Configuration (for future authentication)
NEXTAUTH_SECRET=your_nextauth_secret_here
NEXTAUTH_URL=http://localhost:3000
# Application Settings
NODE_ENV=development
APP_NAME="Healthcare Simulation Case Generator"
APP_VERSION=1.2.0npm run devOpen http://localhost:3000 in your browser to see the application.
healthcare-sim/
โโโ src/
โ โโโ app/ # Next.js App Router pages
โ โ โโโ api/ # API routes
โ โ โ โโโ progression/ # AI progression generation endpoint
โ โ โโโ globals.css # Global styles
โ โ โโโ layout.tsx # Root layout
โ โ โโโ page.tsx # Home page
โ โโโ components/ # React components
โ โ โโโ ui/ # Reusable UI components
โ โ โโโ forms/ # Form components
โ โ โโโ progression/ # AI progression scenario components
โ โ โโโ layout/ # Layout components
โ โโโ lib/ # Library configurations
โ โ โโโ anthropic.ts # Claude AI integration
โ โโโ stores/ # Zustand stores
โ โ โโโ useAppStore.ts # Main application store
โ โโโ types/ # TypeScript type definitions
โ โ โโโ index.ts # Main types
โ โ โโโ progression.ts # Progression scenario types
โ โโโ utils/ # Utility functions
โ โโโ constants.ts # Application constants
โ โโโ helpers.ts # Helper functions
โโโ public/ # Static assets
โโโ AI_GENERATION_PROMPTS.md # Expert AI prompts for scenario generation
โโโ PROGRESSION_TAB_README.md # Detailed progression system documentation
โโโ CHANGELOG.md # Version history and updates
โโโ .env.local # Environment variables
โโโ package.json # Dependencies and scripts
โโโ tailwind.config.js # Tailwind CSS configuration
โโโ tsconfig.json # TypeScript configuration
โโโ README.md # Project documentation
- Navigate to Progression Tab in any case
- Click "Create New Progression Scenario"
- Choose scenario type: Conditional Branching, Time-Based Evolution, or Complication
- Select "Generate with AI"
- Configure parameters:
- Duration (15-120 minutes)
- Complexity level (Simple/Moderate/Complex)
- Specific settings per scenario type
- AI generates complete scenario with realistic clinical timing
- View timeline inline with expandable details
- Click "Timeline" button to toggle inline display
- View Timeline Summary for quick overview (event counts, severity stats)
- Expand sections individually (Main Timeline, Branch Details)
- Clinical accuracy with evidence-based progressions
npm run dev- Start development server with Turbopacknpm run build- Build the application for productionnpm run start- Start the production servernpm run lint- Run ESLintnpm run lint:fix- Fix ESLint errors automaticallynpm run type-check- Run TypeScript type checkingnpm run format- Format code with Prettiernpm run format:check- Check code formattingnpm run clean- Clean build artifacts
- Push your code to a Git repository
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard:
ANTHROPIC_API_KEYNEXTAUTH_SECRETNEXTAUTH_URL(set to your production URL)
- Deploy
The application can be deployed to any platform that supports Next.js:
- Netlify
- AWS Amplify
- Railway
- Render
| Variable | Description | Required |
|---|---|---|
ANTHROPIC_API_KEY |
Your Anthropic Claude API key | Yes |
NEXTAUTH_SECRET |
Secret for NextAuth.js (future use) | No |
NEXTAUTH_URL |
Base URL for authentication | No |
NODE_ENV |
Environment (development/production) | No |
Recent successful testing (June 2025):
โ
AI generated: "Time-Based Evolution: Early Sepsis from UTI - Elderly Diabetic"
โ
API endpoint responding correctly (/api/progression/generate)
โ
Case data integration working (hasContextData: true)
โ
Real-time generation logging active
โ
Complete scenario created with timeline data
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Contact the development team
- User authentication and authorization
- Advanced scenario analytics and usage tracking
- Scenario sharing between instructors
- Integration with Learning Management Systems (LMS)
- Mobile application
- Multi-language support
- Enhanced AI prompts with specialty-specific templates
- Peer review system
- Assessment integration with automatic scoring
๐ฏ Production Ready: Complete AI generation integration functional with all three scenario types working, dev server running successfully, and real-time AI scenario generation operational using expertly crafted medical education prompts.
Built with โค๏ธ for healthcare education