A Next.js dashboard for monitoring community PRs and review accountability in the OpenHands project.
- Community PR Monitoring: Track open PRs from external contributors
- SLA Tracking: Monitor response times and review times against defined SLAs
- Reviewer Accountability: Track reviewer assignments and pending review loads
- Real-time Data: Cached GitHub API data with configurable refresh intervals
- Filtering: Filter PRs by repository, labels, and age ranges
Copy the example environment file and configure it:
cp .env.local.example .env.localEdit .env.local and set your GitHub token:
GITHUB_TOKEN=your_github_personal_access_token_hereCreate a GitHub Personal Access Token with these permissions:
read:org(to fetch organization members)public_repo(to read public repository data)
Get your token from: https://github.com/settings/tokens
npm installnpm run devOpen http://localhost:3000 to view the dashboard.
Visit http://localhost:3000/api/test to verify your GitHub token is working.
| Variable | Description | Default |
|---|---|---|
GITHUB_TOKEN |
GitHub Personal Access Token | Required |
ORGS |
Comma-separated list of GitHub organizations | All-Hands-AI |
REPOS_INCLUDE |
Specific repositories to include (owner/repo format) | Auto-discover |
REPOS_EXCLUDE |
Repositories to exclude from auto-discovery | None |
SLA_HOURS_FIRST_RESPONSE |
SLA for first human response (hours) | 24 |
SLA_HOURS_FIRST_REVIEW |
SLA for first review (hours) | 48 |
CACHE_TTL_SECONDS |
Cache duration for API responses | 120 |
MAX_PR_PAGES_PER_REPO |
Max GitHub API pages per repository | 10 |
Edit config/employees.json to override employee detection:
{
"allowlist": ["username1", "username2"],
"denylist": ["bot-account"]
}GET /api/dashboard- Main dashboard data with KPIs and PR listGET /api/review-stats- Review statistics and reviewer loadsGET /api/test- Test GitHub API connectionGET /api/config/employees- Employee statistics (debug only)
Dashboard API (/api/dashboard):
repos- Filter by repositories (comma-separated)labels- Filter by labels (comma-separated)age- Filter by age range (0-24,24-48,48-96,96+)debug- Include debug information
- Next.js 14 with App Router
- TypeScript for type safety
- Tailwind CSS for styling
- GitHub GraphQL API for data fetching
lib/github.ts- GitHub API client with GraphQL and REST supportlib/employees.ts- Employee detection and managementlib/compute.ts- PR data transformation and KPI calculationslib/cache.ts- In-memory caching systemcomponents/- Reusable React components
- API routes fetch data from GitHub using GraphQL
- Employee set is built from organization memberships
- PR data is transformed and enriched with computed fields
- KPIs are calculated from the processed data
- Results are cached to reduce API usage
- Frontend displays data with real-time updates
├── app/
│ ├── api/ # API routes
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main dashboard page
├── components/ # React components
├── lib/ # Utility libraries
├── config/ # Configuration files
└── public/ # Static assets
- New API Endpoint: Add route in
app/api/ - New Component: Add to
components/directory - New Utility: Add to
lib/directory - Configuration: Update
lib/config.tsand.env.local.example
Test individual API endpoints:
curl http://localhost:3000/api/test
curl http://localhost:3000/api/dashboard
curl http://localhost:3000/api/review-stats- Connect your GitHub repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main branch
# Build image
docker build -t openhands-dashboard .
# Run container
docker run -p 3000:3000 --env-file .env.local openhands-dashboardnpm run build
npm start-
"GITHUB_TOKEN environment variable is required"
- Ensure
.env.localexists with validGITHUB_TOKEN
- Ensure
-
"GraphQL error: Bad credentials"
- Check that your GitHub token has correct permissions
- Verify token hasn't expired
-
Empty dashboard or no PRs
- Check that organizations/repositories exist and are accessible
- Verify employee detection is working via
/api/config/employees?debug=true
-
Rate limiting errors
- Reduce
MAX_PR_PAGES_PER_REPOin environment - Increase
CACHE_TTL_SECONDSto reduce API calls
- Reduce
Add ?debug=true to API endpoints for additional debugging information:
/api/dashboard?debug=true/api/config/employees?debug=true
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details.