Smart ATS API is a powerful backend service designed to evaluate resumes against job descriptions using Google's Generative AI. The API simulates an Application Tracking System (ATS) and provides comprehensive insights into how well a resume aligns with a job description by analyzing keywords, content relevance, and generating tailored improvement recommendations.
- Upload Resume: Upload a PDF resume for analysis through the API
- Job Description Matching: Provide the job description to evaluate how well the resume aligns with the role
- Keyword Matching: The system identifies missing keywords crucial for optimizing the resume for ATS
- Profile Summary: Summarizes the key strengths of the resume and areas for improvement based on the job description
- REST API: FastAPI backend for easy integration with frontend applications
- Modular Architecture: Well-organized codebase for easy maintenance and extension
- Comprehensive Documentation: Interactive API documentation with Swagger UI
- FastAPI: High-performance API framework with automatic OpenAPI documentation
- Uvicorn: ASGI server for serving the FastAPI application
- Pydantic: Data validation and settings management
- Python-Multipart: Handling file uploads and form data
- Google Generative AI: Gemini 1.5 Flash model for intelligent resume analysis
- PyPDF2: PDF parsing and text extraction
- pytest: Comprehensive testing framework
- pytest-mock: Mocking framework for unit tests
- httpx: HTTP client for API testing
- python-dotenv: Environment variable management
- Modular Architecture: Clean separation of concerns with a well-structured codebase
Ensure you have Python 3.12+ installed on your machine. Then, clone the repository and set up the environment using the provided setup script.
-
Clone the repository:
git clone https://github.com/austinLorenzMccoy/Smart_ATS_LLM_app.git
-
Navigate to the project directory:
cd -Smart_ATS_LLM_app
-
Run the setup script to create a virtual environment and install dependencies:
chmod +x setup.sh # Make the script executable if needed ./setup.sh
-
Activate the virtual environment:
source atsLLMapp2_env/bin/activate # On Windows: .\atsLLMapp2_env\Scripts\activate
Create a .env
file in the project root directory and add your Google API key:
GOOGLE_API_KEY=your_google_api_key
To start the FastAPI server:
python api.py
The API will be available at http://localhost:8000
with interactive documentation at http://localhost:8000/docs
- Description: Welcome endpoint
- Response: Simple welcome message
- Example:
curl -X GET "http://localhost:8000/"
- Description: Analyze a resume against a job description
- Request:
job_description
(form field): The job description textresume
(file upload): The resume PDF file
- Response: JSON with the following fields:
jd_match
: Percentage match with the job descriptionmissing_keywords
: List of keywords from the job description not found in the resumeprofile_summary
: Summary of the candidate's profile and suggestions
- Example:
curl -X POST "http://localhost:8000/analyze" \ -H "accept: application/json" \ -F "job_description=Software Engineer with 5+ years of Python experience" \ -F "resume=@/path/to/your/resume.pdf"
FastAPI provides interactive API documentation:
- Swagger UI: Visit
http://localhost:8000/docs
for an interactive interface to test the API - ReDoc: Visit
http://localhost:8000/redoc
for alternative documentation
{
"jd_match": "85%",
"missing_keywords": ["Docker", "Kubernetes", "CI/CD"],
"profile_summary": "Strong Python developer with excellent backend experience. Consider adding more details about containerization and deployment experience."
}
The API provides a RESTful interface for programmatic access to the resume analysis functionality. You can use tools like curl or any HTTP client to interact with the API.
# Check API status
curl -X GET "http://localhost:8000/"
# Analyze a resume
curl -X POST "http://localhost:8000/analyze" \
-H "accept: application/json" \
-F "job_description=Software Engineer with 5+ years of Python experience" \
-F "resume=@/path/to/your/resume.pdf"
Hereβs an example of how the app generates responses:
{
"JD Match": "85%",
"MissingKeywords": ["Python", "Data Science", "Machine Learning"],
"Profile Summary": "The resume is strong in software engineering but lacks significant keywords related to data science..."
}
.
βββ api.py # API entry point for FastAPI backend
βββ requirements.txt # Project dependencies
βββ setup.sh # Environment setup script
βββ pytest.ini # Pytest configuration
βββ .env # Environment variables (not in repo)
βββ .gitignore # Git ignore file
βββ README.md # Project documentation
βββ src/ # Source code directory
β βββ __init__.py # Package initialization
β βββ api/ # API module
β β βββ __init__.py
β β βββ api.py # FastAPI implementation
β βββ config/ # Configuration module
β β βββ __init__.py
β β βββ config.py # Environment and configuration management
β βββ models/ # AI models module
β β βββ __init__.py
β β βββ gemini.py # Google Gemini AI integration
β βββ utils/ # Utilities module
β βββ __init__.py
β βββ pdf_utils.py # PDF processing utilities
β βββ prompts.py # AI prompt templates
βββ tests/ # Test directory
βββ test_api.py # API tests
βββ test_config.py # Configuration tests
βββ test_gemini.py # AI model tests
βββ test_pdf_utils.py # PDF utility tests
βββ test_prompts.py # Prompt template tests
The project includes comprehensive tests for all components. To run the tests:
# Activate the virtual environment if not already activated
source atsLLMapp2_env/bin/activate # On Windows: .\atsLLMapp2_env\Scripts\activate
# Run all tests
python -m pytest
# Run tests with verbose output
python -m pytest -v
# Run specific test file
python -m pytest tests/test_api.py
The test suite covers:
- API endpoints functionality
- Configuration loading
- Google Gemini AI integration
- PDF text extraction
- Prompt template generation
To run tests with coverage report:
python -m pytest --cov=src tests/
When the FastAPI server is running, you can access the interactive API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
The project includes a setup.sh
script that handles environment setup:
- Removes any existing virtual environment directory
- Creates a new Python virtual environment
- Installs all required dependencies from
requirements.txt
- Installs additional development dependencies for testing
This ensures a clean, consistent environment for development and testing.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Special thanks to:
- Streamlit for the interactive web UI framework
- FastAPI for the high-performance API framework
- Google Generative AI for the powerful Gemini model
- PyPDF2 for PDF processing capabilities
- All the open-source contributors who make these tools possible
This project is licensed under the MIT License - see the LICENSE file for details.