A fast, mobile-first medical assistant app that helps medical students and junior doctors take complete, system-specific histories from patients. Simply enter a diagnosis and get a structured breakdown of all relevant questions to ask.
- 🔍 Instant History Templates: Type in any diagnosis and get comprehensive question lists
- 🏥 Specialty-Specific: Automatically infers clinical specialty and adapts questions accordingly
- 📋 Structured Format: Organized by standard medical history sections (HPC, PMH, Drug History, etc.)
- 📱 Mobile-First: Optimized for use during clinical rounds
- ⚡ Lightning Fast: Cached results for instant access to common conditions
- 📋 Easy Copy: One-click copying of sections or entire templates
- 🔒 Offline Support: Recent searches available without internet
- Frontend: Next.js 14 with TypeScript
- UI: shadcn/ui components with Tailwind CSS
- Backend: Next.js API routes
- Database: Supabase (PostgreSQL)
- AI: OpenAI GPT-4
- Deployment: Vercel (recommended)
- Node.js 18+ and npm
- Supabase account
- OpenAI API key
```bash git clone cd clerksmart npm install ```
Copy the environment template:
```bash cp env.example .env.local ```
Fill in your environment variables in `.env.local`:
```env
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key SUPABASE_PROJECT_ID=your_supabase_project_id
OPENAI_API_KEY=your_openai_api_key
NEXT_PUBLIC_APP_URL=http://localhost:3000 ```
- Create a new Supabase project
- Run the schema file in your Supabase SQL editor:
```bash
```
- Generate TypeScript types (optional):
```bash npm run db:generate ```
```bash npm run dev ```
Open http://localhost:3000 in your browser.
``` src/ ├── app/ # Next.js 13+ app directory │ ├── api/ # API routes │ │ └── generate-template/ # Template generation endpoint │ ├── globals.css # Global styles │ ├── layout.tsx # Root layout │ └── page.tsx # Home page ├── components/ # React components │ ├── history/ # History display components │ ├── search/ # Search interface components │ └── ui/ # shadcn/ui components ├── hooks/ # Custom React hooks ├── lib/ # Utility libraries │ ├── openai.ts # OpenAI integration │ ├── supabase.ts # Supabase client │ └── utils.ts # Helper functions └── types/ # TypeScript type definitions ├── index.ts # Main types └── supabase.ts # Database types ```
- Search for Diagnosis: Enter any medical condition in the search bar
- View Results: Get a comprehensive history template organized by sections
- Copy Questions: Click on any section to copy questions to clipboard
- Copy All: Use "Copy All" to get the complete template
- Go Back: Return to search for another condition
- "Acute appendicitis"
- "Myocardial infarction"
- "Pneumonia"
- "Heart failure"
- "Diabetes mellitus"
- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push to main branch
```bash npm run build npm start ```
The app uses GPT-4 with optimized prompts for medical accuracy. You can modify the system prompt in `src/lib/openai.ts`.
The app uses two main tables:
- `diagnoses`: Store common medical conditions
- `history_templates`: Cache generated templates for faster access
- Templates are automatically cached after first generation
- Cache is checked before making new OpenAI requests
- Popular templates are served instantly from cache
- Fork the repository
- Create a feature branch (`git checkout -b feature/amazing-feature`)
- Commit your changes (`git commit -m 'Add amazing feature'`)
- Push to the branch (`git push origin feature/amazing-feature`)
- Open a Pull Request
- `npm run dev`: Start development server
- `npm run build`: Build for production
- `npm run start`: Start production server
- `npm run lint`: Run ESLint
- `npm run type-check`: Check TypeScript types
- `npm run db:generate`: Generate Supabase types
- TypeScript for type safety
- ESLint + Prettier for code formatting
- Tailwind CSS for styling
- shadcn/ui for components
This project is licensed under the MIT License - see the LICENSE file for details.
This app is designed to assist medical education and should not be used as a substitute for clinical judgment. Always verify information independently and adapt questions based on patient presentation and clinical context.
For support, please open an issue on GitHub or contact the development team.
Made with ❤️ for medical students and junior doctors