How mohammedaakib/hair_growth_analysis works
Hair AI Pro is a web application for account access and longitudinal hair-growth analysis. A user registers or logs in, submits an initial image, then submits later images for comparison; the API returns a report and exposes image and history endpoints. The analysis graph detects and crops the head, stores the crop, compares it with the previous image using a vision model, and assembles a report. Face verification, user records, history, and image storage are supporting capabilities. Source excerpts show the main wiring; unsampled template behavior and some storage helper implementations remain unverified.
Main entry points: main.py FastAPI app · flow.py Analysis graph · s3_storage.py Image storage · routes.py Auth routes
Components 16
API and UI
- FastAPI app
main.py - Web pages
templates/dashboard.html
Identity
- Auth routes
auth/routes.py - Face verification
auth/face_verify.py
Hair analysis
- Analysis graph
graph/flow.py - Head detection
graph/nodes.py - Crop and upload
graph/nodes.py - Hair comparison
graph/nodes.py - Report generation
graph/nodes.py - Graph state
graph/state.py
Data and storage
- Supabase client
auth/database.py - Image storage
utils/s3_storage.py
Other components
- User
- Supabase service
- Supabase S3 storage
- Groq vision model
Connections 26
- User → FastAPI app: submits images
main.py - User → Auth routes: authenticates
auth/routes.py - FastAPI app → Web pages: serves pages
main.py - FastAPI app → Analysis graph: invokes analysis
main.py - FastAPI app → Auth routes: mounts routes
main.py - FastAPI app → Supabase client: queries users
main.py - FastAPI app → Face verification: saves face
main.py - FastAPI app → Image storage: gets latest image
main.py - FastAPI app → Supabase service: reads history
main.py - Auth routes → Supabase client: queries users
auth/routes.py - Auth routes → Face verification: verifies face
auth/routes.py - Auth routes → Image storage: resolves face URL
auth/routes.py - Supabase client → Supabase service: creates client
auth/database.py - Analysis graph → Graph state: types state
graph/flow.py - Analysis graph → Head detection: dispatches
graph/flow.py - Analysis graph → Crop and upload: dispatches
graph/flow.py - Analysis graph → Hair comparison: dispatches
graph/flow.py - Analysis graph → Report generation: dispatches
graph/flow.py - Head detection → Crop and upload: continues on detection
graph/flow.py - Crop and upload → Hair comparison: then runs
graph/flow.py - Hair comparison → Report generation: then generates
graph/flow.py - Crop and upload → Image storage: uploads crop
graph/nodes.py - Hair comparison → Image storage: downloads images
graph/nodes.py - Hair comparison → Groq vision model: sends image comparison
graph/nodes.py - Face verification → Image storage: stores face data
auth/face_verify.py - Image storage → Supabase S3 storage: transfers objects
utils/s3_storage.py