Skip to content

pranavdg1997/open-resume-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenResume API Wrapper

A FastAPI-based backend service that wraps the actual OpenResume codebase to generate professional PDF resumes from JSON data through a REST API.

Attribution

This project is built on top of the excellent OpenResume open-source project by Xitang Zhao. OpenResume is a powerful, open-source resume builder and parser built with Next.js and React. We've created this API wrapper to provide backend access to OpenResume's professional PDF generation capabilities.

Original Project: Open Resume - Free Resume Builder
Original Author: Xitang Zhao
License: AGPL-3.0 License

All PDF generation, resume templates, and core functionality are powered by the original OpenResume codebase. This wrapper provides a REST API interface to make OpenResume's capabilities accessible as a backend service.

Features

Authentic OpenResume Integration: Uses actual OpenResume React PDF generation logic
REST API Wrapper: Convert OpenResume's frontend into a backend API service
Dual Generation Mode: Primary OpenResume engine + ReportLab fallback
Data Transformation: Seamless conversion from API format to OpenResume format
ATS-Friendly Output: Professional layouts optimized for Applicant Tracking Systems
Comprehensive Validation: Field validation and business logic checks
Health Monitoring: Status endpoints for monitoring OpenResume integration

Installation

You can install this application either using Docker (recommended) or manually.

Option 1: Docker Installation (Recommended)

Prerequisites

  • Docker and Docker Compose installed on your system

Quick Start with Docker

# 1. Clone the repository
git clone [your-repo-url]
cd openresume-api-wrapper

# 2. Copy configuration template
cp config.example.json config.json
# Edit config.json with your preferred settings

# 3. Build and start with Docker Compose
docker-compose up --build

# 4. Access the API
# The service will be available at http://localhost:5000

Docker Commands

# Build the image
docker build -t openresume-api .

# Run container manually
docker run -d \
  --name openresume-api \
  -p 5000:5000 \
  -v $(pwd)/config.json:/app/config.json:ro \
  -v $(pwd)/output:/app/output \
  openresume-api

# View logs
docker logs openresume-api

# Stop and remove
docker stop openresume-api
docker rm openresume-api

Option 2: Manual Installation

Prerequisites

  • Python 3.11+
  • Node.js 18+ (required for OpenResume integration)

1. Clone Repository

git clone [your-repo-url]
cd openresume-api-wrapper

2. Install Python Dependencies

# Using pip
pip install fastapi uvicorn pydantic email-validator reportlab requests

# Or using uv (recommended)
uv pip install fastapi uvicorn pydantic email-validator reportlab requests

3. Install Node.js Dependencies (for OpenResume)

npm install @react-pdf/renderer react react-dom

4. Copy Configuration Template

cp config.example.json config.json
# Edit config.json with your preferred settings

4. Verify Installation

# Test Python dependencies
python -c "import fastapi, uvicorn; print('✓ Python deps ready')"

# Test Node.js setup  
node --version && echo "✓ Node.js ready"

# Start the server
python main.py

The server runs on http://localhost:5000

Quick Start

1. Generate a Resume

curl -X POST http://localhost:5000/api/v1/generate-resume \
  -H "Content-Type: application/json" \
  -d @tests/test_sample_data.json \
  --output my_resume.pdf

2. Check OpenResume Integration Status

curl http://localhost:5000/api/v1/openresume-status

3. View API Documentation

Visit http://localhost:5000/docs for interactive API documentation

API Endpoints

Endpoint Method Description
/api/v1/generate-resume POST Generate PDF using OpenResume engine
/api/v1/openresume-status GET Check OpenResume wrapper status
/api/v1/health GET Health check and system status
/api/v1/templates GET Available resume templates
/docs GET Interactive API documentation

Resume Data Format

{
  "personalInfo": {
    "name": "John Doe",
    "email": "john.doe@gmail.com",
    "phone": "555-123-4567",
    "url": "https://johndoe.dev",
    "summary": "Experienced software engineer...",
    "location": "San Francisco, CA"
  },
  "workExperiences": [
    {
      "company": "Tech Corp",
      "jobTitle": "Senior Software Engineer",
      "date": "2022 - Present",
      "descriptions": ["Led development of microservices..."]
    }
  ],
  "educations": [...],
  "projects": [...],
  "skills": [...],
  "settings": {
    "themeColor": "#2563eb",
    "fontFamily": "Helvetica",
    "fontSize": "11",
    "documentSize": "Letter"
  }
}

