<<<<<<< HEAD
A Python Flask web application for monitoring GitHub Pull Requests with interactive dashboard cards and filtering capabilities.
- Dashboard Cards: Display PR statistics with visual cards showing:
- Available (open) PRs count
- PRs filtered by label criteria
- Closed PRs count
- Interactive Cards: Click any card to view detailed PR lists
- Month-based Filtering: Filter all data by specific months
- Label Filtering: Filter PRs by specific labels
- Responsive Design: Bootstrap-based responsive UI
- Real-time Data: Fetches live data from GitHub API
- Python 3.8 or higher
- GitHub Personal Access Token
- Git repository access
-
Clone or navigate to the project directory
cd "C:\Users\RP017421\OneDrive - Zelis Healthcare\Testing_Projects\testing github"
-
Set up Python virtual environment (already configured)
# Virtual environment is already created at .venv -
Install dependencies (already installed)
# Dependencies are already installed in the virtual environment -
Configure environment variables
- Copy
.env.exampleto.env - Edit
.envand add your GitHub configuration:
GITHUB_TOKEN=your_github_personal_access_token_here GITHUB_REPO=owner/repository-name - Copy
- Open Command Palette (
Ctrl+Shift+P) - Select "Tasks: Run Task"
- Choose "Run GitHub PR Dashboard"
- Press
F5or go to Run and Debug panel - Select "Python: Flask App" configuration
- Click the green play button
"C:/Users/RP017421/OneDrive - Zelis Healthcare/Testing_Projects/testing github/.venv/Scripts/python.exe" app.pyOnce running, open your browser and navigate to:
http://localhost:5000
-
Create a Personal Access Token:
- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate a new token with
repopermissions - Copy the token to your
.envfile
-
Set Repository:
- Update
GITHUB_REPOin.envwith format:owner/repository-name - Example:
microsoft/vscode
- Update
| Variable | Description | Required |
|---|---|---|
GITHUB_TOKEN |
GitHub Personal Access Token | Yes |
GITHUB_REPO |
Repository in format owner/repo | Yes |
- Available PRs: Shows count of open pull requests
- Labeled PRs: Shows count of PRs matching selected label criteria
- Closed PRs: Shows count of closed pull requests
- Month Filter: Select a specific month to filter all data
- Label Filter: Enter comma-separated labels to filter PRs
- Combined Filtering: Use both month and label filters together
- Click any dashboard card to open a modal with detailed PR information
- Each PR shows:
- Title and number
- Author and creation date
- Current state (open/closed)
- Associated labels
- Direct link to GitHub
GET /- Main dashboard pageGET /api/pr-stats- Get PR statistics (supports month and labels params)GET /api/prs- Get detailed PR list (supports type, month, and labels params)GET /api/available-months- Get list of available months from PRs
.
├── app.py # Main Flask application
├── templates/
│ └── dashboard.html # Dashboard UI template
├── static/ # Static files (currently empty)
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .vscode/
│ ├── launch.json # VS Code debug configuration
│ └── tasks.json # VS Code tasks
└── README.md # This file
- Backend: Python Flask
- Frontend: HTML5, Bootstrap 5, Vanilla JavaScript
- API: GitHub REST API v3
- Environment: Python Virtual Environment
-
GitHub API Rate Limiting:
- Ensure you're using a personal access token
- Check rate limit status in GitHub API responses
-
Repository Not Found:
- Verify
GITHUB_REPOformat in.env - Ensure your token has access to the repository
- Verify
-
Environment Variables Not Loading:
- Verify
.envfile exists in project root - Check that variables are not quoted unnecessarily
- Verify
- If you see "Error loading stats" or "Error loading pull requests", check:
- Network connectivity
- GitHub token validity
- Repository accessibility
- Console for detailed error messages
This project is for demonstration purposes. Please ensure compliance with GitHub's API terms of service.
2e757797419a55de53922c3967321397240bd3d7