Practical examples demonstrating FastAPI-GitHubApp features through a consistent use case: automatically closing GitHub issues.
Issue Auto-Closer (Basic) - Simple webhook handling that closes new issues automatically. Good starting point for understanding GitHub App basics.
Issue Auto-Closer (Configuration Demo) - Same functionality using both environment variables and constructor parameters. Shows configuration approaches.
Issue Auto-Closer (OAuth2) - Adds OAuth2 user authentication, session management, and protected endpoints while maintaining issue auto-closing functionality.
Issue Auto-Closer (Advanced) - Demonstrates rate limiting, retry logic, error handling, and production-ready patterns with comprehensive API protection.
All examples implement the same core behavior:
- Automatically close new issues with a comment
- Close reopened issues with a comment
- Demonstrate the specific feature while performing real actions
This approach shows how each feature works in practice rather than just returning data.
The examples are designed as a learning progression:
- 01-basic-webhook - Start here for GitHub App fundamentals
- 02-configuration - Learn different configuration approaches
- 03-oauth2-integration - Add user authentication
- 04-advanced-features - Production-ready patterns and rate limiting
Each example builds on concepts from the previous ones while maintaining the same core functionality.
- Choose an example directory
- Copy
.env.exampleto.env - Configure your GitHub App credentials
- Run the example and test by creating issues
cd samples/01-basic-webhook
cp .env.example .env
# Edit .env with your credentials
python app.py
# Create an issue in your test repo to see it get closed- GitHub App created at GitHub Developer Settings
- Repository permissions: Issues (Write), Metadata (Read)
- Event subscriptions: Issues
- Private key and webhook secret generated
All examples use environment variables for configuration. See individual README files for specific setup instructions.