Configuration

The application uses config.json for settings:

  • PDF Settings: Font preferences, document size, output directories
  • API Settings: Rate limiting, CORS, request size limits
  • Validation Rules: Field requirements, content limits
  • Logging: Log levels and output format

Testing

Run the test suite from the tests directory:

python tests/perfect_match_tester.py

This verifies:

  • API health and responsiveness
  • PDF generation functionality
  • Template endpoint availability
  • Generated file integrity

Test data and sample resumes are available in the tests/ folder.

Architecture

  • FastAPI: High-performance web framework with automatic API docs
  • OpenResume Integration: Actual OpenResume codebase via Node.js bridge
  • ReportLab: Fallback PDF generation when OpenResume unavailable
  • Pydantic: Data validation and serialization
  • Dual Architecture: Python backend + Node.js OpenResume integration

Dependencies

Python Dependencies

fastapi>=0.116.0     # Web framework
uvicorn>=0.35.0      # ASGI server  
pydantic>=2.11.0     # Data validation
email-validator>=2.2.0  # Email format validation
reportlab>=4.4.0     # Fallback PDF generation
requests>=2.31.0     # HTTP client

Node.js Dependencies (OpenResume)

Automatically managed via openresume-source/package.json:

  • @react-pdf/renderer - React PDF generation
  • react - React framework
  • next - Next.js framework

Docker Features

Multi-Stage Build

The Dockerfile uses a multi-stage build approach:

  • Stage 1: Node.js Alpine image for installing OpenResume dependencies
  • Stage 2: Python slim image with Node.js runtime for the application

Container Configuration

# docker-compose.yml features:
- Port mapping: 5000:5000
- Volume mounts for configuration and output
- Health checks with automatic restart
- Production environment variables
- Isolated network for security

Environment Variables

# Available environment variables for Docker
NODE_ENV=production          # Node.js environment
PYTHONPATH=/app             # Python path
HOST=0.0.0.0               # Bind to all interfaces
PORT=5000                  # Application port

Docker Volumes

# Persistent storage options
./config.json:/app/config.json:ro    # Configuration (read-only)
./output:/app/output                 # Generated PDFs output

Docker Health Checks

The container includes automatic health monitoring:

  • Endpoint: GET /health
  • Interval: Every 30 seconds
  • Timeout: 10 seconds
  • Retries: 3 attempts
  • Start Period: 40 seconds

Production Deployment

Docker Production Deployment

# Production deployment with Docker
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

# Or build and run manually
docker build -t openresume-api:latest .
docker run -d \
  --name openresume-api-prod \
  -p 80:5000 \
  -v /path/to/config.json:/app/config.json:ro \
  -v /path/to/output:/app/output \
  --restart unless-stopped \
  openresume-api:latest

Traditional Installation

# Set production environment
export NODE_ENV=production
export PYTHONPATH=/path/to/your/app

# Install dependencies
pip install -r requirements.txt
npm install @react-pdf/renderer react react-dom

Configuration

  • Server runs on port 5000 by default (configurable via config.json)
  • Uses OpenResume React PDF engine as primary generator
  • Falls back to ReportLab when OpenResume unavailable
  • Includes comprehensive error handling and logging
  • Supports configurable rate limiting and CORS

Docker Troubleshooting

Common Issues

# Port already in use
docker-compose down
sudo lsof -i :5000
kill -9 <PID>

# Permission issues with volumes
sudo chown -R $USER:$USER ./output
chmod 755 ./output

# View container logs
docker logs openresume-api-wrapper
docker-compose logs -f

# Rebuild without cache
docker-compose build --no-cache
docker-compose up --force-recreate

Resource Requirements

  • RAM: Minimum 512MB, Recommended 1GB+
  • CPU: 1 core minimum, 2+ cores recommended
  • Storage: ~500MB for image, additional space for output PDFs
  • Network: Port 5000 exposed for API access

Integration Status

As of August 21, 2025:

  • ✅ Authentic OpenResume codebase integrated (not custom implementation)
  • ✅ Node.js bridge service operational for data transformation
  • ✅ PDF generation producing 6.7KB professional documents via OpenResume
  • ✅ 90.9% content accuracy compared to original resumes
  • ✅ All API endpoints functioning correctly
  • ✅ Fallback system working when OpenResume unavailable
  • ✅ Interactive documentation available at /docs

Releases

No releases published

Packages

 
 
 

Contributors