How garvthanvi/voice-note-taking works
NoteFlow is a voice-driven note-taking product with a React frontend and Express API. The principal flow records a spoken command, transcribes it, extracts intent, resolves the target note or todo, and executes an action with undo support. Users can also manage notes and labels directly, authenticate with password or Google OAuth, and connect external AI clients through MCP. Edges reflect the README and shown imports, route mounts, and calls; unsampled implementations are represented only where documented.
Main entry points: app.ts API route mounting · voice.ts Voice command route · http.ts MCP HTTP server · note.ts Note and todo routes
Components 34
Web application
- Web app entry
frontend/src/main.tsx - Page routing
frontend/src/routes/AppRoutes.tsx - Session context
frontend/src/context/AuthContext.tsx - Sign-in form
frontend/src/components/LoginSignup/AuthForm.tsx - Auth API client
frontend/src/api/authApi.ts
Notes and voice
- Notes workspace
frontend/src/pages/Note.tsx - Note pagination
frontend/src/hooks/useInfiniteNotes.ts - Note API client
frontend/src/api/noteApi.ts - Label management
frontend/src/hooks/useLabels.ts - Voice controls
frontend/src/components/NotePage/VoiceControl.tsx - Voice API client
frontend/src/api/voiceApi.ts - Voice command route
backend/src/routes/voice.ts - Audio transcription
backend/src/lib/transcribe.ts - Intent extraction
backend/src/lib/extractIntent.ts - Target resolution
backend/src/lib/resolveTarget.ts - Action execution
backend/src/lib/executeAction.ts - Voice undo
backend/src/routes/voiceUndo.ts - Undo state
backend/src/lib/undoStore.ts
Identity and access
- Account routes
backend/src/routes/auth.ts - Auth validation
backend/src/schemas/auth.ts - JWT authentication
backend/src/middlewares/auth.middleware.ts - OAuth server routes
backend/src/routes/oauth.ts - OAuth token logic
backend/src/lib/oauth.ts - MCP token utilities
backend/src/lib/mcpTokens.ts
API and persistence
- API route mounting
backend/src/app.ts - Note and todo routes
backend/src/routes/note.ts - Label routes
backend/src/routes/label.ts - PostgreSQL database
backend/src/lib/prisma.ts
AI connectors
- MCP HTTP server
backend/src/mcp/http.ts - MCP request auth
backend/src/mcp/auth.ts - MCP note tools
backend/src/mcp/tools.ts - Internal API client
backend/src/mcp/client.ts
Other components
- NoteFlow user
- MCP client
Connections 43
- NoteFlow user → Web app entry: uses
frontend/src/main.tsx - Web app entry → Page routing: renders
frontend/src/main.tsx - Page routing → Session context: guards pages
- NoteFlow user → Sign-in form: signs in
- Sign-in form → Auth API client: submits credentials
frontend/src/components/LoginSignup/AuthForm.tsx - Session context → Auth API client: restores session
frontend/src/context/AuthContext.tsx - Auth API client → Account routes: calls account API
- Account routes → Auth validation: validates input
backend/src/routes/auth.ts - Account routes → PostgreSQL database: reads and writes
backend/src/routes/auth.ts - Page routing → Notes workspace: routes to
frontend/src/routes/AppRoutes.tsx - NoteFlow user → Notes workspace: manages notes
- Notes workspace → Note pagination: loads notes
- Note pagination → Note API client: requests pages
frontend/src/hooks/useInfiniteNotes.ts - Note API client → Note and todo routes: calls note API
- Note and todo routes → JWT authentication: requires auth
backend/src/routes/note.ts - Note and todo routes → PostgreSQL database: reads and writes
backend/src/routes/note.ts - Notes workspace → Label management: manages labels
- Label management → Label routes: calls label API
- NoteFlow user → Voice controls: records command
- Voice controls → Voice API client: uploads audio
- Voice API client → Voice command route: sends command
- Voice command route → Audio transcription: transcribes audio
- Voice command route → Intent extraction: extracts intent
- Voice command route → Target resolution: resolves target
- Voice command route → Action execution: executes action
- NoteFlow user → Voice undo: requests undo
- Voice undo → Undo state: uses undo state
- API route mounting → Account routes: mounts routes
backend/src/app.ts - API route mounting → Note and todo routes: mounts routes
backend/src/app.ts - API route mounting → Label routes: mounts routes
backend/src/app.ts - API route mounting → Voice command route: mounts routes
backend/src/app.ts - API route mounting → Voice undo: mounts routes
backend/src/app.ts - API route mounting → OAuth server routes: mounts OAuth
backend/src/app.ts - OAuth server routes → OAuth token logic: issues tokens
backend/src/routes/oauth.ts - OAuth token logic → MCP token utilities: uses token helpers
backend/src/lib/oauth.ts - OAuth token logic → PostgreSQL database: stores OAuth grants
backend/src/lib/oauth.ts - API route mounting → MCP HTTP server: mounts MCP
backend/src/app.ts - MCP client → MCP HTTP server: connects over HTTP
- MCP HTTP server → MCP request auth: authenticates requests
backend/src/mcp/http.ts - MCP HTTP server → MCP note tools: dispatches tools
backend/src/mcp/http.ts - MCP HTTP server → Internal API client: creates API client
backend/src/mcp/http.ts - Internal API client → Note and todo routes: calls internal API
backend/src/mcp/client.ts - MCP request auth → MCP token utilities: checks credentials
backend/src/mcp/auth.ts