How alancode59/ai-cv-backend works
AI CV Analyzer accepts CV text or PDF plus a job description, evaluates the match with Cerebras AI, persists the analysis, and returns a structured score, skills, and recommendations. The PDF path validates and extracts text before analysis; history endpoints retrieve persisted results. The integrated web interface submits PDF analyses and displays results, while health endpoints check MongoDB and AI connectivity. The graph follows the documented and excerpted calls; the user routes are present but not registered by the shown application entry point.
Main entry points: cv_routes.py CV endpoints · ai_service.py AI analysis · main.py FastAPI app · health_routes.py Health endpoints
Components 16
Web interface
- Analyzer page
app/templates/index.html - Browser interaction
app/static/js/app.js - Page styling
app/static/css/styles.css
API and validation
- FastAPI app
app/main.py - CV endpoints
app/routes/cv_routes.py - Health endpoints
app/routes/health_routes.py - Analysis schema
app/schemas/cv_schema.py
Analysis services
- PDF validation and extraction
app/services/pdf_service.py - Analysis orchestration
app/services/cv_service.py - AI analysis
app/services/ai_service.py - Analysis prompt
app/prompts/cv_prompt.py
Persistence
- Analysis repository
app/repositories/cv_repository.py - Mongo connection
app/models/mongo.py
Other components
- User
- Cerebras AI
- MongoDB
Connections 17
- User → Analyzer page: uses
README.md - FastAPI app → Analyzer page: renders
app/main.py - Browser interaction → CV endpoints: submits PDF
app/static/js/app.js - Browser interaction → Analyzer page: updates results
app/static/js/app.js - FastAPI app → CV endpoints: registers
app/main.py - FastAPI app → Health endpoints: registers
app/main.py - CV endpoints → Analysis schema: validates responses
app/routes/cv_routes.py - CV endpoints → PDF validation and extraction: validates and extracts
app/routes/cv_routes.py - CV endpoints → Analysis orchestration: requests analysis
app/routes/cv_routes.py - Analysis orchestration → AI analysis: requests evaluation
app/services/cv_service.py - AI analysis → Analysis prompt: formats prompt
app/services/ai_service.py - AI analysis → Cerebras AI: requests completion
app/services/ai_service.py - Analysis orchestration → Analysis repository: saves and retrieves
app/services/cv_service.py - Analysis repository → Mongo connection: gets database
app/repositories/cv_repository.py - Mongo connection → MongoDB: connects to
- Health endpoints → Mongo connection: checks database
app/routes/health_routes.py - Health endpoints → AI analysis: checks AI
app/routes/health_routes.py