From f44cb1935f8fbed94a7f3a36047a784395309588 Mon Sep 17 00:00:00 2001 From: rahul-aot Date: Sun, 4 Jan 2026 20:44:35 -0800 Subject: [PATCH] feat: initialize project with Docker, Docker Compose, CI linting, and documentation. --- .dockerignore | 32 ++++++++++++++++++++++++ .env.example | 1 + .github/workflows/lint.yml | 28 +++++++++++++++++++++ Dockerfile | 24 ++++++++++++++++++ README.md | 51 ++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 13 ++++++++++ requirements.txt | 5 ++++ 7 files changed, 154 insertions(+) create mode 100644 .dockerignore create mode 100644 .env.example create mode 100644 .github/workflows/lint.yml create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml create mode 100644 requirements.txt diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c30ef8d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,32 @@ +# Git +.git +.gitignore + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.env +.venv +env/ +venv/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# Streamlit +.streamlit/ diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..cda1e2f --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +GEMINI_API_KEY=your_gemini_api_key_here diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..df2c583 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: Lint Code + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c77868c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Use an official Python runtime as a parent image +FROM python:3.10-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy the requirements file into the container +COPY requirements.txt . + +# Install any needed packages specified in requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the application code +COPY . . + +# Expose the port Streamlit runs on +EXPOSE 8501 + +# Define environment variable to prevent .pyc files +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +# Command to run the application +CMD ["streamlit", "run", "main.py", "--server.port=8501", "--server.address=0.0.0.0"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..516ab53 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# ResumeParserAI + +A Streamlit-based application that parses resumes (PDF) using Google Gemini AI to generate professional summaries and extract structured data. + +## Features +- **PDF Upload**: Upload your resume in PDF format. +- **AI Analysis**: Uses Google Gemini Pro/Flash to analyze the content. +- **Structured Extraction**: Extracts Name, Email, Location, Work Experience, Projects, Skills, and Education. +- **Professional Summary**: Generates an engaging first-person summary. + +## Prerequisites +- Docker and Docker Compose installed on your machine. +- A Google Gemini API Key. + +## Getting Started + +### 1. Clone the repository +```bash +git clone +cd ResumeParserAI +``` + +### 2. Environment Setup +Create a `.env` file from the example: +```bash +cp .env.example .env +``` +Open `.env` and add your Gemini API key: +``` +GEMINI_API_KEY=your_actual_api_key_here +``` + +### 3. Run with Docker Compose +Start the application: +```bash +docker-compose up --build +``` +Access the application at `http://localhost:8501`. + +### 4. Run Locally (Optional) +If you prefer running without Docker: +```bash +pip install -r requirements.txt +streamlit run main.py +``` + +## Project Structure +- `main.py`: Main application logic. +- `requirements.txt`: Python dependencies. +- `Dockerfile`: Docker construction instructions. +- `docker-compose.yml`: Container orchestration. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..859d8eb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' + +services: + resume-parser: + build: . + ports: + - "8501:8501" + env_file: + - .env + volumes: + - .:/app + environment: + - GEMINI_API_KEY=${GEMINI_API_KEY} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d615b8f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +streamlit +python-dotenv +PyPDF2 +google-generativeai +flake8