How akanemo22/coc-working works
Cóc Đi Làm is a browser-based Vietnamese mock-interview product: a candidate selects a CV and specific job/framework, completes a microphone-driven interview, then receives a rubric report after the session ends. The browser handles speech detection and audio interaction; a single FastAPI backend coordinates candidate context, interview decisions, question generation, speech recognition and synthesis, and evaluation. Redis holds hot session state, with database infrastructure also present. The README documents several runtime links, while sampled source is incomplete; unsupported implementation-level connections are omitted.
Main entry points: sessions.py Session and report API · websocket.py Interview turn manager · main.py FastAPI application · api.py Candidate API
Components 34
Browser experience
- CV and JD selection
frontend/src/app/interview/page.tsx - Live interview UI
frontend/src/app/interview/[sessionId]/page.tsx - Audio capture
frontend/src/hooks/useAudioRecorder.ts - Browser voice detection
frontend/src/workers/vad.worker.ts - Interview socket client
frontend/src/hooks/useInterviewSocket.ts - Interview report
frontend/src/app/report/[sessionId]/page.tsx
Candidate and framework
- Candidate API
backend/app/domains/candidate/api.py - CV analysis
backend/app/domains/candidate/services/cv_analyzer.py - Candidate context
backend/app/domains/candidate/context.py - Candidate data facade
backend/app/domains/candidate/facade.py - Candidate catalog
backend/app/domains/candidate/catalog.py
Interview runtime
- Interview frameworks
backend/app/domains/interview/catalog.py - Session and report API
backend/app/domains/interview/api/sessions.py - Question API
backend/app/domains/interview/api/questions.py - Interview turn manager
backend/app/domains/interview/websocket.py - Hard policy engine
backend/app/domains/interview/services/hard_policy_engine.py - Laya decision controller
backend/app/domains/interview/services/laya_controller.py - Question generation
backend/app/domains/interview/services/questions.py - Dialogue orchestration
backend/app/domains/interview/services/dialogue.py - Interview guidance
backend/app/domains/interview/services/guidance.py - Reverse interview
backend/app/domains/interview/services/reverse_interview_service.py - Rubric evaluator
backend/app/domains/interview/services/evidence_evaluator.py - Report service
backend/app/domains/interview/services/report_service.py
Speech services
- Speech API
backend/app/domains/speech/api.py - Qwen speech recognition
- VieNeu speech synthesis
State and infrastructure
- Session state store
backend/app/shared/infrastructure/redis.py - Supabase database
backend/app/shared/infrastructure/database.py - Normalized data store
backend/app/shared/infrastructure/normalized_data.py - Domain contracts
backend/app/shared/contracts.py - Backend settings
backend/app/shared/config.py - FastAPI application
backend/app/main.py
Other components
- Candidate
- Gemini API
Connections 44
- Candidate → CV and JD selection: selects CV and JD
README.md - CV and JD selection → Candidate API: requests candidate data
- CV and JD selection → Session and report API: creates session
README.md - Candidate API → CV analysis: analyzes CV
backend/app/domains/candidate/api.py - Candidate API → Candidate context: loads context
backend/app/domains/candidate/api.py - Candidate API → Candidate catalog: uses catalog
backend/app/domains/candidate/api.py - Candidate API → Candidate data facade: requests interview data
backend/app/domains/candidate/api.py - Session and report API → Candidate data facade: loads session context
backend/app/domains/interview/api/sessions.py - Session and report API → Interview frameworks: resolves framework
backend/app/domains/interview/api/sessions.py - Candidate data facade → Candidate catalog: reads candidate data
backend/app/domains/candidate/facade.py - Candidate data facade → Candidate context: builds context
backend/app/domains/candidate/facade.py - Interview frameworks → Normalized data store: reads records
backend/app/domains/interview/catalog.py - Session and report API → Session state store: stores session state
backend/app/domains/interview/api/sessions.py - Live interview UI → Audio capture: captures microphone
README.md - Audio capture → Browser voice detection: sends audio chunks
- Live interview UI → Interview socket client: uses socket client
- Interview socket client → Interview turn manager: streams interview turns
README.md - Interview turn manager → Speech API: requests speech recognition
- Speech API → Qwen speech recognition: transcribes audio
README.md - Interview turn manager → Hard policy engine: validates actions
backend/app/domains/interview/websocket.py - Interview turn manager → Laya decision controller: requests decisions
backend/app/domains/interview/websocket.py - Interview turn manager → Question generation: requests questions
backend/app/domains/interview/websocket.py - Question generation → Dialogue orchestration: delegates dialogue
backend/app/domains/interview/services/questions.py - Question generation → Interview frameworks: uses framework
backend/app/domains/interview/services/questions.py - Dialogue orchestration → Interview guidance: uses guidance
backend/app/domains/interview/services/dialogue.py - Dialogue orchestration → Interview frameworks: uses interview catalog
backend/app/domains/interview/services/dialogue.py - Dialogue orchestration → Gemini API: generates interview text
README.md - Interview turn manager → Reverse interview: routes reverse interview
backend/app/domains/interview/websocket.py - Live interview UI → Speech API: requests speech synthesis
README.md - Speech API → VieNeu speech synthesis: synthesizes speech
README.md - Session and report API → Rubric evaluator: evaluates completed session
backend/app/domains/interview/api/sessions.py - Rubric evaluator → Gemini API: scores rubric
README.md - Session and report API → Report service: builds report
backend/app/domains/interview/api/sessions.py - Report service → Session state store: reads report state
backend/app/domains/interview/services/report_service.py - Interview report → Session and report API: retrieves report
- FastAPI application → Candidate API: mounts router
backend/app/main.py - FastAPI application → Session and report API: mounts router
backend/app/main.py - FastAPI application → Question API: mounts router
backend/app/main.py - FastAPI application → Interview turn manager: mounts WebSocket
backend/app/main.py - FastAPI application → Speech API: mounts router
backend/app/main.py - FastAPI application → Backend settings: loads settings
backend/app/main.py - Interview turn manager → Session state store: persists turn state
backend/app/domains/interview/websocket.py - Session and report API → Domain contracts: uses request schemas
backend/app/domains/interview/api/sessions.py - FastAPI application → Supabase database: initializes database
backend/app/main.py