An AI-powered healthcare consultation SaaS platform that transforms doctor visit notes into professional summaries, actionable next steps, and patient-friendly email drafts using OpenAI's advanced language models.
MediNotes Pro is a comprehensive SaaS solution designed for healthcare professionals to streamline their documentation workflow. By leveraging cutting-edge AI technology, the platform automatically generates:
- Professional Visit Summaries for medical records
- Actionable Next Steps for patient care planning
- Patient-Friendly Email Drafts for clear communication
The application features secure authentication, real-time AI streaming, and a modern, responsive interface built with the latest web technologies.
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Authentication: Clerk
- UI Components: React with custom components
- Real-time Updates: Server-Sent Events (SSE)
- Framework: FastAPI
- AI Integration: OpenAI API with streaming responses
- Authentication: Clerk JWT verification
- CORS: Configured for cross-origin requests
- Containerization: Docker
- Frontend Hosting: Vercel (recommended)
- Backend Hosting: AWS App Runner / Railway / Render
- Database: Clerk (user management)
- π Secure Authentication - Clerk-powered user management
- π€ AI-Powered Summarization - GPT-4o-mini for accurate medical content generation
- π Real-time Streaming - Live updates as AI generates content
- π± Responsive Design - Works seamlessly on desktop and mobile
- β‘ Fast Performance - Optimized Next.js with static generation
- π³ Docker Ready - Easy deployment with containerization
| Component | Technology | Purpose |
|---|---|---|
| Frontend | Next.js, TypeScript, Tailwind CSS | Modern React framework with type safety |
| Backend | FastAPI, Python | High-performance API server |
| AI | OpenAI GPT-4o-mini | Advanced language model for content generation |
| Auth | Clerk | User authentication and management |
| Styling | Tailwind CSS | Utility-first CSS framework |
| Deployment | Docker, Vercel | Containerization and hosting |
- Node.js 18+ and npm
- Python 3.12+
- Docker (optional, for containerized deployment)
- Clerk account for authentication
- OpenAI API key
-
Clone the repository
git clone https://github.com/upstackpilot0710/ai-health-consultation-platform.git cd ai-health-consultation-platform -
Install frontend dependencies
npm install
-
Install backend dependencies
cd backend pip install -r requirements.txt cd ..
-
Environment Setup
Create
.env.localin the root directory:# Clerk Authentication NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_... CLERK_SECRET_KEY=sk_test_... CLERK_JWKS_URL=https://your-domain.clerk.accounts.dev/.well-known/jwks.json # OpenAI OPENAI_API_KEY=sk-... # Backend URL (for development) NEXT_PUBLIC_API_URL=http://localhost:8000
-
Start the backend server
cd backend uvicorn server:app --reload --host 0.0.0.0 --port 8000 -
Start the frontend development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
-
Build the Docker image
docker build -t medinotes-pro . -
Run the container
docker run -p 8000:8000 \ -e NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_key \ -e OPENAI_API_KEY=your_key \ medinotes-pro
ai-healthcare-consultation-saas/
βββ backend/
β βββ server.py # FastAPI application
β βββ requirements.txt # Python dependencies
β βββ static/ # Built frontend files
βββ pages/
β βββ _app.tsx # Next.js app component
β βββ _document.tsx # Custom document
β βββ index.tsx # Landing page
β βββ product.tsx # Main application
βββ public/ # Static assets
βββ styles/
β βββ globals.css # Global styles
βββ Dockerfile # Container configuration
βββ next.config.ts # Next.js configuration
βββ package.json # Node dependencies
βββ tailwind.config.js # Tailwind configuration
βββ README.md # This file
- Create a Clerk application at clerk.com
- Configure authentication settings
- Add your domain to allowed origins
- Copy the publishable key and secret key to your environment
- Get your API key from OpenAI Platform
- Add it to your environment variables
- The app uses GPT-4o-mini for cost-effective, high-quality responses
- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push
- Use the provided Dockerfile
- Set environment variables
- Deploy to your preferred platform
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for the powerful GPT models
- Clerk for seamless authentication
- Vercel for excellent hosting platform
- Next.js for the amazing React framework
For support, email support@medinotespro.com or join our Discord community.
MediNotes Pro - Transforming healthcare documentation with AI β¨
User signs in using Clerk.
Clerk issues a JWT token.
Frontend sends JWT in Authorization header.
Backend verifies JWT using Clerk JWKS.
Access granted only to subscribed users.
π³ Subscription & Feature Gating
Premium subscription required to access idea generation.
Clerk Billing manages subscription lifecycle.
component gates premium content.
Backend validates subscription before generating AI response.
β‘ Real-Time AI Streaming
The app uses:
OpenAI streaming responses
FastAPI StreamingResponse
Server-Sent Events (SSE)
fetch-event-source on frontend
This enables real-time idea generation similar to ChatGPT-style streaming.
π Project Structure saap/ βββ pages/ β βββ index.tsx # Landing page β βββ product.tsx # Premium feature page β βββ _app.tsx # Clerk Provider β βββ _document.tsx # HTML skeleton βββ api/ β βββ index.py # FastAPI streaming backend βββ styles/ β βββ globals.css βββ README.md βββ package.json π οΈ Environment Variables
The following environment variables are required:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY= CLERK_SECRET_KEY= CLERK_JWKS_URL= OPENAI_API_KEY=
π Local Development npm install vercel dev π Production Deployment vercel --prod πΈ Demo
Add your live Vercel URL here:
https://your-vercel-app-url.vercel.app π§© Key Features
π Secure JWT-based authentication
π³ Subscription-based feature access
β‘ Real-time AI streaming
π¨ Clean UI with Tailwind Typography
π‘οΈ Backend subscription enforcement
βοΈ Cloud deployment with Vercel
π Future Improvements
Usage-based billing (token limits)
Admin dashboard
Idea history storage
User analytics
Multi-model support
π¨βπ» Author
Deepak Maurya AI/ML Engineer | GenAI Enthusiast