Skip to content

🔗 ResuMate API Documentation

Base URL:

https://arafat2.me/api/

🎯 Overview

About ResuMate API

A comprehensive REST API providing user management, resume CRUD operations, AI-powered resume generation with multiple models (Google Gemini, OpenRouter), job application tracking, and PostgreSQL persistence with both authenticated and anonymous access.

Key Features

JWT Authentication Full Resume Management Multiple AI Models Job Tracking Redis Caching Example Data

Quick Start - Try Now!

No auth required: AI Models Example Applications API Root


⚡ Redis Caching System

High-Performance Caching

ResuMate API implements Redis caching for frequently accessed endpoints to deliver lightning-fast responses and reduce database load.

Cache Implementation Details

Cached Endpoints:

  • /api/ai/models/ - AI model configurations
  • /api/example-job-applications/ - Demo job application data

Cache Configuration:

  • Redis Version: 7+ Alpine
  • Memory Limit: 256MB
  • Eviction Policy: allkeys-lru (Least Recently Used)
  • Default TTL: 1 hour (3600 seconds)
  • Cache Hit Ratio: ~85-90% in production

Cache Response Format

All cached endpoints return responses with cache status information:

{
  "cache_status": "HIT (Response from Redis cache)",
  "data": { /* actual response data */ }
}

Response Headers: - X-Cache-Status: HIT - Data served from Redis cache - X-Cache-Status: MISS - Data fetched from database

Performance Benefits

  • Cache HIT: ~10-20ms average response time
  • Cache MISS: ~80-150ms average response time
  • Performance Gain: 85% faster for cached requests
  • Reduced DB Load: 90% fewer database queries for cached endpoints
  • Improved Scalability: Better handling of concurrent requests
  • Cost Efficiency: Lower server resource utilization

🔐 Authentication

Authentication Required

Most endpoints require JWT authentication. Anonymous access is limited to specific AI models and example data endpoints.

JWT Token Authentication

The API uses JSON Web Tokens (JWT) for secure authentication. Include your token in the Authorization header:

Authorization: Bearer <your-jwt-token>

🔑 Authentication Endpoints

Authentication Flow

POST /api/auth/register/

Description: Create a new user account
Authentication: Not Required

Request Body:

{
  "username": "string",
  "email": "string",
  "password": "string",
  "password2": "string"
}

Response (201 Created)

{
  "id": 1,
  "username": "john_doe",
  "email": "john@example.com"
}

POST /api/auth/token/

Description: Obtain access and refresh tokens
Authentication: Not Required

Request Body:

{
  "username": "string",
  "password": "string"
}

Response (200 OK)

