How shiwangeegg/maya-ai-based-pcos-detection-system works
PCOS Detect is a clinical decision-support application: users enter clinical data and optionally upload an ultrasound or medical PDF, then receive a multimodal PCOS risk assessment and explainability/recommendation features. The frontend also supports accounts, profiles, and saved assessment history. The main inference and parsing flows are visible in sampled backend excerpts and README documentation; several frontend and API implementation files were not sampled, so their detailed internal calls are not represented.
Main entry points: pcos.py PCOS endpoints · main.py FastAPI application · page.tsx Results dashboard · auth_router.py Auth service
Components 25
Patient experience
- Next.js app
frontend/app/layout.tsx - Assessment workflow
frontend/app/assess/page.tsx - Results dashboard
frontend/app/results/page.tsx - Assessment history
frontend/app/history/page.tsx - Profile pages
frontend/app/profile/page.tsx - API client
frontend/lib/api.ts
Backend API
- FastAPI application
app/main.py - PCOS endpoints
app/api/pcos.py - Authentication endpoints
app/api/auth.py - Assessment endpoints
app/api/assessments.py - Profile endpoints
app/api/profile.py
Assessment services
- PDF parser
app/parsing/document_parser.py - Clinical field registry
app/parsing/field_registry.py - Multimodal inference
app/services/multimodal_service.py - Grad-CAM explanation
app/services/gradcam_service.py - Recommendations
app/services/recommendation_service.py
Identity and records
- Auth service
app/auth/auth_router.py - JWT utilities
app/auth/jwt_utils.py - Profile service
app/users/profile_service.py - Assessment service
app/assessments/assessment_service.py
Database models
- SQLite database
app/database.py - User model
app/users/user_models.py - Profile model
app/users/profile_models.py - Assessment model
app/assessments/assessment_model.py
Other components
- Patient
Connections 31
- Patient → Next.js app: uses
- Next.js app → Assessment workflow: opens
- Assessment workflow → API client: submits assessment
- API client → PCOS endpoints: sends request
- PCOS endpoints → Multimodal inference: runs inference
app/api/pcos.py - PCOS endpoints → PDF parser: parses report
app/api/pcos.py - PDF parser → Clinical field registry: uses field definitions
app/parsing/document_parser.py - PCOS endpoints → Grad-CAM explanation: requests explanation
app/api/pcos.py - PCOS endpoints → Recommendations: requests recommendations
app/api/pcos.py - PCOS endpoints → Assessment service: saves assessment
app/api/pcos.py - PCOS endpoints → Assessment endpoints: returns assessment data
- PCOS endpoints → Results dashboard: returns risk results
- Results dashboard → Patient: displays results
- Results dashboard → Grad-CAM explanation: shows heatmap
- FastAPI application → PCOS endpoints: routes to
app/main.py - FastAPI application → Authentication endpoints: routes to
app/main.py - FastAPI application → Assessment endpoints: routes to
app/main.py - FastAPI application → Profile endpoints: routes to
app/main.py - Authentication endpoints → Auth service: handles authentication
- Auth service → JWT utilities: creates tokens
app/auth/auth_router.py - Auth service → User model: queries users
app/auth/auth_router.py - Profile endpoints → Profile service: delegates profile work
app/api/profile.py - Profile service → Profile model: reads and writes
app/users/profile_service.py - Assessment service → Assessment model: creates records
app/assessments/assessment_service.py - Assessment endpoints → Assessment model: serves history
app/api/assessments.py - User model → SQLite database: maps to
app/users/user_models.py - Profile model → SQLite database: maps to
app/users/profile_models.py - Assessment model → SQLite database: maps to
app/assessments/assessment_model.py - Patient → Authentication endpoints: registers or signs in
- Patient → Profile pages: manages profile
- Patient → Assessment history: reviews history