How victoriakaey/code-snippet-reviewer works
Code Snippet Reviewer lets a user create a code snippet, request an AI review, inspect and navigate structured findings, record decisions, and discuss a finding with the AI. The backend queues review work, calls a configured provider, validates its output, and persists review history and decisions. The README documents mock, Ollama, and OpenAI providers. Some worker and UI internals were only partially excerpted, so uncertain connections are omitted; the unsampled review-history and rubric UI capabilities are retained where supported by the README and source tree.
Main entry points: SnippetDetail.tsx Review detail · api.ts Typed API client · main.py FastAPI application · db.py SQLite database
Components 27
Review interface
- Snippet dashboard
frontend/src/pages/Dashboard.tsx - Snippet editor
frontend/src/components/CreateSnippet.tsx - Review detail
frontend/src/pages/SnippetDetail.tsx - Code editor
frontend/src/components/CodeEditor.tsx - Findings panel
frontend/src/components/FindingsPanel.tsx - Finding discussion
frontend/src/components/DiscussionView.tsx - Review history
frontend/src/components/ReviewDetailsDrawer.tsx - Review polling
frontend/src/hooks/useReviewPolling.ts - Typed API client
frontend/src/api.ts
API and domain
- FastAPI application
backend/app/main.py - Snippet endpoints
backend/app/routers/snippets.py - Review endpoints
backend/app/routers/reviews.py - Finding decisions
backend/app/routers/findings.py - Finding messages
backend/app/routers/messages.py - Rubric endpoint
backend/app/routers/rubric.py
Review processing
- Background worker
backend/app/worker.py - Output validation
backend/app/review_pipeline.py - Provider selection
backend/app/providers/factory.py - Provider interface
backend/app/providers/base.py - Ollama provider
backend/app/providers/ollama.py - OpenAI provider
backend/app/providers/openai.py - Mock provider
backend/app/providers/mock.py - Review rubric
backend/app/rubric.py
Persistence
- SQLite database
backend/app/db.py - Domain records
backend/app/models.py
Other components
- Reviewer
- Configured model service
Connections 47
- Reviewer → Snippet dashboard: uses
README.md - Snippet dashboard → Snippet editor: opens
frontend/src/pages/Dashboard.tsx - Reviewer → Review detail: reviews snippet
README.md - Review detail → Code editor: renders
frontend/src/pages/SnippetDetail.tsx - Review detail → Findings panel: renders
frontend/src/pages/SnippetDetail.tsx - Review detail → Finding discussion: renders
frontend/src/pages/SnippetDetail.tsx - Review detail → Review history: renders
frontend/src/pages/SnippetDetail.tsx - Review detail → Review polling: polls with
frontend/src/pages/SnippetDetail.tsx - Snippet editor → Code editor: uses
frontend/src/components/CreateSnippet.tsx - Snippet dashboard → Typed API client: requests snippets
frontend/src/pages/Dashboard.tsx - Snippet editor → Typed API client: creates snippet
frontend/src/components/CreateSnippet.tsx - Review detail → Typed API client: loads and starts
frontend/src/pages/SnippetDetail.tsx - Findings panel → Typed API client: updates decisions
frontend/src/components/FindingsPanel.tsx - Finding discussion → Typed API client: sends messages
frontend/src/components/DiscussionView.tsx - Review history → Typed API client: loads history
frontend/src/components/ReviewDetailsDrawer.tsx - Review polling → Typed API client: polls reviews
frontend/src/hooks/useReviewPolling.ts - Typed API client → FastAPI application: calls API
README.md - FastAPI application → Snippet endpoints: registers
backend/app/main.py - FastAPI application → Review endpoints: registers
backend/app/main.py - FastAPI application → Finding decisions: registers
backend/app/main.py - FastAPI application → Finding messages: registers
backend/app/main.py - FastAPI application → Rubric endpoint: registers
backend/app/main.py - Review endpoints → Background worker: enqueues review
backend/app/routers/reviews.py - Background worker → Output validation: validates output
backend/app/worker.py - Background worker → Provider selection: selects provider
backend/app/worker.py - Provider selection → Provider interface: returns implementation
backend/app/providers/factory.py - Provider selection → Ollama provider: selects
backend/app/providers/factory.py - Provider selection → OpenAI provider: selects
backend/app/providers/factory.py - Provider selection → Mock provider: selects
backend/app/providers/factory.py - Ollama provider → Provider interface: implements
backend/app/providers/ollama.py - OpenAI provider → Provider interface: implements
backend/app/providers/openai.py - Mock provider → Provider interface: implements
backend/app/providers/mock.py - Ollama provider → Configured model service: calls model
README.md - OpenAI provider → Configured model service: calls model
README.md - Background worker → SQLite database: reads and writes
backend/app/worker.py - Snippet endpoints → SQLite database: reads and writes
backend/app/routers/snippets.py - Review endpoints → SQLite database: reads
backend/app/routers/reviews.py - Finding decisions → SQLite database: reads and writes
backend/app/routers/findings.py - Finding messages → SQLite database: reads and writes
backend/app/routers/messages.py - Rubric endpoint → Review rubric: serves
backend/app/routers/rubric.py - SQLite database → Domain records: maps records
backend/app/models.py - Background worker → Domain records: persists reviews
backend/app/worker.py - Snippet endpoints → Domain records: uses records
backend/app/routers/snippets.py - Finding decisions → Domain records: uses records
backend/app/routers/findings.py - Finding messages → Provider interface: requests discussion
backend/app/routers/messages.py - Ollama provider → Review rubric: uses prompts
backend/app/providers/ollama.py - OpenAI provider → Review rubric: uses prompts
backend/app/providers/openai.py