{
  "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
  "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}

POST /api/auth/token/refresh/

Description: Refresh your access token
Authentication: Refresh Token Required

Request Body:

{
  "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}

Response (200 OK)

{
  "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}

🚀 API Endpoints

📄 Resume Management

Resume Operations

Complete CRUD operations for managing resume documents with user-specific access control.

Resume Endpoints

GET /api/resumes/

Authentication: Required
Description: Retrieve all resumes for authenticated user

Sample Request

curl -H "Authorization: Bearer <token>" \
     https://arafat2.me/api/resumes/

Response (200 OK)

[
  {
    "id": 1,
    "user": "john_doe",
    "title": "Software Engineer Resume",
    "content": "# John Doe\n\n## Experience\n...",
    "created_at": "2023-01-15T10:30:00Z",
    "updated_at": "2023-01-16T14:20:00Z"
  }
]

POST /api/resumes/

Authentication: Required
Description: Create a new resume document

Request Body

{
  "title": "Software Engineer Resume",
  "content": "# John Doe\n\n## Experience\n..."
}

Response (201 Created)

{
  "id": 2,
  "user": "john_doe",
  "title": "Software Engineer Resume",
  "content": "# John Doe\n\n## Experience\n...",
  "created_at": "2023-01-15T10:30:00Z",
  "updated_at": "2023-01-15T10:30:00Z"
}

GET /api/resumes/{id}/

Authentication: Required
Description: Retrieve a specific resume by ID

PUT/PATCH /api/resumes/{id}/

Authentication: Required
Description: Update an existing resume

DELETE /api/resumes/{id}/

Authentication: Required
Description: Delete a resume permanently

🤖 AI-Powered Resume Generation

AI Features

Generate professional resumes using advanced AI models with varying capabilities and access levels.

AI Endpoints

GET /api/ai/models/

Authentication: Not Required
Description: Get available AI models and their configurations
Caching: Redis cached for 1 hour

Sample Request

curl https://arafat2.me/api/ai/models/

Response (200 OK) - Cache HIT

{
  "cache_status": "HIT (Response from Redis cache)",
  "data": [
    {
      "display_name": "Deepseek",
      "description": "Advanced AI model for professional resume generation",
      "response_time_info": "Fast",
      "login_required": false
    },
    {
      "display_name": "GPT-4",
      "description": "Premium AI model with superior writing quality",
      "response_time_info": "5-10 seconds",
      "login_required": true
    }
  ]
}

Cache Behavior

  • Cache Key: ai_models_list
  • Cache Duration: 1 hour (3600 seconds)
  • Cache Status: Response includes cache_status field
  • Headers: X-Cache-Status: HIT or X-Cache-Status: MISS
  • Performance: ~85% faster response times for cached requests

POST /api/ai/generate/

Authentication: Model Dependent
Description: Generate AI-powered resume content

Request Body

{
  "model": "Deepseek",
  "user_input": "Software engineer with 5 years experience in Python, Django, React. Worked at tech startups building scalable web applications. Expert in cloud deployment and database optimization.",
  "title": "Senior Software Engineer Resume"
}

Response (201 Created)

{
  "resume_id": 15,
  "content": "# John Doe\n\n## Professional Summary\nExperienced Software Engineer with 5+ years of expertise in Python, Django, and React...\n\n## Technical Skills\n- **Backend:** Python, Django, RESTful APIs\n- **Frontend:** React, JavaScript, HTML5, CSS3\n..."
}

📊 Job Application Tracking

Job Management

Comprehensive job application tracking with status management and soft delete functionality.

Job Application Endpoints

GET /api/job-applications/

Authentication: Required
Description: Retrieve all job applications for authenticated user

Sample Request

curl -H "Authorization: Bearer <token>" \
     https://arafat2.me/api/job-applications/

Response (200 OK)

[
  {
    "id": 1,
    "user": 1,
    "job_title": "Senior Software Engineer",
    "company_name": "TechCorp Inc.",
    "original_job_description": "We are looking for a senior software engineer...",
    "resume_used": 1,
    "date_applied": "2023-01-15",
    "status": "Interviewing",
    "notes": "Had initial phone screening, technical interview scheduled for next week",
    "is_deleted": false,
    "is_example": false,
    "created_at": "2023-01-15T10:30:00Z",
    "updated_at": "2023-01-20T16:45:00Z"
  }
]

POST /api/job-applications/

Authentication: Required
Description: Create a new job application record

Request Body

{
  "job_title": "Senior Software Engineer",
  "company_name": "TechCorp Inc.",
  "original_job_description": "We are looking for a senior software engineer...",
  "resume_used": 1,
  "date_applied": "2023-01-15",
  "status": "Applied",
  "notes": "Applied through company website"
}

PUT/PATCH /api/job-applications/{id}/

Authentication: Required
Description: Update job application status and details

DELETE /api/job-applications/{id}/

Authentication: Required
Description: Soft delete (sets is_deleted=true)

GET /api/example-job-applications/

Authentication: Not Required
Description: Get up to 5 sample job applications for demo
Caching: Redis cached for 1 hour

Sample Request

curl https://arafat2.me/api/example-job-applications/

Response (200 OK) - Cache MISS

{
  "cache_status": "MISS (Response from database)",
  "data": [
    {
      "id": 1,
      "job_title": "Senior Software Engineer",
      "company": "TechCorp Inc.",
      "status": "Interview Scheduled",
      "application_date": "2024-12-15",
      "description": "Full-stack development role..."
    }
  ]
}

Cache Behavior

  • Cache Key: example_job_applications_list
  • Cache Duration: 1 hour (3600 seconds)
  • Cache Status: Response includes cache_status field
  • Headers: X-Cache-Status: HIT or X-Cache-Status: MISS
  • Performance: Significantly faster response for demo data

📊 Data Models

Database Schema

Complete data model specifications for all API resources with field descriptions and constraints.

Model Specifications

User Account Structure

Core user model for authentication and authorization.

{
  "id": "integer (primary_key, auto_increment)",
  "username": "string (unique, max_length: 150)",
  "email": "string (valid_email, max_length: 254)",
  "is_active": "boolean (default: true)",
  "date_joined": "datetime (auto_now_add)"
}

Resume Document Structure

User-specific resume documents with content management.

{
  "id": "integer (primary_key, auto_increment)",
  "user": "foreign_key (User, on_delete: cascade)",
  "title": "string (max_length: 255)",
  "content": "text (markdown_supported)",
  "created_at": "datetime (auto_now_add)",
  "updated_at": "datetime (auto_now)"
}

AI Model Settings

Configuration for available AI models and their capabilities.

{
  "display_name": "string (unique, max_length: 100)",
  "model_name": "string (max_length: 100)",
  "api_provider": "choice ('google_gemini', 'open_router')",
  "api_key_name": "string (max_length: 100)",
  "is_active": "boolean (default: true)",
  "login_required": "boolean (default: false)",
  "daily_limit": "positive_integer (null: unlimited)",
  "response_time_info": "string (max_length: 50)",
  "description": "text"
}

Job Application Structure

Comprehensive job application tracking with status management.

{
  "id": "integer (primary_key, auto_increment)",
  "user": "foreign_key (User, on_delete: cascade)",
  "job_title": "string (max_length: 200)",
  "company_name": "string (max_length: 200)",
  "original_job_description": "text",
  "resume_used": "foreign_key (Resume, null: true, blank: true)",
  "date_applied": "date",
  "status": "choice ('Applied', 'Interviewing', 'Offer', 'Rejected')",
  "notes": "text (blank: true)",
  "is_deleted": "boolean (default: false)",
  "is_example": "boolean (default: false)",
  "created_at": "datetime (auto_now_add)",
  "updated_at": "datetime (auto_now)"
}

⚠️ Error Handling

Error Response System

Standardized error responses across all endpoints with comprehensive status codes and detailed messages.

📋 HTTP Status Codes

Status Code Reference

Code Status Description
200 OK Request successful
201 Created Resource created successfully
Code Status Description
400 Bad Request Invalid request data
401 Unauthorized Authentication required
403 Forbidden Insufficient permissions
404 Not Found Resource not found
Code Status Description
503 Service Unavailable AI service error

📝 Error Response Format

Standard Error Structure

All API errors follow this consistent format for easy handling:

{
  "error": "Error message description",
  "field_errors": {
    "field_name": ["Field-specific error message"]
  }
}

🚨 Common Error Examples

Error Response Examples

401 Unauthorized

When JWT token is invalid or expired:

{
  "detail": "Given token not valid for any token type"
}

400 Bad Request

When request data fails validation:

{
  "password": ["Password fields didn't match."],
  "email": ["This field is required."]
}

503 Service Unavailable

When AI model is temporarily unavailable:

{
  "error": "An error occurred while communicating with the AI service."
}

404 Not Found

When requested resource doesn't exist:

{
  "detail": "Not found."
}

🔒 Rate Limiting

API Usage Limits

Fair usage policies and rate limits ensure service stability and equitable access for all users.

Rate Limit Types

Daily Limits

  • Some AI models have daily request limits per user
  • Limits are configurable per model in admin panel
  • Premium models may have stricter limits

Limited Access

  • Limited AI models available without authentication
  • No job application or resume management
  • Example data endpoints only

Enhanced Access

  • Higher rate limits for all endpoints
  • Access to premium AI models
  • Full feature set including CRUD operations

💡 Usage Examples

Integration Examples

Complete code examples demonstrating API integration in multiple programming languages with authentication flow.

Code Samples

Command Line Examples

Complete workflow using cURL for testing and automation:

#!/bin/bash

# Configuration
BASE_URL="https://arafat2.me/api"

# 1. Get available AI models (no auth required)
echo "=== Available AI Models ==="
curl -s "${BASE_URL}/ai/models/" | jq .

# 2. Register new user
echo -e "\n=== User Registration ==="
curl -X POST "${BASE_URL}/auth/register/" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "john_doe",
    "email": "john@example.com",
    "password": "SecurePass123!",
    "password2": "SecurePass123!"
  }' | jq .

# 3. Get authentication token
echo -e "\n=== Authentication ==="
TOKEN_RESPONSE=$(curl -s -X POST "${BASE_URL}/auth/token/" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "john_doe",
    "password": "SecurePass123!"
  }')

ACCESS_TOKEN=$(echo $TOKEN_RESPONSE | jq -r .access)
echo "Access Token: ${ACCESS_TOKEN:0:20}..."

# 4. Generate resume with AI
echo -e "\n=== AI Resume Generation ==="
RESUME_RESPONSE=$(curl -s -X POST "${BASE_URL}/ai/generate/" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "model": "Deepseek",
    "user_input": "Software engineer with 5 years experience in Python, Django, React. Expert in cloud deployment.",
    "title": "Senior Developer Resume"
  }')

RESUME_ID=$(echo $RESUME_RESPONSE | jq -r .resume_id)
echo "Generated Resume ID: $RESUME_ID"

# 5. Create job application
echo -e "\n=== Job Application Creation ==="
curl -s -X POST "${BASE_URL}/job-applications/" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d "{
    \"job_title\": \"Senior Software Engineer\",
    \"company_name\": \"TechCorp Inc.\",
    \"resume_used\": $RESUME_ID,
    \"status\": \"Applied\",
    \"date_applied\": \"$(date +%Y-%m-%d)\"
  }" | jq .

# 6. List all user resumes
echo -e "\n=== User Resumes ==="
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "${BASE_URL}/resumes/" | jq .

Complete Python Example

Full workflow from registration to resume generation and job tracking:

import requests

# API Configuration
BASE_URL = "https://arafat2.me/api/"

class ResuMateClient:
    def __init__(self):
        self.base_url = BASE_URL
        self.token = None
        self.headers = {"Content-Type": "application/json"}

    def register(self, username, email, password):
        """Register a new user account"""
        data = {
            "username": username,
            "email": email,
            "password": password,
            "password2": password
        }
        response = requests.post(f"{self.base_url}auth/register/", json=data)
        return response.json()

    def login(self, username, password):
        """Authenticate and get tokens"""
        data = {"username": username, "password": password}
        response = requests.post(f"{self.base_url}auth/token/", json=data)
        tokens = response.json()
        self.token = tokens["access"]
        self.headers["Authorization"] = f"Bearer {self.token}"
        return tokens

    def generate_resume(self, model, user_input, title):
        """Generate AI-powered resume"""
        data = {
            "model": model,
            "user_input": user_input,
            "title": title
        }
        response = requests.post(
            f"{self.base_url}ai/generate/", 
            json=data, 
            headers=self.headers
        )
        return response.json()

    def create_job_application(self, job_data):
        """Create new job application"""
        response = requests.post(
            f"{self.base_url}job-applications/", 
            json=job_data, 
            headers=self.headers
        )
        return response.json()

# Usage Example
client = ResuMateClient()

# 1. Register and login
client.register("john_doe", "john@example.com", "SecurePass123!")
client.login("john_doe", "SecurePass123!")

# 2. Generate resume
resume = client.generate_resume(
    model="Deepseek",
    user_input="Software engineer with 5 years experience...",
    title="Senior Developer Resume"
)

# 3. Create job application
job_app = client.create_job_application({
    "job_title": "Senior Software Engineer",
    "company_name": "TechCorp Inc.",
    "resume_used": resume["resume_id"],
    "status": "Applied",
    "date_applied": "2023-01-15"
})

Modern JavaScript Class

ES6+ implementation with async/await and error handling:

class ResuMateAPI {
    constructor(baseURL = 'https://arafat2.me/api/') {
        this.baseURL = baseURL;
        this.token = localStorage.getItem('access_token');
    }

    async makeRequest(endpoint, options = {}) {
        const url = `${this.baseURL}${endpoint}`;
        const config = {
            headers: {
                'Content-Type': 'application/json',
                ...options.headers
            },
            ...options
        };

        if (this.token) {
            config.headers.Authorization = `Bearer ${this.token}`;
        }

        try {
            const response = await fetch(url, config);
            if (!response.ok) {
                throw new Error(`HTTP ${response.status}: ${response.statusText}`);
            }
            return await response.json();
        } catch (error) {
            console.error('API Request failed:', error);
            throw error;
        }
    }

    async register(username, email, password) {
        return this.makeRequest('auth/register/', {
            method: 'POST',
            body: JSON.stringify({
                username, email, 
                password, password2: password
            })
        });
    }

    async login(username, password) {
        const tokens = await this.makeRequest('auth/token/', {
            method: 'POST',
            body: JSON.stringify({ username, password })
        });

        this.token = tokens.access;
        localStorage.setItem('access_token', this.token);
        return tokens;
    }

    async generateResume(model, userInput, title) {
        return this.makeRequest('ai/generate/', {
            method: 'POST',
            body: JSON.stringify({
                model, user_input: userInput, title
            })
        });
    }

    async getResumes() {
        return this.makeRequest('resumes/');
    }

    async createJobApplication(jobData) {
        return this.makeRequest('job-applications/', {
            method: 'POST',
            body: JSON.stringify(jobData)
        });
    }
}

// Usage Example
const api = new ResuMateAPI();

async function example() {
    try {
        await api.login('john_doe', 'SecurePass123!');
        const resume = await api.generateResume(
            'Deepseek', 
            'Software engineer...', 
            'My Resume'
        );
        console.log('Resume generated:', resume);
    } catch (error) {
        console.error('Error:', error);
    }
}

🛠️ Development Notes

Technical Architecture

Modern, enterprise-grade technology stack designed for scalability, security, and maintainability.

Technology Stack

Core Framework

Django 5.0.14 - Robust web framework with built-in admin, ORM, and security features

Component Technology Purpose
🐍 Web Framework Django 5.0.14 REST API development & admin interface
🗄️ Database PostgreSQL Primary data storage with ACID compliance
🔗 Database Driver psycopg2-binary High-performance PostgreSQL adapter
🔐 Authentication JWT (Simple JWT) Stateless token-based authentication
🤖 AI Integration Google Gemini API Advanced AI-powered content generation
🔀 AI Router OpenAI SDK Multi-provider AI model support
🚀 WSGI Server Gunicorn Production-ready HTTP server
📁 Static Files WhiteNoise Efficient static asset serving

Required Environment Variables

Secure configuration management using environment variables:

# Database Configuration
DB_NAME=resumate_db              # PostgreSQL database name
DB_USER=postgres                 # Database username
DB_PASSWORD=your_password        # Database password
DB_HOST=localhost                # Database host
DB_PORT=5432                     # Database port

# Django Configuration
SECRET_KEY=your_secret_key       # Django secret key (50+ chars)
DEBUG=False                      # Production: False, Development: True
ALLOWED_HOSTS=arafat2.me,localhost # Comma-separated allowed hosts

# AI Service Configuration
GOOGLE_GEMINI_API_KEY=your_gemini_key    # Google Gemini API key
OPENROUTER_API_KEY=your_openrouter_key   # OpenRouter API key

# Admin User (Auto-created)
DJANGO_SUPERUSER_USERNAME=admin          # Admin username
DJANGO_SUPERUSER_EMAIL=admin@example.com # Admin email
DJANGO_SUPERUSER_PASSWORD=admin_password # Admin password

Development Setup

Complete setup process for local development:

# 1. Database Setup
python manage.py makemigrations     # Create migration files
python manage.py migrate            # Apply database migrations
python manage.py create_superuser_if_not_exists  # Create admin user

# 2. Development Server
python manage.py runserver 0.0.0.0:8000  # Start development server

# 3. Production Deployment
python manage.py collectstatic --noinput  # Collect static files
gunicorn ResuMate_backend.wsgi:application # Start production server

# 4. Database Management
python manage.py dbshell            # Access database shell
python manage.py shell              # Django shell access

# 5. Maintenance Commands
python manage.py check              # System check
python manage.py test               # Run test suite

Production Deployment

Recommended production setup:

# Docker Deployment (Recommended)
docker-compose up -d                # Start all services

# Manual Deployment
pip install -r requirements.txt    # Install dependencies
gunicorn --bind 0.0.0.0:8000 ResuMate_backend.wsgi:application

Key Capabilities

Comprehensive API features and integrations:

  • 🔐 JWT Authentication - Secure stateless authentication
  • 📄 Resume CRUD - Complete resume management system
  • 🤖 Multi-AI Support - Google Gemini & OpenRouter integration
  • 📊 Job Tracking - Application status management
  • 🗄️ PostgreSQL - Robust data persistence
  • 📖 Browsable API - Django REST Framework interface
  • 🛡️ Admin Panel - Django admin for data management
  • 🚀 Production Ready - Gunicorn + WhiteNoise deployment

📞 Support & Contact

Get Help & Connect

Multiple channels available for support, feedback, collaboration, and API assistance.

Contact & Resources

Arafat Hossain

Full-Stack Developer & API Architect

Experienced in building scalable web applications, REST APIs, and AI-powered solutions.

Contact Method Details Purpose
📧 Email arafat6462@gmail.com Direct communication & support
🐙 GitHub github.com/Arafat6462 Source code & project portfolio
🌐 Portfolio arafat2.me Professional portfolio & projects

Live Endpoints

Test and explore the API directly:

Resource Description Access Level
🧠 AI Models /api/ai/models/ Public + Cached
👁️ Examples /api/example-job-applications/ Public + Cached
🔌 API Root /api/ Browsable
🛡️ Admin /admin/ Admin Only
📚 Swagger /api/docs/ Interactive

⚡ Redis Cached Endpoints

Endpoints marked with ⚡ use Redis caching for enhanced performance:

  • Response Time: 10-20ms for cache hits
  • Cache Duration: 1 hour for optimal freshness
  • Status Indication: Response includes cache status information

Need Help?

Choose the best support channel for your needs:

  • � Bug Reports - GitHub Issues or direct email
  • 💡 Feature Requests - Email with detailed requirements
  • 📖 API Questions - Check documentation or contact directly
  • 🤝 Collaboration - Professional inquiries welcome
  • 📱 Integration Help - Code examples and guidance available

🚀 Quick Start Guide

Ready to Build?

Get up and running with ResuMate API in minutes with our step-by-step guide.

Getting Started

No Authentication Required

Try these endpoints right now in your browser:

  1. 🧠 Available AI Models - Test AI capabilities
  2. 📋 Example Applications - Sample data
  3. 🔌 API Root Explorer - Browse all endpoints

Create Your Account

Steps to get authenticated access:

  1. Register - Create account via /api/auth/register/
  2. Login - Get tokens via /api/auth/token/
  3. Generate - Create AI-powered resume
  4. Track - Manage job applications

Development Integration

Choose your preferred method:

  • Python - Use requests library (see example)
  • JavaScript - Fetch API or axios (see example)
  • cURL - Command line testing (see example)
  • Other - Standard HTTP REST API calls

API Status & Information

Status: Live & Stable
Last Updated: July 2025
Version: 1.0
Security: JWT Authentication
Database: PostgreSQL
AI: Multi-model Support