Overview
This guide covers the complete installation process for MedMitra, including development and production environments. MedMitra consists of two main components:- Backend: FastAPI-based Python application with AI agents
- Frontend: Next.js 14 application with TypeScript and Tailwind CSS
System Requirements
Hardware Requirements
Development
- 4GB RAM minimum
- 2 CPU cores
- 5GB free disk space
Production
- 8GB RAM recommended
- 4 CPU cores
- 20GB free disk space
Software Requirements
- Required
- Recommended
- Node.js: 18.x or 20.x LTS
- Python: 3.9, 3.10, 3.11, or 3.13+
- npm / yarn / pnpm: Latest stable version
- pip: Python package manager (included with Python)
- Git: For cloning the repository
Backend Installation
Step 1: Clone the Repository
Step 2: Set Up Python Environment
- Using venv (Standard)
- Using uv (Fast)
Create and activate a virtual environment:
macOS/Linux
Windows
Your terminal prompt should change to show
(venv) when activated.Step 3: Install Python Dependencies
Core Framework
Core Framework
fastapi==0.115.13- Web frameworkuvicorn==0.34.3- ASGI serverpydantic==2.11.7- Data validationpython-multipart==0.0.20- File upload support
AI & ML
AI & ML
langchain-core==0.3.66- LLM frameworklanggraph==0.4.10- Workflow orchestrationlangchain-groq==0.3.4- Groq LLM integrationllama-cloud==0.1.29- LlamaParse document parsinggroq==0.29.0- Groq API client
Database & Storage
Database & Storage
supabase==2.16.0- Supabase clientpostgrest==1.1.1- PostgreSQL REST clientstorage3==0.12.0- File storage
Utilities
Utilities
python-dotenv==1.0.1- Environment variable managementaiofiles==24.1.0- Async file operationsrequests==2.32.3- HTTP library
Step 4: Configure Environment Variables
Create a.env file in the backend/ directory:
backend/.env
Step 5: Verify Backend Installation
Start the development server:Frontend Installation
Step 1: Navigate to Frontend Directory
Step 2: Install Node.js Dependencies
Installation may take 2-5 minutes depending on your internet connection.
Core Framework
Core Framework
next@latest- React framework with Turbopack[email protected]- UI library[email protected]- Type safety
UI Components
UI Components
@radix-ui/react-*- Accessible component primitives[email protected]- Icon library[email protected]- Utility-first CSS[email protected]- Dark mode support
Backend Integration
Backend Integration
@supabase/supabase-js@latest- Supabase client@supabase/ssr@latest- Server-side rendering support
Utilities
Utilities
[email protected]- CSS variant utilities[email protected]- Conditional classnames[email protected]- Merge Tailwind classes
Step 3: Configure Environment Variables
Create a.env.local file in the frontend/ directory:
frontend/.env.local
In production, update
NEXT_PUBLIC_FASTAPI_BACKEND_URL to your deployed backend URL.Step 4: Verify Frontend Installation
Start the development server:http://localhost:3000 in your browser to see the MedMitra login page.
Database Setup
MedMitra uses Supabase (PostgreSQL) for data storage. You need to create the required database schema.Step 1: Create Supabase Project
- Visit supabase.com and sign in
- Click “New Project”
- Choose a project name, database password, and region
- Wait for the project to be provisioned (1-2 minutes)
Step 2: Get API Credentials
Step 3: Create Database Tables
Go to SQL Editor in your Supabase dashboard and run the following:- Cases Table
- Case Files Table
- AI Insights Table
- All Tables (Complete)
Step 4: Configure Storage Buckets
MedMitra uses Supabase Storage for file uploads:Create Buckets
Create two public buckets:
medical-documents(for lab reports and radiology images)avatars(optional, for user profile pictures)
Obtaining API Keys
MedMitra requires several third-party API keys:Groq API Key
Sign Up
Visit console.groq.com and create an account
Groq provides free tier access to Llama 3.3 models with generous rate limits.
LlamaParse API Key
Sign Up
Visit cloud.llamaindex.ai and create an account
Gladia API Key
Sign Up
Visit gladia.io and create an account
Gladia is used for speech-to-text transcription in the frontend for doctor’s notes.
Running in Production
Backend Deployment
For production deployment, use a production-grade ASGI server configuration:Frontend Deployment
Build the production bundle:Docker Installation (Optional)
For containerized deployment, Docker configurations can be added:Verification Checklist
After installation, verify everything is working:Backend Health
- Backend starts without errors
- API documentation accessible at
/docs - Root endpoint returns success message
- Environment variables loaded correctly
Frontend Health
- Frontend starts without errors
- Login page displays correctly
- Dark/light mode toggle works
- No console errors in browser
Database Connection
- Supabase tables created successfully
- Storage buckets configured
- Authentication works (sign up/login)
Next Steps
Configuration Guide
Learn about all available configuration options
Create Your First Case
Step-by-step guide to creating and analyzing cases
API Reference
Explore the complete API documentation
AI Agents
Understand MedMitra’s AI workflow
Troubleshooting
Python ModuleNotFoundError
Python ModuleNotFoundError
If you see
ModuleNotFoundError when starting the backend:- Verify virtual environment is activated:
which pythonshould show the venv path - Reinstall dependencies:
pip install -r requirements.txt - Check Python version:
python --version(should be 3.9+)
Port Already in Use
Port Already in Use
If port 8000 or 3000 is already in use:Backend:Frontend:
Supabase Connection Failed
Supabase Connection Failed
If you can’t connect to Supabase:
- Verify URL format: should be
https://xyz.supabase.co - Check API keys have no extra spaces or quotes
- Ensure project is not paused (free tier auto-pauses after 1 week)
- Test connection in Supabase SQL Editor first
NPM Installation Errors
NPM Installation Errors
If npm install fails:
- Clear npm cache:
npm cache clean --force - Delete node_modules and package-lock.json:
rm -rf node_modules package-lock.json - Update npm:
npm install -g npm@latest - Try using yarn or pnpm instead
