Summarize your CV compatibility with jobdesc with Google Gemini
Go to file
2025-02-12 20:00:57 +07:00
.github/workflows Create docker-image.yml pipeline 2025-02-12 19:15:15 +07:00
static first 2025-02-12 01:05:18 +07:00
templates first 2025-02-12 01:05:18 +07:00
.gitignore first 2025-02-12 01:05:18 +07:00
app.py markdown formatting improvement 2025-02-12 18:49:02 +07:00
docker-compose.yml fix wrong docker-compose.yml 2025-02-12 19:10:04 +07:00
Dockerfile first 2025-02-12 01:05:18 +07:00
env.example first 2025-02-12 01:05:18 +07:00
README.md Update README.md 2025-02-12 20:00:57 +07:00
requirements.txt markdown formatting improvement 2025-02-12 18:49:02 +07:00

CV / Resume Jobdesc Compatibility Checker

This project is a Flask-based web service that allows users to upload their resumes in PDF format and compare them against a given job description. The application uses Google's Gemini AI to analyze compatibility and provide a score out of 100.

Features

  • Upload a resume in PDF format
  • Analyze compatibility against a provided job description
  • Convert PDF to images for AI processing
  • Secure API with CSRF protection and reCAPTCHA validation
  • Rate-limiting to prevent abuse
  • Uses Flask-Limiter, Flask-WTF, and Flask-CORS for security enhancements
  • Deletes uploaded files after processing

Requirements

Before running the application, ensure you have the following dependencies installed:

  • Python 3.8+
  • Flask
  • Flask-WTF
  • Flask-CORS
  • Flask-Limiter
  • PyMuPDF (fitz)
  • pdf2image
  • Pillow
  • Google Generative AI SDK
  • python-dotenv
  • requests
  • markdown

Install dependencies using:

pip install -r requirements.txt

Environment Variables

Create a .env file in the root directory and configure the following:

GOOGLE_API_KEY=<your_google_api_key>
UPLOAD_FOLDER=uploads/
MAX_FILE_SIZE=4194304  # 4MB limit
SECRET_KEY=<your_secret_key>
RATE_LIMIT=1 per 10 seconds
RECAPTCHA_SECRET_KEY=<your_recaptcha_secret_key>
RECAPTCHA_SITE_KEY=<your_recaptcha_site_key>
CORS_ORIGIN=<your_allowed_origin>
FLASK_RUN_HOST=0.0.0.0
FLASK_RUN_PORT=49465

Usage

Running the Application

Start the Flask server:

flask run --host=0.0.0.0 --port=49465

or

python app.py

API Endpoints

GET /

Returns the upload page with reCAPTCHA integration.

POST /

Accepts form data with a job description and a PDF resume.

  • Parameters:

    • g-recaptcha-response: Required for reCAPTCHA verification.
    • text_input: The job description.
    • file: A valid PDF file (max 4MB).
  • Response:

    {
      "summary": "Resume compatibility summary",
      "score": 85
    }
    
    • Returns a compatibility summary and a score (0-100).
    • If reCAPTCHA fails, returns { "error": "reCAPTCHA verification failed." }.
    • If the PDF is invalid, returns { "error": "Invalid or potentially harmful PDF." }.

Security Features

  • CSRF Protection: Uses Flask-WTF for CSRF token validation.
  • Rate Limiting: Limits users to 1 request per 10 seconds.
  • reCAPTCHA: Ensures human users.
  • PDF Sanitization: Checks for JavaScript, embedded files, and potential security threats.
  • Secure Headers: Implements X-Frame-Options, Content-Security-Policy, and other security headers.

Deployment

To deploy this application in development mode, use:

flask run --host=0.0.0.0 --port=49465

or

python app.py

You can also deploy it using Docker, Nginx, or cloud services like AWS, Google Cloud, or Heroku.