A FastAPI-based backend service for AI-powered resume analysis and job matching.
smartcv/
│
├── app/
│ ├── main.py # FastAPI application entry point
│ ├── routes/
│ │ └── resume.py # Resume-related API endpoints
│ ├── services/
│ │ └── parser.py # Resume parsing service (placeholder)
│ └── models/
│ └── schema.py # Pydantic models for API responses
│
├── uploads/ # Temporary file storage (to be implemented)
├── requirements.txt # Python dependencies
└── README.md # This file
- Health Check: Root endpoint for API status
- File Upload: Resume upload endpoint with validation
- Format Support: PDF and DOCX file validation
- Error Handling: Comprehensive error responses
- AI-powered resume content analysis
- Skill extraction and matching
- ATS scoring algorithm (0-100)
- Keyword matching analysis
- AI feedback generation (Google GenAI)
- Resume text extraction (PDF/DOCX)
- Docker containerization
GET /
Returns API status and version information.
GET /api/v1/health
Returns detailed service health and AI capability status.
POST /api/v1/upload-resume
Content-Type: multipart/form-data
Upload a resume file (PDF/DOCX only).
Response:
{
"file_path": "/app/uploads/resume.pdf",
"original_filename": "resume.pdf",
"extracted_text": "Resume content here...",
"text_preview": "First 100 characters...",
"text_length": 1500,
"status": "success",
"message": "Resume uploaded and parsed successfully"
}POST /api/v1/analyze-resume
Content-Type: application/json
Analyze resume against job description with ATS scoring and AI feedback.
Request:
{
"resume_text": "Software Engineer with 5 years experience...",
"job_description": "Looking for Python developer with AWS..."
}Response:
{
"score": 85,
"matched_keywords": ["python", "aws", "react"],
"missing_keywords": ["kubernetes", "docker"],
"breakdown": {
"keyword_match_score": 45.0,
"technical_skill_score": 15.0,
"length_score": 10.0,
"frequency_score": 8.0
},
"insights": {
"keyword_match_ratio": "8/10",
"resume_length_words": 450,
"recommendation": "Excellent match! Your resume strongly aligns..."
},
"feedback": {
"strengths": ["Good technical alignment", "Relevant experience"],
"weaknesses": ["Missing some key skills"],
"suggestions": ["Add Kubernetes experience", "Quantify achievements"]
}
}GET /api/v1/supported-formats
Returns list of supported file formats and size limits.
- Install dependencies:
pip install -r requirements.txt- Run the application:
uvicorn app.main:app --reloadThe API will be available at http://localhost:8000
Once running, visit:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
- ✅ Project structure setup
- ✅ Basic FastAPI application
- ✅ File upload endpoint
- ✅ Resume text extraction (PDF/DOCX)
- ✅ ATS scoring algorithm
- ✅ Keyword matching analysis
- ✅ AI feedback generation (Google GenAI)
- ✅ Docker containerization
- ✅ Environment variable support
- ✅ Health monitoring endpoints
- ✅ Docker Compose setup
- Implement database storage
- Add authentication
- Create comprehensive tests
- Create comprehensive tests
- Framework: FastAPI
- Validation: Pydantic
- Server: Uvicorn
- File Handling: Python-multipart
- PDF Processing: pdfplumber
- DOCX Processing: python-docx
- AI Integration: Google GenAI SDK
- Containerization: Docker & Docker Compose
- Environment: python-dotenv
- Logging: RotatingFileHandler
# Initialize Git repository
git init
# Add all files (excluding .gitignore patterns)
git add .
# Create initial commit
git commit -m "Initial commit: FastAPI resume parser MVP"Why uploads/ should NOT be committed:
- Contains user-uploaded resume files with personal information
- Files are stored with UUID names but still contain sensitive data
- Directory can grow indefinitely and shouldn't be in version control
- Each deployment/environment should have its own uploads directory
Why venv/ should NOT be committed:
- Virtual environment is specific to your machine and Python version
- Contains binary files that aren't portable across systems
- Can be easily recreated with
pip install -r requirements.txt - Different developers may use different Python versions/OS
# Create virtual environment (once per developer)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create uploads directory (if not exists)
mkdir -p uploads
# Run the application
uvicorn app.main:app --reloadThe included .gitignore file already excludes:
- Virtual environments (
venv/,env/) - Python cache files (
__pycache__/,*.pyc) - Upload directory (
uploads/) - IDE files (
.vscode/,.idea/) - OS files (
.DS_Store,Thumbs.db)
- Follow the existing code structure
- Add appropriate error handling
- Include docstrings for new functions
- Update API documentation
- Test file uploads with different formats
- Check logs for any issues
- Docker installed on your system
- Google GenAI API key (optional, for AI feedback)
-
Configure Environment Variables
cp .env.example .env # Edit .env with your Google GenAI API key -
Build Docker Image
docker build -t smartcv . -
Run Container
docker run -p 8000:8000 --env-file .env smartcv
-
Configure Environment
cp .env.example .env # Edit .env with your configuration -
Run with Docker Compose
docker-compose up -d
-
Stop Services
docker-compose down
- Health Checks: Automatic health monitoring on
/health - Volume Mounts: Persistent uploads and logs
- Environment Variables: Secure configuration
- Production Ready: Optimized for deployment
Once running, access the API at:
- API Documentation: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
- Upload Endpoint: http://localhost:8000/api/v1/upload-resume
- Analysis Endpoint: http://localhost:8000/api/v1/analyze-resume
Container Logs
# View logs
docker logs smartcv
# Follow logs in real-time
docker logs -f smartcvCommon Issues
- Ensure port 8000 is not already in use
- Check that .env file exists with proper API key
- Verify Docker daemon is running
Development with Docker
# Rebuild without cache
docker build --no-cache -t smartcv .
# Run in interactive mode
docker run -it -p 8000:8000 --env-file .env smartcv /bin/bashMIT License