Skip to content

SanjayMarathe/DermaVisionXR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ DermaVision XR - Complete Setup Guide

✨ What's New

  • Futuristic Purple UI: Complete redesign with purple/fuchsia theme
  • Fullscreen Camera: Immersive scanning experience
  • Real Backend API: Pinecone similarity search integrated
  • Neural Scan Interface: Animated grid, glowing elements, futuristic HUD

🎨 UI Features

Landing Page

  • Centered purple gradient text with glow effects
  • Animated background with pulsing gradients
  • Glass morphism panels with purple borders
  • Futuristic button with tracking and shadow
  • "INITIATE SCAN β†’" call to action

Scan Page

  • Fullscreen camera feed takes entire screen
  • Animated grid overlay for sci-fi effect
  • Glowing purple reticle with corner markers
  • Pulsing scan lines during analysis
  • Comprehensive results popup with:
    • Diagnosis name in large text
    • Animated confidence bar
    • Color-coded severity
    • Medical recommendations
    • "New Scan" button

πŸ› οΈ Setup Instructions

1. Frontend Setup (dermavisionxr)

cd dermavisionxr
npm install

# Make sure .env.local has:
# XR_DEV_PORT=4321
# XR_DEV_SERVER=http://localhost:4321/webspatial/avp
# VITE_API_URL=http://localhost:3001

npm run dev

Opens at: http://localhost:5176

2. Backend API Setup (server)

cd ../server
npm install

# Create .env file:
echo "PINECONE_API_KEY=your-key-here" > .env
echo "PINECONE_INDEX_NAME=ham10000-medical" >> .env
echo "PORT=3001" >> .env

# Start the API server
npm run dev

API runs at: http://localhost:3001

🎯 Testing the App

Browser Testing (Recommended)

  1. Start API server (Terminal 1):
cd server
npm run dev
  1. Start frontend (Terminal 2):
cd dermavisionxr
npm run dev
  1. Open http://localhost:5176 in Chrome/Safari

  2. Test flow:

    • Click "INITIATE SCAN β†’"
    • Grant camera permissions
    • Position your hand/skin in the glowing reticle
    • Click "β–Ά INITIATE SCAN"
    • Wait 2-3 seconds for analysis
    • View results in the purple popup

πŸ”¬ API Integration

The app now calls the real backend:

// In ScanPage.tsx
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3001';

const response = await fetch(`${API_URL}/api/analyze-base64`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ image: capturedImageData })
});

API Response Format

{
  "diagnosis": "Melanocytic Nevus (Benign)",
  "confidence": 92,
  "color": "#10b981",
  "recommendation": "Common benign mole. Monitor for changes...",
  "similarCases": [...],
  "metadata": {...}
}

🎨 UI Color Theme

Element Color Usage
Primary #a855f7 (Purple 500) Main accents, borders
Secondary #c084fc (Purple 400) Secondary elements
Glow #d946ef (Fuchsia 500) Glowing effects
Background #0a0015 β†’ #1a0033 Gradient backdrop
Text #e9d5ff (Purple 100) Main text

πŸ“± Features Showcase

Landing Page Features

  • βœ… Centered "DERMAVISION" title with animated gradient
  • βœ… "SPATIAL DERMATOSCOPIC ANALYSIS" subtitle
  • βœ… Three feature cards (Camera, AI, Spatial)
  • βœ… Glowing "INITIATE SCAN" button
  • βœ… Animated background orbs

Scan Page Features

  • βœ… Fullscreen camera view
  • βœ… "NEURAL SCAN" header
  • βœ… Animated grid background
  • βœ… Glowing 500x500px reticle
  • βœ… Corner markers with glow
  • βœ… Scanning lines animation
  • βœ… "β—‰ SYSTEM ONLINE" status indicator
  • βœ… Comprehensive results panel with:
    • Large "ANALYSIS COMPLETE" header
    • Diagnosis name
    • Confidence percentage bar
    • Medical assessment box
    • Color-coded severity
    • "β–Ά NEW SCAN" button

πŸ”§ Customization

Change Primary Color

Edit dermavisionxr/src/index.css:

--color-primary: #your-color;
--color-glow: #your-glow-color;

Adjust Camera Reticle Size

Edit dermavisionxr/src/components/ScanPage.tsx:

// Change from 500x500 to your preferred size
<div className="w-[500px] h-[500px] relative">

Modify Analysis Time

Edit dermavisionxr/src/components/ScanPage.tsx:

// The API call is real now, so timing depends on backend
// Mock fallback uses instant response

🚨 Troubleshooting

API Not Responding

# Check if API is running
curl http://localhost:3001/health

# Should return: {"status":"ok","timestamp":"..."}

Camera Not Working

  • Grant camera permissions in browser
  • Use HTTPS in production (required for camera API)
  • Check browser console for errors

Purple Theme Not Showing

  • Hard refresh: Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac)
  • Clear browser cache
  • Check index.css loaded correctly

Analysis Returns Mock Data

  • Verify API server is running
  • Check VITE_API_URL in .env.local
  • Look for "Using mock data" in results

πŸ“Š Performance Tips

  1. First load: ~2-3 seconds (model loading)
  2. Subsequent scans: ~500ms-1s
  3. Optimize: Keep API server running
  4. Production: Use Redis for model caching

🎬 Demo Flow

  1. Launch β†’ Purple landing page appears
  2. Click β†’ "INITIATE SCAN" button
  3. Camera β†’ Fullscreen view with grid overlay
  4. Position β†’ Target in glowing reticle
  5. Scan β†’ Click "β–Ά INITIATE SCAN"
  6. Analyze β†’ Scan lines animate for 2-3s
  7. Results β†’ Purple popup with diagnosis
  8. Repeat β†’ Click "β–Ά NEW SCAN"

πŸ“– Documentation

  • IMPLEMENTATION.md: Technical details
  • FLOW.md: Visual flow diagrams
  • XCODE_SETUP.md: visionOS simulator setup
  • API_README.md: Backend API documentation

πŸŽ‰ You're Ready!

The app now has:

  • βœ… Stunning purple futuristic UI
  • βœ… Fullscreen camera experience
  • βœ… Real backend integration
  • βœ… Pinecone similarity search
  • βœ… Professional medical interface
  • βœ… Smooth animations
  • βœ… Comprehensive results display

Open http://localhost:5176 and experience the future of dermatology! πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages