Skip to content

CosmicMagnetar/openTriage

Repository files navigation

OpenTriage Logo

OpenTriage

AI-Powered Intelligence for Open Source Communities

Features β€’ Tech Stack β€’ Architecture β€’ Getting Started β€’ Contributing

License PRs Welcome Python 3.10+ Node 18+ GitHub Stars


What is OpenTriage?

OpenTriage is a next-generation platform that transforms how open source communities collaborate. By leveraging advanced AI and real-time analytics, it bridges the gap between maintainers and contributors, making open source development more efficient, rewarding, and inclusive.

Apache Spark AI Powered GitHub Integration


Key Features

AI-Powered Assistance

Smart Triage

Automatically classifies issues/PRs (Bug, Feature, Documentation), generates summaries, and analyzes sentiment to prioritize critical items.

Maintainer Copilot

AI assistant that drafts replies, suggests labels, analyzes PRs for quality and security, and provides context-aware code insights.

Contributor Mentor

Guides new contributors through contribution workflows, helps identify suitable issues based on skills, and provides constructive feedback.

RAG-Powered Chat

Repository-aware chatbot that understands your project's documentation, README, and codebase to provide accurate answers.

Advanced Analytics

Invisible Labor Dashboard

Quantifies often-overlooked contributions: code reviews, mentorship, triage work, and community support.

Sentiment Analysis

Real-time monitoring of community health through issue/PR comment sentiment analysis.

Contribution Streaks

GitHub-style impact calendar with streak tracking and activity heatmaps.

Gamification Engine

XP system, badges, trophies, and leaderboards to recognize and reward contributors.

Smart Issue Management

Cookie-Licking Detection

Automatically monitors claimed issues and releases them if no progress is detectedβ€”ensuring issues don't get stuck.

Mentor Matching

AI-powered matching system that connects new contributors with experienced mentors based on skills and interests.

Hype Generator

Creates engaging social media posts and release notes to boost project visibility.

Resource Vault

Curated learning resources tailored to your tech stack and contribution areas.

Gamification & Recognition

Feature Description
Dynamic Badges LeetCode-style achievement system with tiered badges (Bronze, Silver, Gold, Diamond)
Trophy Cabinet Showcase your open source achievements with collectible trophies
Contribution Calendar Visual representation of your impact over time
Leaderboards Community rankings based on various contribution metrics

Tech Stack

React Vite Tailwind CSS Radix UI

FastAPI Python MongoDB JWT

Apache Spark OpenAI Gemini Llama

Technology Overview

Layer Technologies
Frontend React 18, Vite, Tailwind CSS, Radix UI, Zustand, Recharts, React Router
Backend FastAPI, Python 3.10+, Motor (async MongoDB), Pydantic, JWT Auth
AI/ML OpenAI GPT-4, Llama 3.3, Gemini 2.0, Custom RAG Pipeline
Analytics Apache Spark, PySpark SQL, Spark Streaming
Infrastructure MongoDB Atlas, Vercel (Frontend), Render (Backend)

Architecture

OpenTriage Architecture

View Text Diagram
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              OPENTRIAGE PLATFORM                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                         FRONTEND (React + Vite)                      β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚   β”‚
β”‚  β”‚  β”‚   Maintainer    β”‚  β”‚   Contributor   β”‚  β”‚    Authentication   β”‚   β”‚   β”‚
β”‚  β”‚  β”‚     Portal      β”‚  β”‚    Dashboard    β”‚  β”‚      (OAuth)        β”‚   β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                    β”‚                                        β”‚
β”‚                                    β–Ό                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                        BACKEND (FastAPI)                             β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚   β”‚
β”‚  β”‚  β”‚   AI Chat    β”‚  β”‚  GitHub Sync   β”‚  β”‚    Profile & Auth       β”‚   β”‚   β”‚
β”‚  β”‚  β”‚   Service    β”‚  β”‚    Service     β”‚  β”‚       Service           β”‚   β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚   β”‚
β”‚  β”‚  β”‚ Gamification β”‚  β”‚ Cookie-Licking β”‚  β”‚   Invisible Labor       β”‚   β”‚   β”‚
β”‚  β”‚  β”‚    Engine    β”‚  β”‚    Monitor     β”‚  β”‚      Analytics          β”‚   β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                          β”‚                    β”‚                             β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”                      β”‚
β”‚              β–Ό                    β–Ό   β–Ό              β–Ό                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚  β”‚     MongoDB        β”‚  β”‚  Apache Spark  β”‚  β”‚   LLM Providers      β”‚       β”‚
β”‚  β”‚   (Data Store)     β”‚  β”‚  (Analytics)   β”‚  β”‚ (OpenAI/Gemini/Llama)β”‚       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

