How reddysridharkb/brain-tumor-detection works
NeuroAI is a clinical MRI tumor-analysis application: staff or patients sign in, manage patient records, upload scans, review AI-assisted findings and progression, and produce clinical reports. The backend separates API routes, scan/AI processing, patient services, and persistence; the Next.js frontend provides login, dashboard, patient, scan-analysis, and report experiences. The landing page also advertises tumor segmentation and longitudinal comparison. Several routes and integrations are listed but unsampled, so their connections are shown only as unverified where useful.
Main entry points: main.py FastAPI application · scan_service.py Scan workflow · auth.py Authentication routes · models.py Clinical models
Components 34
Clinical web app
- Product landing
frontend/src/app/page.tsx - Sign-in
frontend/src/app/login/page.tsx - Session state
frontend/src/store/useAuthStore.ts - Clinical dashboard
frontend/src/app/dashboard/page.tsx - Dashboard data
frontend/src/store/useDashboardStore.ts - Patient directory
frontend/src/app/patients/page.tsx - Patient workspace
frontend/src/app/patients/[id]/page.tsx - Patient state
frontend/src/store/usePatientStore.ts - Scan upload
frontend/src/app/upload/page.tsx - Scan review
frontend/src/app/analysis/[scanId]/page.tsx - Scan state
frontend/src/store/useScanStore.ts - EEG scanner UI
frontend/src/components/EEGScanner.tsx - Reports interface
frontend/src/app/reports/page.tsx - HTTP client
frontend/src/lib/api.ts
Backend API
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/routes/auth.py - Patient routes
backend/app/routes/patients.py - Scan routes
backend/app/routes/scans.py - EEG routes
backend/app/routes/eeg.py - Analytics routes
backend/app/routes/analytics.py - Report routes
backend/app/routes/reports.py
Scan analysis
- Scan workflow
backend/app/services/scan_service.py - Image analysis
backend/app/ai/opencv_service.py - Image processing
backend/app/ai/image_processing.py - Tumor highlighting
backend/app/ai/openai_service.py - AI interpretation
backend/app/ai/gemini_service.py - Analytics charts
backend/app/analytics/chart_generator.py
Clinical data
- Patient operations
backend/app/services/patient_service.py - PDF generation
backend/app/reports/pdf_generator.py - Clinical models
backend/app/models/models.py - API schemas
backend/app/schemas/schemas.py - Database sessions
backend/app/database/database.py - Configuration
backend/app/config/settings.py
Other components
- Clinician / patient
Connections 35
- Clinician / patient → Product landing: opens
frontend/src/app/page.tsx - Clinician / patient → Sign-in: signs in
- Sign-in → Session state: uses session
- Session state → HTTP client: posts login
frontend/src/store/useAuthStore.ts - HTTP client → Authentication routes: HTTP requests
- Clinical dashboard → Dashboard data: loads metrics
frontend/src/app/dashboard/page.tsx - Clinical dashboard → Analytics routes: requests analytics
- Patient directory → Patient state: manages patients
- Patient state → HTTP client: sends requests
frontend/src/store/usePatientStore.ts - Patient routes → Patient operations: delegates operations
- Patient operations → Clinical models: queries and updates
backend/app/services/patient_service.py - Patient operations → API schemas: accepts patient data
backend/app/services/patient_service.py - Patient workspace → EEG scanner UI: renders scanner
frontend/src/app/patients/[id]/page.tsx - Scan upload → Scan routes: submits scans
- Scan review → Scan state: uses scan data
- Scan routes → Scan workflow: dispatches scan work
- Scan workflow → Tumor highlighting: generates highlight
backend/app/services/scan_service.py - Scan workflow → AI interpretation: requests interpretation
backend/app/services/scan_service.py - Scan workflow → Clinical models: persists scan
backend/app/services/scan_service.py - Scan workflow → Image analysis: uses image analysis
- Scan workflow → Image processing: uses processing
- Report routes → PDF generation: generates reports
- PDF generation → Clinical models: reads scan data
backend/app/reports/pdf_generator.py - PDF generation → AI interpretation: references AI analysis
backend/app/reports/pdf_generator.py - Analytics routes → Analytics charts: uses chart output
- Authentication routes → Database sessions: gets database session
backend/app/routes/auth.py - Authentication routes → Clinical models: queries user records
backend/app/routes/auth.py - Database sessions → Configuration: configures connection
backend/app/database/database.py - FastAPI application → Authentication routes: registers routes
- FastAPI application → Patient routes: registers routes
- FastAPI application → Scan routes: registers routes
- FastAPI application → EEG routes: registers routes
- FastAPI application → Analytics routes: registers routes
- FastAPI application → Report routes: registers routes
- Reports interface → Report routes: requests reports