How stripe/example-mobile-backend works
Project type and purpose
• This is a minimal Ruby-based example of a mobile backend for processing payments via Stripe.
• It exposes an HTTP API (web.rb) that mobile clients (iOS/Android apps) call when they need to create charges or fetch payment intent data.
• It’s deployed as a single microservice (Heroku/Glitch) and delegates all payment logic to the Stripe API.
File structure
• Top-level files only—no frontend code.
• web.rb – the entire Ruby HTTP service (likely Sinatra or Rack).
• Gemfile & Gemfile.lock – dependencies (stripe gem, rack/sinatra).
• Procfile & app.json – deployment configuration (Heroku or Glitch).
• .ruby-version – Ruby runtime version.
• .github/ISSUE_TEMPLATE.md, LICENSE, .gitignore – admin/config.
• No database folder or ORM config implies stateless endpoints; all state managed by Stripe.
README
• Notes deprecation and points to a hosted Glitch example.
• The “Accept a Payment” guide describes how mobile SDKs interact with a backend to create PaymentIntents.
Detailed capture of essential elements
• Call out environment variables (STRIPE_SECRET_KEY).
• If desired, show CI/CD or GitHub integration (the .github folder and where tests or templates would fit).