Deployment Guide
August 20, 2025 ยท View on GitHub
๐ One-Click Deploy
Deploy your dedicated PR statistics service instantly and start using it within 5 minutes!
๐ ๏ธ Environment Variables
Configure the following environment variables before deployment:
# GitHub API Token (required)
GITHUB_TOKEN=ghp_your_github_token_here
# Redis cache URL (optional but highly recommended)
REDIS_URL=redis://default:password@host:6379
Note:
GITHUB_TOKENis required for accessing GitHub APIREDIS_URLis optional but highly recommended for better performance and reduced API calls
๐ GitHub Token Creation
-
Visit GitHub Token Settings
-
Fill in Token information:
- Note: Enter
GitHub PR Stats - Expiration: Select
No expiration
- Note: Enter
-
Select permissions (minimal required):
- โ
public_repo: Access public repositories (required) - โ
read:user: Read user profile (for GraphQL)

- โ
-
Click
Generate tokenbutton at the bottom of the page -
Important: Copy the generated Token immediately (only shown once)
๐๏ธ Vercel Redis Creation
-
Login to Vercel Console
-
Visit Vercel Storage page
-
Click
Create Databaseโ SelectRedis (Serverless Redis)โ Continue
-
Fill in database information:
- Name: Custom input
- Region: Choose your preferred region
-
After creation, enter the database details page and add the copied URL to environment variables:
REDIS_URL=redis://default:your_password@your_host:6379
โ๏ธ Complete Configuration Example
# GitHub API Token (required)
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Redis cache URL (optional but highly recommended for performance)
REDIS_URL=redis://default:AbCdEf123456@redis-12345.upstash.io:6379
๐๏ธ System Architecture
Tech Stack
- Frontend: React + TypeScript + Vite
- Backend: Vercel Serverless Functions
- Database: Redis (caching)
- API: GitHub GraphQL API
Data Flow
- Parameter Parsing โ Validate query parameters
- Cache Check โ Redis cache optimization
- Data Fetching โ GitHub GraphQL API
- Data Processing โ Filter, sort, aggregate
- Result Limiting โ Select top limit records
- SVG Generation โ Theme rendering
- Response Output โ Standard SVG format
Security Features
- Server-side Token isolation
- Read-only API access
- Smart caching strategy
- Modular design