A full-featured FastHTML application demonstrating OAuth authentication, database integration with FastLite, and Stripe payment processing with a credit-based system via FastStripe.
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Go to "Credentials" → "Create Credentials" → "OAuth 2.0 Client IDs"
- Configure the OAuth consent screen if prompted
- Set Application type to "Web application"
- Add
http://localhost:5001/redirectto "Authorized redirect URIs" - Copy the Client ID and Client Secret
- Create a Stripe account
- Go to the Stripe Dashboard
- Get your "Secret key" from the API keys section (use test keys for development)
- Install the Stripe CLI
- Login to Stripe CLI:
stripe login - Get your webhook signing secret:
stripe listen --forward-to localhost:5001/webhook - Copy the webhook signing secret from the CLI output
Set the following environment variables:
export GOOGLE_CLIENT_ID=your_google_client_id
export GOOGLE_CLIENT_SECRET=your_google_client_secret
export STRIPE_SECRET_KEY=your_stripe_secret_key
export STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secretpip install -r requirements.txt
python main.py- Visit
http://localhost:5001and click "Login" to authenticate with Google - After login, you'll see your dashboard with current coin balance (starts with 100 coins)
- Click "Buy Coins" to purchase additional coins via Stripe checkout
- Complete the payment using Stripe's test card:
4242 4242 4242 4242 - Coin balance updates automatically after successful payment via webhook