GitHub - kar137/Resume-Analyzer-FastAPI: microservice built with FastAPI to analyze resume

A microservice built with FastAPI that analyzes resumes (PDF/DOCX) and extracts skills. This project demonstrates modern backend practices and applies the 12-Factor App principles.


πŸ‘¨β€πŸ’» Tech Stack Used


πŸš€ Features

  • πŸ“„ Upload PDF or DOCX resumes
  • 🧠 Analyze resume content to extract:
    • Detected skills
    • Word/sentence count
  • πŸ”„ Background processing using FastAPI’s BackgroundTasks
  • ⚑ Async endpoints and DB operations
  • πŸ§ͺ Pytest-based test coverage
  • 🐳 Dockerized with optional Docker Compose
  • πŸ“‹ CI/CD with GitHub Actions
  • βœ… Clean architecture using FastAPI routers & dependencies
  • 🧾 Follows 12-Factor principles

πŸ“ Project Structure

resume-analyzer-fastapi/
β”‚
β”œβ”€β”€ app/                 
β”‚   β”œβ”€β”€ core/                # Config, logging, dependencies
β”‚   β”œβ”€β”€ services/            # Business logic: parsing, analysis
β”‚   β”œβ”€β”€ models/              # Pydantic and ORM models
β”‚   β”œβ”€β”€ db/                  # DB session and setup
β”‚   └── main.py              # FastAPI entry point
β”‚
β”œβ”€β”€ tests/                   # Pytest test cases
β”œβ”€β”€ .env                     # Environment variables
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ docker-compose.yml       
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .github/workflows/       # GitHub Actions
└── README.md

βš™οΈ Setup & Run

πŸ”§ Prerequisites

  • Python 3.10+
  • Docker (for containerized setup)

🐍 Local Setup (Without Docker)

# 1. Clone the repo
git clone https://github.com/kar137/Resume-Analyzer-FastAPI.git
cd Resume-Analyzer-FastAPI

# 2. Create virtual environment
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Set environment variables
cp .env.example env

# 5. Run the app
uvicorn app.main:app --reload

🐳 Docker Setup

# Build and run using Docker Compose
docker-compose up --build

πŸ§ͺ Running Tests


πŸ“₯ API Endpoints

Method Endpoint Description
POST /upload/ Upload a resume for analysis
GET /result/{analysis_id} Fetch analyzed data by ID

Open Swagger Docs at:
http://localhost:8000/docs


πŸ§ͺ FastAPI Concepts Used

βœ… Dependency Injection
βœ… Background Tasks
βœ… Pydantic Settings & Models
βœ… Routers
βœ… Custom Exceptions
βœ… Middleware
βœ… Async DB Calls
βœ… Event Handlers (startup, shutdown)


πŸ“¦ 12-Factor Implementation Highlights

Principle Implementation
Config .env + pydantic.BaseSettings
Dependencies Defined in requirements.txt
Backing services Docker Compose
Dev/prod parity Docker enables consistent environments
Logs Configurable logging using Python logging module
Admin processes CLI scripts or FastAPI endpoints (e.g., DB init, cache clear)

πŸ“Έ Demo

https://youtu.be/GumG3kizIaI

πŸ‘¨β€πŸ’» Author

Karan Bista
GitHub β€’ LinkedIn


πŸ“ License

None