How vdharshan4214-boop/claim-x-ai works
Purpose and Runtime
This is a TypeScript React claims-operations application: claim creation, pending-claim review, settlements, fraud alerts, and setup are represented as dedicated screens. It runs as a Vite-style browser client, with a separate Node/TypeScript server entry point at server.ts.
Key entry points:
• src/main.tsx bootstraps the client.
• src/App.tsx composes the application experience.
• server.ts is the server-side entry point.
• index.html is the browser document host.
Application Shell and Navigation
The application shell is centralized rather than duplicated across pages. src/components/layout/index.tsx likely owns persistent layout concerns such as navigation and page framing, while reusable visual primitives are exported through src/components/ui/index.tsx.
Primary composition boundary:
• src/App.tsx
• src/components/layout/index.tsx
• src/components/ui/index.tsx
Claims Workflow Screens
The product is organized around operational stages of a claim lifecycle. src/pages/NewClaim.tsx initiates claim intake; src/pages/PendingClaims.tsx supports review or work queues; and src/pages/Settlements.tsx handles post-decision settlement operations.
Core workflow paths:
• src/pages/NewClaim.tsx
• src/pages/PendingClaims.tsx
• src/pages/Settlements.tsx
Operational Monitoring and Configuration
Dashboard, fraud, and setup concerns are intentionally separate from claim transaction pages. src/pages/Overview.tsx is the operational landing/dashboard surface, src/pages/FraudAlerts.tsx represents fraud signal handling, and src/pages/Setup.tsx provides application or integration configuration.
Paths:
• src/pages/Overview.tsx
• src/pages/FraudAlerts.tsx
• src/pages/Setup.tsx
State and Persistence Boundary
Claim-oriented client state is centralized in src/store/useClaimStore.ts, providing a shared state boundary between workflow pages and UI components. Browser-side persistence utilities reside in src/lib/storage.ts. Supabase access is isolated behind src/lib/supabase.ts, preventing page components from needing to own backend client setup.
Paths:
• src/store/useClaimStore.ts
• src/lib/storage.ts
• src/lib/supabase.ts
AI and External Services
Gemini integration is encapsulated in src/services/geminiService.ts; callers should route AI-related claim analysis or assistance through this service rather than directly using API credentials. The required GEMINI_API_KEY is supplied via local environment configuration. Supabase is the other material external service implied by the repository.
Paths:
• src/services/geminiService.ts
• .env.example
• src/lib/supabase.ts
Authentication and Control Flow
src/pages/Auth.tsx provides the authentication boundary before users reach operational claim screens. The expected control flow is: client bootstrap → app/layout composition → authentication state → selected operational page → shared claim state and persistence/service calls. Shared utility logic belongs below UI and page layers in src/lib/utils.ts.
Paths:
• src/main.tsx
• src/pages/Auth.tsx
• src/lib/utils.ts
Main entry points: index.tsx Application shell · useClaimStore.ts Claim state · App.tsx Application composition · FraudAlerts.tsx Fraud alerts
Components 19
Browser client
- Browser document
index.html - Client bootstrap
src/main.tsx - Application composition
src/App.tsx - Application shell · Provides persistent navigation and page framing.
src/components/layout/index.tsx - UI primitives
src/components/ui/index.tsx - Authentication · Gates access to operations screens.
src/pages/Auth.tsx
Claims operations
- Operations overview
src/pages/Overview.tsx - New claim
src/pages/NewClaim.tsx - Pending claims
src/pages/PendingClaims.tsx - Settlements
src/pages/Settlements.tsx - Fraud alerts
src/pages/FraudAlerts.tsx - Setup
src/pages/Setup.tsx
State and services
- Claim state · Central shared state boundary for claim workflows.
src/store/useClaimStore.ts - Browser persistence
src/lib/storage.ts - Supabase client · Isolates backend client setup from pages.
src/lib/supabase.ts - Gemini service · Encapsulates AI claim analysis access.
src/services/geminiService.ts - Shared utilities
src/lib/utils.ts - Environment template · Defines the required Gemini API key.
.env.example
Other components
- Server entry · Separate Node/TypeScript server runtime.
server.ts
Connections 21
- Browser document → Client bootstrap: loads
- Client bootstrap → Application composition: bootstraps
- Application composition → Application shell: composes
- Application composition → Authentication: auth flow
- Authentication → Operations overview: authenticated access
- Application shell → Operations overview: hosts
- Application shell → New claim: hosts
- Application shell → Pending claims: hosts
- Application shell → Settlements: hosts
- Application shell → Fraud alerts: hosts
- Application shell → Setup: hosts
- Application shell → UI primitives: uses
- New claim → Claim state: creates claims
- Pending claims → Claim state: reviews claims
- Settlements → Claim state: settles claims
- Fraud alerts → Claim state: reads claim context
- Claim state → Browser persistence: persists client state
- Claim state → Supabase client: accesses backend
- Fraud alerts → Gemini service: requests analysis
- Gemini service → Environment template: uses API key
- Application composition → Shared utilities: uses shared logic