Full Documentation

Getting Started

Complete setup guide, installation instructions, and configuration documentation for CuraSense - your AI-powered medical diagnosis system.

What's New

Latest Updates

Discover all the new features and improvements in the latest version

Next.js 16 Frontend

Complete redesign with React 19 and TypeScript

Framer Motion

Smooth, professional animations throughout

Modern UI/UX

Radix UI components with Tailwind CSS 4

Fully Responsive

Works seamlessly on desktop, tablet, and mobile

Dark/Light Mode

Theme switching with next-themes

Report History

Track and manage all your past diagnoses

AI Chat Assistant

Interactive chat for follow-up questions

State Management

Zustand for efficient client-state management

Core Features

Powerful Capabilities

Multi-Agent AI Workflows

Orchestrated diagnosis using CrewAI and LangGraph for comprehensive analysis

Prescription Analysis

Upload and analyze medical prescriptions and blood test reports with AI

X-Ray & CT Analysis

Vision AI for analyzing X-rays, CT scans, and MRI images accurately

Medicine Comparison

Compare medications, check interactions, and find safer alternatives

RAG System

Semantic search with ChromaDB vector database for intelligent retrieval

Real-time Streaming

Live diagnosis updates with Server-Sent Events for instant feedback

Secure

Session-based data isolation with 15-minute TTL for privacy compliance

Fast Processing

Sub-30 second response time for comprehensive medical analysis

Prerequisites

Before You Begin

System Requirements

Node.js 18+

For Next.js frontend

Python 3.10+

For ML backend

Conda

Miniconda or Anaconda

Installation

Setup Instructions

1

Clone Repository

terminal
git clone https://github.com/VaibhavK289/curasense-diagnosis.git
cd curasense-diagnosis
2

Setup Next.js Frontend

terminal
cd curasense-frontend
npm install
3

Setup Python Backend

ML Service:

terminal
conda create -n curasense_env python=3.10 -y
conda activate curasense_env
cd curasense-ml
pip install -r requirements.txt

FastAPI Backend:

terminal
conda create -n curasense_vision_env python=3.10 -y
conda activate curasense_vision_env
cd ml-fastapi
pip install -r requirements.txt
Configuration

API Keys Setup

curasense-frontend/.env.local

.env.local
NEXT_PUBLIC_API_URL=http://localhost:8001
NEXT_PUBLIC_ML_API_URL=http://localhost:8000

curasense-ml/.env

.env
GOOGLE_API_KEY="your_gemini_api_key"
GROQ_API_KEY="your_groq_api_key"
TAVILY_API_KEY="your_tavily_api_key"
CREWAI_TRACING_ENABLED=true

ml-fastapi/.env

.env
GOOGLE_API_KEY="your_gemini_api_key"
GROQ_API_KEY="your_groq_api_key"
TAVILY_API_KEY="your_tavily_api_key"
HUGGINGFACE_TOKEN="your_hf_token"
Project Structure

Directory Layout

project structure
curasense-diagnosis/
├── curasense-frontend/            # 🆕 Next.js 16 Frontend
│   ├── src/
│   │   ├── app/                   # App Router pages
│   │   │   ├── diagnosis/         # Diagnosis pages
│   │   │   │   ├── prescription/  # Prescription analysis
│   │   │   │   └── xray/          # X-ray analysis
│   │   │   ├── medicine/          # Medicine comparison
│   │   │   ├── history/           # Report history
│   │   │   ├── settings/          # User settings
│   │   │   └── help/              # Help & documentation
│   │   ├── components/            # React components
│   │   │   ├── ui/                # Shadcn/UI components
│   │   │   ├── layout/            # Header, Sidebar
│   │   │   ├── motion/            # Animation components
│   │   │   └── backgrounds/       # Background effects
│   │   ├── lib/                   # Utilities & API client
│   │   └── styles/                # Design tokens
│   ├── package.json
│   └── tailwind.config.ts
│
├── curasense-ml/                  # Python ML Frontend (Legacy)
│   ├── frontend/                  # HTML/CSS/JS dashboard
│   ├── src/
│   │   ├── crew/
│   │   │   └── agents_and_tasks.py # CrewAI agents
│   │   ├── hugging_face_ner.py    # NER extraction
│   │   └── output_pydantic.py     # Data models
│   ├── app.py                     # FastAPI server
│   ├── flow.py                    # Workflow orchestration
│   └── requirements.txt
│
├── ml-fastapi/                    # Backend API
│   ├── config/
│   │   ├── main_graph.py          # Main diagnosis workflow
│   │   ├── rag.py                 # RAG system
│   │   ├── vision_graph.py        # Vision analysis
│   │   ├── medical_summarizer_graph.py
│   │   ├── vectordb.py            # ChromaDB management
│   │   └── validate_api.py        # API validation
│   ├── cron/
│   │   ├── jobs.py                # Scheduled tasks
│   │   └── storage.py             # Session storage
│   ├── main.py                    # Backend server
│   └── requirements.txt
│
├── .gitignore
├── README.md
└── start_servers.bat
Running

Start the Application

Option 1: Run All Services Manually

Terminal 1 - Next.js Frontend:

terminal 1
cd curasense-frontend
npm run dev

Terminal 2 - ML Backend:

terminal 2
cd curasense-ml
conda activate curasense_env
uvicorn app:app --host 0.0.0.0 --port 8000 --reload

Terminal 3 - FastAPI Backend:

terminal 3
cd ml-fastapi
conda activate curasense_vision_env
uvicorn main:app --host 0.0.0.0 --port 8001 --reload

Option 2: Use Batch Script (Windows)

terminal
start_servers.bat

Access Points

Next.js Frontend

http://localhost:3000

Legacy Dashboard

http://localhost:8000

API Documentation

http://localhost:8001/docs
Frontend Tech Stack

Built With Modern Tools

Next.js 16

React framework with App Router

React 19

UI library

TypeScript 5

Type safety

Tailwind CSS 4

Styling

Framer Motion

Animations

Radix UI

Accessible components

Zustand

State management

Lucide Icons

Icon library

Ready to Get Started?

Clone the repository, set up your API keys, and start building with CuraSense.

Made with ❤️ by CuraSense Team • MIT License