|
1 | 1 | # GitHub PR Dashboard |
2 | 2 |
|
3 | | -A lightweight, fast dashboard for viewing GitHub pull requests. Built with plain HTML, CSS, and JavaScript for maximum performance and simplicity. |
| 3 | +A lightweight, fast dashboard for viewing GitHub pull requests. Can be served statically or via the included secure Go server with OAuth support. |
4 | 4 |
|
5 | 5 | ## Features |
6 | 6 |
|
7 | | -- **Real GitHub Integration**: Login with GitHub OAuth to view your actual pull requests |
8 | | -- **Smart Categorization**: Automatically groups PRs into Incoming (for review), Outgoing (authored by you), and Drafts |
9 | | -- **Visual Status Indicators**: Color-coded cards and badges show PR status at a glance |
10 | | -- **Activity Sparklines**: See PR activity trends for each section |
11 | | -- **Organization Filtering**: Filter PRs by GitHub organization |
| 7 | +- **Real GitHub Integration**: Login with GitHub OAuth or Personal Access Token |
| 8 | +- **Smart Categorization**: Automatically groups PRs into Incoming, Outgoing, and Drafts |
| 9 | +- **Visual Status Indicators**: Color-coded cards show PR status at a glance |
| 10 | +- **Security Hardened Go Server**: Optional server with comprehensive security features |
12 | 11 | - **Demo Mode**: Try the interface with sample data before logging in |
13 | | -- **URL-based User Switching**: View other users' PRs by adding `?user=username` to the URL |
14 | 12 |
|
15 | 13 | ## Quick Start |
16 | 14 |
|
17 | | -1. Open `index.html` in a web browser |
18 | | -2. Click "Try Demo Mode" to see the interface with sample data, or |
19 | | -3. Login with GitHub to view your real pull requests |
20 | | - |
21 | | -## Status Indicators |
| 15 | +### Static Files (Simple) |
| 16 | +```bash |
| 17 | +# Just open in browser |
| 18 | +open index.html |
| 19 | +``` |
22 | 20 |
|
23 | | -- 🔴 **Blocked on you**: PRs requiring your immediate attention |
24 | | -- 🟡 **Stale**: PRs older than 30 days |
25 | | -- 🟢 **Ready to merge**: PRs approved and ready for merging |
26 | | -- 🟠 **Merge conflicts**: PRs with conflicts that need resolution |
27 | | -- ⚪ **Draft**: Work-in-progress pull requests |
| 21 | +### Go Server (OAuth + Security) |
| 22 | +```bash |
| 23 | +go build |
| 24 | +# Client ID defaults to Iv23liYmAKkBpvhHAnQQ |
| 25 | +./dashboard --port=8080 --client-secret=YOUR_SECRET |
| 26 | +``` |
28 | 27 |
|
29 | | -## GitHub OAuth Setup |
| 28 | +## Go Server Features |
| 29 | + |
| 30 | +### Security |
| 31 | +- **CSRF Protection**: Secure state validation |
| 32 | +- **Rate Limiting**: 10 req/min per IP on OAuth endpoints |
| 33 | +- **Security Headers**: CSP, X-Frame-Options, HSTS, etc. |
| 34 | +- **Request Tracking**: Unique IDs and security event logging |
| 35 | +- **Origin Validation**: Configurable CORS with `--allowed-origins` |
| 36 | + |
| 37 | +### Configuration |
| 38 | +```bash |
| 39 | +# Environment variables |
| 40 | +PORT=8080 GITHUB_CLIENT_ID=xxx GITHUB_CLIENT_SECRET=yyy ./dashboard |
| 41 | + |
| 42 | +# Command line flags |
| 43 | +# Defaults: client-id=Iv23liYmAKkBpvhHAnQQ, redirect-uri=https://dash.ready-to-review.dev/oauth/callback |
| 44 | +./dashboard \ |
| 45 | + --port=8080 \ |
| 46 | + --client-secret=yyy \ |
| 47 | + --redirect-uri=http://localhost:8080/oauth/callback \ |
| 48 | + --allowed-origins=http://localhost:8080 |
| 49 | +``` |
30 | 50 |
|
31 | | -See [README_OAUTH.md](README_OAUTH.md) for instructions on setting up GitHub OAuth authentication. |
| 51 | +### Endpoints |
| 52 | +- `GET /` - Dashboard |
| 53 | +- `GET /health` - Health check |
| 54 | +- `GET /oauth/login` - Start OAuth flow |
| 55 | +- `GET /oauth/callback` - OAuth callback |
32 | 56 |
|
33 | | -## URL Parameters |
| 57 | +## GitHub OAuth Setup |
34 | 58 |
|
35 | | -- `?demo=true` - Launch in demo mode with sample data |
36 | | -- `?user=username` - View a specific GitHub user's pull requests (requires authentication) |
| 59 | +1. Create OAuth App at GitHub Settings > Developer settings > OAuth Apps |
| 60 | +2. Set callback URL to `https://dash.ready-to-review.dev/oauth/callback` (or your custom URL) |
| 61 | +3. Use the client secret with the Go server (client ID defaults to Iv23liYmAKkBpvhHAnQQ) |
37 | 62 |
|
38 | | -## Technical Details |
| 63 | +## Security Best Practices |
39 | 64 |
|
40 | | -- **Zero Dependencies**: Pure HTML, CSS, and JavaScript (except for demo data) |
41 | | -- **Responsive Design**: Works on desktop and mobile devices |
42 | | -- **Accessible**: ARIA labels and semantic HTML for screen readers |
43 | | -- **Fast**: Minimal JavaScript, efficient DOM updates |
44 | | -- **Clean Code**: Well-organized, commented code following best practices |
| 65 | +When using the Go server: |
| 66 | +- **Always use HTTPS in production** - Enables HSTS automatically |
| 67 | +- **Set allowed origins** - Use `--allowed-origins` for your domains |
| 68 | +- **Monitor logs** - Watch for `[SECURITY]` tagged events |
| 69 | +- **Keep updated** - Regular updates for security patches |
45 | 70 |
|
46 | 71 | ## File Structure |
47 | 72 |
|
48 | 73 | ``` |
49 | | -├── index.html # Main application HTML |
50 | | -├── assets/ |
51 | | -│ ├── app.js # Application JavaScript |
52 | | -│ ├── styles.css # Application styles |
53 | | -│ └── demo-data.js # Demo mode sample data |
54 | | -└── README_OAUTH.md # OAuth setup instructions |
| 74 | +├── index.html # Dashboard UI |
| 75 | +├── main.go # Secure Go server |
| 76 | +├── assets/ # CSS, JS, demo data |
| 77 | +└── go.mod # Go module file |
55 | 78 | ``` |
56 | 79 |
|
57 | | -## Browser Support |
58 | | - |
59 | | -- Chrome/Edge (latest) |
60 | | -- Firefox (latest) |
61 | | -- Safari (latest) |
62 | | -- Mobile browsers (iOS Safari, Chrome) |
63 | | - |
64 | | -## Contributing |
65 | | - |
66 | | -This is a simple, focused application. If you'd like to contribute: |
67 | | - |
68 | | -1. Keep it simple - no frameworks or build tools |
69 | | -2. Maintain backward compatibility |
70 | | -3. Test on multiple browsers |
71 | | -4. Follow the existing code style |
72 | | - |
73 | 80 | ## License |
74 | 81 |
|
75 | 82 | MIT |
0 commit comments