A Vite + React application that authenticates with GitHub using OAuth and displays your open pull requests using the GitHub GraphQL API with Relay.
- 🔐 GitHub OAuth authentication
- 📊 GraphQL queries using Relay
- 🔀 View all your open pull requests across repositories
- 📈 See PR status, review decisions, and code changes
- 🎨 Modern UI with Tailwind CSS
- 📱 Responsive design
- 🌙 Dark mode support
- ⚡ Type-safe with TypeScript
- 🚀 Fast development with Vite
- Vite - Build tool and dev server
- React 18 - UI library
- React Router - Client-side routing
- Relay - GraphQL client
- Express - OAuth token exchange server
- GitHub GraphQL API - Data source
- Tailwind CSS v4 - Styling
- TypeScript - Type safety
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in the details:
- Application name: GraphQL Demo (or any name)
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/callback
- Click "Register application"
- Copy the Client ID
- Generate a new Client Secret and copy it
-
Copy the example environment file:
cp .env.example .env
-
Edit
.envand add your credentials:VITE_GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret VITE_REDIRECT_URI=http://localhost:3000/callback PORT=3001
npm installnpm run relayThis will start both the OAuth server (port 3001) and Vite dev server (port 3000):
npm startOr run them separately:
# Terminal 1 - OAuth server
npm run server
# Terminal 2 - Vite dev server
npm run devOpen http://localhost:3000 in your browser.
- Click "Sign in with GitHub" on the homepage
- Authorize the application
- View your open pull requests with details like:
- PR title and number
- Repository name
- Branch information (head → base)
- Review decision status (Approved, Changes Requested, Review Required)
- Draft status
- Code changes (+additions / -deletions)
- Created and updated dates
├── src/
│ ├── components/
│ │ ├── PullRequestList.tsx # Pull request list with Relay query
│ │ └── ErrorBoundary.tsx # Error boundary component
│ ├── pages/
│ │ ├── HomePage.tsx # Main page with auth logic
│ │ └── CallbackPage.tsx # OAuth callback handler
│ ├── lib/
│ │ ├── auth.ts # OAuth authentication logic
│ │ └── relay/
│ │ └── environment.ts # Relay environment
│ ├── App.tsx # Root app component
│ ├── main.tsx # App entry point
│ └── index.css # Global styles
├── __generated__/ # Relay generated files
├── server.js # OAuth token exchange server
├── vite.config.ts # Vite configuration
├── relay.config.js # Relay compiler configuration
└── schema.graphql # GitHub GraphQL schema
npm start- Start both OAuth server and Vite dev servernpm run dev- Start Vite development server onlynpm run server- Start OAuth server onlynpm run build- Build for production (includes Relay compilation)npm run preview- Preview production buildnpm run relay- Compile Relay queriesnpm run lint- Run ESLint
