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