Skip to content

upstackpilot0710/ai-health-consultation-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MediNotes Pro

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 Next.js FastAPI OpenAI Clerk

πŸš€ Overview

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.

πŸ—οΈ Architecture

Frontend

  • 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)

Backend

  • Framework: FastAPI
  • AI Integration: OpenAI API with streaming responses
  • Authentication: Clerk JWT verification
  • CORS: Configured for cross-origin requests

Deployment

  • Containerization: Docker
  • Frontend Hosting: Vercel (recommended)
  • Backend Hosting: AWS App Runner / Railway / Render
  • Database: Clerk (user management)

✨ Features

  • πŸ” 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

πŸ› οΈ Tech Stack

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

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Python 3.12+
  • Docker (optional, for containerized deployment)
  • Clerk account for authentication
  • OpenAI API key

Local Development

  1. Clone the repository

    git clone https://github.com/upstackpilot0710/ai-health-consultation-platform.git
    cd ai-health-consultation-platform
  2. Install frontend dependencies

    npm install
  3. Install backend dependencies

    cd backend
    pip install -r requirements.txt
    cd ..
  4. Environment Setup

    Create .env.local in 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
  5. Start the backend server

    cd backend
    uvicorn server:app --reload --host 0.0.0.0 --port 8000
  6. Start the frontend development server

    npm run dev
  7. Open your browser

    Navigate to http://localhost:3000

Docker Deployment

  1. Build the Docker image

    docker build -t medinotes-pro .
  2. Run the container

    docker run -p 8000:8000 \
      -e NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_key \
      -e OPENAI_API_KEY=your_key \
      medinotes-pro

πŸ“ Project Structure

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

πŸ”§ Configuration

Clerk Setup

  1. Create a Clerk application at clerk.com
  2. Configure authentication settings
  3. Add your domain to allowed origins
  4. Copy the publishable key and secret key to your environment

OpenAI Setup

  1. Get your API key from OpenAI Platform
  2. Add it to your environment variables
  3. The app uses GPT-4o-mini for cost-effective, high-quality responses

πŸš€ Deployment

Frontend (Vercel)

  1. Connect your GitHub repository to Vercel
  2. Add environment variables in Vercel dashboard
  3. Deploy automatically on push

Backend (Railway/AWS App Runner)

  1. Use the provided Dockerfile
  2. Set environment variables
  3. Deploy to your preferred platform

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • OpenAI for the powerful GPT models
  • Clerk for seamless authentication
  • Vercel for excellent hosting platform
  • Next.js for the amazing React framework

πŸ“ž Support

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=

⚠️ Never commit .env files to GitHub.

πŸš€ 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

About

AI-powered healthcare consultation SaaS that enables users to receive medical guidance, analyze symptoms, and interact with an intelligent health assistant through a modern web platform.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors