Dattavani Backend: Request Pipeline (GET /api/kids/home-stats)

Dattavani Backend: Request Pipeline (GET /api/kids/home-stats) A sequence diagram generated by Archify. GET /api/kids/home-stats Bearer: kid JWT call_next / and /health skip NewRelic call_next request_id andparent_id bound forlogs Depends(get_active_kid_context) verify kid JWT: typ,exp, ids, consent parent access token for RLS device_sessions token,refreshed if expired, 5min cache parent access JWT kid_context + RLS client rpc get_home_stats_rpc retries transienterrors, max 3 tries JSON payload 200 ApiResponse {success, message,data, code} 200 + X-Request-ID, X-Process-Time JSON log: request_id,status, duration HTTPException or validation error 401/403 to 1005, 404 to1003, 422 to field code 4xx ApiResponse + CORS headers unhandled Exception caught here beforemain.py:248 500 ApiResponse code 1006 + tracking_id Middleware, outer to inner Auth dependency Handler and response Error paths Mobile app · Kid Profile JWT · Sequence participant Mobile app Kid Profile JWT NR gate · http middleware · Sequence participant NR gate http middleware Request context · id, log, timing · Sequence participant Request context id, log, timing CORS · CORSMiddleware · Sequence participant CORS CORSMiddleware Auth dependency · kid JWT + RLS client · Sequence participant Auth dependency kid JWT + RLS client Route handler · router + service · Sequence participant Route handler router + service Supabase · PostgREST + Auth · Sequence participant Supabase PostgREST + Auth Error handlers · main.py · Sequence participant Error handlers main.py Legend main request return security async trace message