A modern analytics pipeline for tracking and analyzing GitHub contributions. The system processes contributor data, generates AI-powered summaries, and maintains a leaderboard of developer activity.
- Tracks pull requests, issues, reviews, and comments
- Calculates contributor scores based on activity and impact
- Generates AI-powered summaries of contributions
- Exports daily summaries to JSON files
- Maintains contributor expertise levels and focus areas
Bun is recommended for this project.
- Install dependencies:
bun install
- Set up environment variables in
.envrc
or.env
:
# Required for Github Ingest
GITHUB_TOKEN=your_github_personal_access_token_here
# Required for AI summaries
OPENROUTER_API_KEY=your_api_key_here
# Optional site info
SITE_URL=https://elizaos.github.io
SITE_NAME="ElizaOS Leaderboard"
- Configure repositories in
config/pipeline.config.ts
:
repositories: [
{
owner: "elizaos",
name: "eliza"
}
],
- Initialize Database
The SQLite database stores the GitHub data in a relational format for efficient querying and analysis. The database schema is in src/lib/data/schema.ts
. Here's how to set it up:
bun run db:migrate
This will:
- Create a SQLite database in the
data/
directory - Set up the required tables and schema with relations
You can see the main pipelines and their usages with these commands below:
bun run pipeline ingest -h
bun run pipeline process -h
bun run pipeline export -h
bun run pipeline summarize -h
# Ingest latest Github data (default since last fetched, or 7 days)
bun run pipeline ingest
# Ingest from beginning
bun run pipeline ingest --after 2024-10-15
# Ingest with specific date range
bun run pipeline ingest --after 2025-01-01 --before 2025-02-20
# Ingest data for a specific number of days
bun run pipeline ingest --days 30 --before 2024-03-31
# Ingest with verbose logging
bun run pipeline ingest -v
# Ingest with custom config file
bun run pipeline ingest --config custom-config.ts
# Process and analyze all repositories
bun run pipeline process
# Process specific repository
bun run pipeline process --repository owner/repo
# Process with verbose logging
bun run pipeline process -v
# Process with custom config
bun run pipeline process --config custom-config.ts
# Export repository stats (defaults to 30 days)
bun run pipeline export
# Export with custom lookback period
bun run pipeline export -d 60
# Export for specific repository
bun run pipeline export -r owner/repo
# Export to custom directory
bun run pipeline export --output-dir ./custom-dir/
# Export with verbose logging
bun run pipeline export -v
# Regenerate and overwrite existing files
bun run pipeline export --overwrite
# Generate project summaries
bun run pipeline summarize -t project
# Generate contributor summaries
bun run pipeline summarize -t contributors
# Generate summaries for specific time period (default 7 days)
bun run pipeline summarize -t project -d 90
# Generate summaries for specific repository
bun run pipeline summarize -t project --repository owner/repo
# Force overwrite existing summaries
bun run pipeline summarize -t project --overwrite
# Generate summaries with custom output directory
bun run pipeline summarize -t project --output-dir ./custom-summaries/
# Generate summaries with verbose logging
bun run pipeline summarize -t project -v
# Generate database migration files
bun run db:generate
# Apply database migrations
bun run db:migrate
# Launch interactive database explorer
bun run db:studio
# Build and generate contributor profile pages
bun run build
# View the site
bunx serve@latest out
The project uses a TypeScript-based pipeline for data processing. See Pipeline Documentation for detailed information about:
- Basic usage and commands
- Pipeline architecture and components
- Configuration options
- Creating custom pipelines
- Available customization points
If you need to modify the database schema (in src/lib/data/schema.ts
), follow these steps:
- Make your changes to the schema file
- Generate migration files:
bun run db:generate
- Apply the migrations:
bun run db:migrate
This process will:
- Create new migration files in the
drizzle
directory - Apply the changes to your SQLite database
- Ensure data consistency with the updated schema
To interactively explore the database and its contents:
bun run db:studio
This launches Drizzle Studio, which provides a visual interface to browse tables, relationships, run queries, and export data.
Additional setup required if you use Safari or Brave: https://orm.drizzle.team/docs/drizzle-kit-studio#safari-and-brave-support
.
├── data/ # Generated data and reports
│ └── db.sqlite # SQLite database
├── scripts/ # Core processing scripts
│ └── analyze-pipeline.ts # Run typescript pipeline
├── config/ # Configuration files
│ └── pipeline.config.ts # TypeScript pipeline configuration
├── drizzle/ # Database migration files
├── src/
│ ├── app/ # Next.js app router pages
│ ├── components/ # React components
│ │ └── ui/ # shadcn/ui components
│ └── lib/
│ ├── pipelines/ # Modular pipeline system
│ │ ├── contributors/ # Contributor-specific pipeline components
│ │ ├── export/ # Pipelines to export JSON data
│ │ ├── ingest/ # Data ingestion pipeline components
│ │ ├── summarize/ # Pipelines to generate AI summaries
│ ├── data/ # Data sources and storage
│ │ ├── db.ts # Database connection and configuration
│ │ ├── github.ts # GitHub API integration
│ │ ├── ingestion.ts # Data ingestion from GitHub API
│ │ ├── schema.ts # Database schema definitions
│ │ └── types.ts # Core data type definitions
│ ├── logger.ts # Logging system
│ └── typeHelpers.ts # TypeScript helper utilities
├── profiles/ # Generated static profiles
└── .github/workflows # Automation workflows
-
Node.js 18+
-
GitHub Personal Access Token
-
OpenAI API Key (optional, for AI summaries)
-
Bun 1.0+ (recommended for TypeScript pipeline)
-
OpenAI API Key (optional, for AI summaries)
-
Bun 1.0+ (recommended for TypeScript pipeline)