How shivamjuyal24/inflow works
Inflow is a Gmail triage application: users sign in, connect a Gmail mailbox, review classified messages and generated replies, then explicitly approve sending. The documented backend workflow fetches and parses mail, classifies it, persists categories and actions, and routes work to reply drafting or meeting analysis; separate draft and follow-up flows support review, sending, reconciliation, and later follow-ups. Edges use excerpts or README statements as evidence; unsampled implementations are represented only where documented.
Main entry points: triage.service.ts Triage coordinator · supabase.ts Supabase data · App.tsx Frontend routes · graph.ts LangGraph workflow
Components 28
Web application
- Frontend routes
frontend/src/App.tsx - Sign-in state
frontend/src/auth/AuthProvider.tsx - Inbox dashboard
frontend/src/pages/Dashboard.tsx - Draft review
frontend/src/pages/Drafts.tsx - Draft controls
frontend/src/components/DraftDetail.tsx - API client
frontend/src/lib/apiClient.ts
Identity and mailbox
- Auth routes
backend/src/routes/auth.routes.ts - OAuth handling
backend/src/controllers/auth.controller.ts - Bearer auth
backend/src/middleware/auth.middleware.ts - Gmail access
backend/src/services/gmail.service.ts
Triage pipeline
- Server scheduler
backend/src/server.ts - Triage coordinator
backend/src/services/triage.service.ts - Mail ingestion
backend/src/services/emailSync.service.ts - Email parsing
backend/src/services/email.parser.ts - LangGraph workflow
backend/src/graph/graph.ts - Classification
backend/src/graph/jevClassifier.ts - Action mapping
backend/src/graph/actionMapper.ts - Email routes
backend/src/routes/email.routes.ts - Inbox API
backend/src/controllers/email.controller.ts - Triage routes
backend/src/routes/triage.routes.ts
Draft lifecycle
- Draft routes
backend/src/routes/draft.routes.ts - Draft lifecycle
backend/src/controllers/draft.controller.ts - Follow-up sweep
backend/src/services/followUp.service.ts
Persistence and providers
- Supabase data
backend/src/config/supabase.ts - Groq models
backend/src/config/groq.ts - Jev classifier API
backend/src/graph/jevClassifier.ts - Google OAuth
backend/src/config/google.ts
Other components
- User
Connections 34
- User → Frontend routes: uses
frontend/src/App.tsx - Frontend routes → Sign-in state: provides state
frontend/src/App.tsx - Frontend routes → Inbox dashboard: routes to
frontend/src/App.tsx - Frontend routes → Draft review: routes to
frontend/src/App.tsx - Sign-in state → Supabase data: authenticates
frontend/src/auth/AuthProvider.tsx - Inbox dashboard → API client: loads inbox
- Draft review → API client: loads drafts
- Draft review → Draft controls: renders review
- User → Auth routes: connects mailbox
README.md - Auth routes → OAuth handling: dispatches
backend/src/routes/auth.routes.ts - Auth routes → Bearer auth: guards
backend/src/routes/auth.routes.ts - OAuth handling → Google OAuth: uses OAuth
README.md - OAuth handling → Supabase data: stores account
README.md - Server scheduler → Triage coordinator: schedules
backend/src/server.ts - User → Triage routes: triggers manually
README.md - Triage routes → Triage coordinator: dispatches
README.md - Email routes → Inbox API: dispatches
- Inbox API → Triage coordinator: runs triage
backend/src/controllers/email.controller.ts - Triage coordinator → Mail ingestion: ingests mail
README.md - Mail ingestion → Gmail access: fetches messages
README.md - Mail ingestion → Email parsing: parses messages
README.md - Triage coordinator → LangGraph workflow: orchestrates
README.md - LangGraph workflow → Classification: classifies
README.md - Classification → Jev classifier API: requests labels
README.md - LangGraph workflow → Action mapping: derives actions
README.md - LangGraph workflow → Supabase data: persists results
README.md - Draft routes → Draft lifecycle: dispatches
backend/src/routes/draft.routes.ts - Draft routes → Bearer auth: guards
backend/src/routes/draft.routes.ts - Draft lifecycle → Supabase data: reads and updates
backend/src/controllers/draft.controller.ts - Draft lifecycle → Gmail access: sends approved reply
backend/src/controllers/draft.controller.ts - Draft controls → Draft lifecycle: approves or resolves
- Server scheduler → Follow-up sweep: schedules sweep
backend/src/server.ts - Follow-up sweep → Supabase data: checks and stores drafts
backend/src/services/followUp.service.ts - Follow-up sweep → Groq models: generates follow-up
backend/src/services/followUp.service.ts