opentriage/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/           # Application settings, database configuration
β”‚   β”œβ”€β”€ models/           # Pydantic models and data schemas
β”‚   β”œβ”€β”€ routes/           # FastAPI router definitions
β”‚   β”‚   β”œβ”€β”€ auth.py       # GitHub OAuth authentication
β”‚   β”‚   β”œβ”€β”€ contributor.py # Contributor dashboard APIs
β”‚   β”‚   β”œβ”€β”€ maintainer.py # Maintainer portal APIs
β”‚   β”‚   β”œβ”€β”€ mentor.py     # Mentorship endpoints
β”‚   β”‚   β”œβ”€β”€ profile.py    # User profile management
β”‚   β”‚   β”œβ”€β”€ spark.py      # Analytics endpoints
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ services/         # Core business logic
β”‚   β”‚   β”œβ”€β”€ ai_service.py              # LLM integration
β”‚   β”‚   β”œβ”€β”€ badges_service.py          # Badge system
β”‚   β”‚   β”œβ”€β”€ cookie_licking_service.py  # Claim monitoring
β”‚   β”‚   β”œβ”€β”€ gamification_engine.py     # XP & streaks
β”‚   β”‚   β”œβ”€β”€ github_service.py          # GitHub API wrapper
β”‚   β”‚   β”œβ”€β”€ invisible_labor_analytics.py # Hidden contribution metrics
β”‚   β”‚   β”œβ”€β”€ mentor_matching_service.py # Mentor-mentee matching
β”‚   β”‚   β”œβ”€β”€ rag_chatbot_service.py     # RAG-powered chat
β”‚   β”‚   β”œβ”€β”€ spark_sentiment_pipeline.py # Sentiment analysis
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ spark_manager.py  # Apache Spark session management
β”‚   └── server.py         # Application entry point
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ contributor/  # Contributor dashboard components
β”‚   β”‚   β”‚   β”œβ”€β”€ maintainer/   # Maintainer portal components
β”‚   β”‚   β”‚   └── ui/           # Shared UI components
β”‚   β”‚   β”œβ”€β”€ services/         # API client and service functions
β”‚   β”‚   β”œβ”€β”€ stores/           # Zustand state management
β”‚   β”‚   └── hooks/            # Custom React hooks
β”‚   └── index.html
β”‚
└── tests/                # Test suites

Getting Started

Prerequisites

Node.js Python MongoDB Git

Installation

Step 1: Clone the Repository

git clone https://github.com/CosmicMagnetar/openTriage.git
cd opentriage

Step 2: Backend Setup

cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

Create a .env file in the backend directory:

# Database
MONGO_URL=mongodb://localhost:27017
DB_NAME=opentriage

# GitHub OAuth
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret

# Security
JWT_SECRET=your_jwt_secret

# AI Services
OPENROUTER_API_KEY=your_openrouter_api_key

Start the server:

uvicorn server:app --reload --port 8000

Step 3: Frontend Setup

cd frontend
npm install

Create a .env file in the frontend directory:

VITE_BACKEND_URL=http://localhost:8000

Start the development server:

npm run dev

The app will be available at http://localhost:5173


Spark Configuration

Apache Spark

OpenTriage uses Apache Spark for high-performance analytics. Add these optional environment variables to your backend .env:

SPARK_APP_NAME=OpenTriage
SPARK_MASTER=local[*]
SPARK_DRIVER_MEMORY=4g
SPARK_EXECUTOR_MEMORY=2g
SPARK_LOG_LEVEL=WARN

Performance Tuning

Setting Low Memory (8GB) Standard (16GB) High Performance (32GB+)
SPARK_DRIVER_MEMORY 2g 4g 8g
SPARK_EXECUTOR_MEMORY 1g 2g 4g

Auto-configured optimizations:

  • Adaptive query execution for dynamic optimization
  • Kryo serialization for faster data transfer
  • Off-heap memory for improved GC performance
  • Arrow optimization for Pandas integration

Contributing

Contributions Welcome

Quick Start

  1. Find an Issue β€” Look for good first issue or help wanted labels
  2. Fork & Branch β€” Create a feature branch from main
  3. Code β€” Follow existing patterns and conventions
  4. Test β€” Ensure your changes don't break existing functionality
  5. Submit PR β€” Write a clear description of your changes

Where to Add Files

Type Location
New API endpoints backend/routes/ (register in routes/__init__.py)
Business logic backend/services/
Data models backend/models/
React components frontend/src/components/
API client functions frontend/src/services/api.js
State management frontend/src/stores/

Development Guidelines

  • Use meaningful commit messages
  • Keep PRs focused and reasonably sized
  • Add comments for complex logic
  • Update documentation as needed

Links

Report Bug Discussions


License

MIT License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built for the Open Source Community

Star on GitHub