How xiaolang-d3/careerloop works
Purpose and Runtime
CareerLoop is a local-first job-search assistant: it manages candidate materials, evaluates opportunities, generates tailored resume content, and prepares interviews. It runs a React/Vite frontend against a Python 3.11+ FastAPI backend, using SQLite with sqlite-vec and local attachment storage. Model calls use the OpenAI Python SDK through configurable providers. Entry points are backend/app/main.py and frontend/src/main.tsx; local orchestration is scripts/dev.sh.
Frontend Application Shell
The React 19 SPA owns navigation, authentication gating, API access, and workspace composition. frontend/src/AppStyles.tsx and frontend/src/components/WorkspaceViews.tsx establish the primary shell/views; frontend/src/api/client.ts is the backend boundary. Major user flows are rendered as dedicated feature workspaces:
• Job evaluation: frontend/src/features/jobs/JobEvaluationPage.tsx
• Opportunity discovery: frontend/src/features/opportunities/OpportunityDiscoveryPage.tsx
• Interview preparation: frontend/src/features/interview/InterviewPreparationPage.tsx
• Agent/model/profile operations: frontend/src/features/settings/SettingsWorkspace.tsx
HTTP API, Identity, and Persistence Boundary
FastAPI exposes resource endpoints and request/response schemas through backend/app/api/resources.py and backend/app/api/schemas.py; dependency wiring is in backend/app/api/dependencies.py. Local administrator authentication is implemented in backend/app/auth.py. Database initialization/lifecycle is separated from domain behavior in backend/app/database_lifecycle.py and backend/app/db.py. Persistent local data includes SQLite records, vector-backed retrieval, and attachments; attachments are mediated rather than exposed directly via backend/app/attachments/service.py.
Agent Runtime and Model Integration
The agent subsystem turns user tasks into controlled model/tool executions. backend/app/agent/runtime.py owns runtime behavior, backend/app/agent/orchestration.py coordinates execution, and backend/app/agent/operations.py supports operational visibility/control. Model provider configuration and OpenAI-compatible adaptation sit in backend/app/agent/settings.py and backend/app/models/openai_compatible.py. Tool invocations and model behavior have explicit observability boundaries in backend/app/observability/tool_call_audit.py and backend/app/observability/model_monitor.py.
Candidate Knowledge and Conversation Context
Candidate information is maintained as structured profile, document, and memory data, providing the grounding layer for later analyses. Core profile service and durable candidate state are in backend/app/profile/service.py, backend/app/profile/candidate_core.py, and backend/app/profile/candidate_memory.py. Resume parsing/versioning are isolated in backend/app/resume/parser.py and backend/app/resume/versions.py. Chat sessions are persisted and streamed through backend/app/chat/conversations.py and backend/app/chat/service.py.
Opportunity Processing and Workflows
Job inputs enter through import and page-analysis jobs, then become evaluable opportunities and reusable runs. Ingestion stages live in backend/app/jobs/imports.py, backend/app/jobs/import_agent.py, and backend/app/jobs/page_ai.py; matching/evaluation is in backend/app/jobs/quick_match.py and backend/app/jobs/evaluations.py. Opportunity state and executions are managed by backend/app/opportunities/service.py and backend/app/opportunities/runs.py. Cross-step work is represented by the workflow engine and stages in backend/app/workflow/engine.py and backend/app/workflow/stages.py.
Grounded AI Capabilities and External Research
The agent accesses focused tools instead of embedding all domain behavior in prompts. Resume-vs-job analysis, tailored content, and interview advice are implemented in backend/app/tools/analyze_resume_against_jd.py, backend/app/tools/generate_tailored_resume_content.py, and backend/app/tools/generate_interview_advice.py. Local retrieval uses backend/app/tools/search_resume_evidence.py; public-web/company research crosses the network boundary through backend/app/research/web.py and backend/app/research/company_cache.py. Privacy operations are centralized in backend/app/privacy/service.py.
Main entry points: AppStyles.tsx SPA shell · resources.py Resource API · service.py Candidate knowledge · runtime.py Agent runtime
Components 22
React SPA
- SPA shell · Navigation, auth gating, and workspace composition.
frontend/src/AppStyles.tsx - API client
frontend/src/api/client.ts - Job evaluation
frontend/src/features/jobs/JobEvaluationPage.tsx - Opportunity discovery
frontend/src/features/opportunities/OpportunityDiscoveryPage.tsx - Interview preparation
frontend/src/features/interview/InterviewPreparationPage.tsx - Settings workspace
frontend/src/features/settings/SettingsWorkspace.tsx
FastAPI Boundary
- FastAPI application
backend/app/main.py - Resource API · Exposes resource endpoints through injected dependencies.
backend/app/api/resources.py - Local admin auth
backend/app/auth.py
Agent & AI Runtime
- Agent runtime · Runs controlled model and tool executions.
backend/app/agent/runtime.py - Agent orchestration
backend/app/agent/orchestration.py - OpenAI-compatible models · Configurable model-provider boundary using the OpenAI SDK.
backend/app/models/openai_compatible.py - Model and tool audit
backend/app/observability/tool_call_audit.py - Grounded career tools · Analysis, tailoring, interview advice, retrieval, and web research.
backend/app/tools/analyze_resume_against_jd.py
Candidate & Opportunity Domain
- Candidate knowledge · Structured candidate profile, documents, and durable memory.
backend/app/profile/service.py - Resume parsing & versions
backend/app/resume/parser.py - Conversation service · Persists and streams chat sessions.
backend/app/chat/service.py - Opportunity workflows · Coordinates reusable cross-step opportunity runs.
backend/app/workflow/engine.py - Job ingestion & evaluation · Imports, analyzes pages, matches candidates, and evaluates jobs.
backend/app/jobs/imports.py
Local Persistence
- SQLite + vector retrieval · Durable records and vector-backed retrieval.
backend/app/db.py - Attachment service · Mediates access to local attachments.
backend/app/attachments/service.py
Other components
- Local dev launcher · Starts the local frontend and backend stack.
scripts/dev.sh
Connections 26
- Local dev launcher → SPA shell: starts
- Local dev launcher → FastAPI application: starts
- SPA shell → API client: uses
- SPA shell → Job evaluation: renders
- SPA shell → Opportunity discovery: renders
- SPA shell → Interview preparation: renders
- SPA shell → Settings workspace: renders
- API client → FastAPI application: HTTP
- FastAPI application → Resource API: routes requests
- Resource API → Local admin auth: authenticates
- Resource API → Candidate knowledge: manages
- Resource API → Conversation service: serves
- Resource API → Opportunity workflows: starts and reads
- Opportunity workflows → Job ingestion & evaluation: runs stages
- Opportunity workflows → Agent orchestration: delegates AI work
- Agent orchestration → Agent runtime: coordinates
- Agent runtime → OpenAI-compatible models: calls models
- Agent runtime → Grounded career tools: invokes tools
- Agent runtime → Model and tool audit: audits
- Grounded career tools → Candidate knowledge: grounds on
- Candidate knowledge → Resume parsing & versions: uses resumes
- Candidate knowledge → SQLite + vector retrieval: persists
- Job ingestion & evaluation → SQLite + vector retrieval: persists opportunities
- Conversation service → SQLite + vector retrieval: persists sessions
- Attachment service → SQLite + vector retrieval: associates metadata
- Candidate knowledge → Attachment service: accesses documents