How formulaunobyedoardoandfabio-del/bt-app-flutter works
B&T is a Formula 1 community and companion app, with a React/Capacitor client and a small Vercel API. The user-facing workflow centers on app navigation across news, live race data, chat, and fantasy features, with Firebase-backed account/community data and optional advertising. Premium checkout is handled by Stripe, with a webhook updating Firebase subscription state. The single large App.jsx implements much of the client, so its feature nodes share that path. Feature coverage beyond the excerpts follows README claims; those internal client relationships are not individually verified.
Main entry points: App.jsx App shell · createCheckoutSession.js Checkout session · cancelSubscription.js Cancel subscription · stripeWebhook.js Stripe webhook
Components 26
Mobile app
- App shell
src/App.jsx - App navigation
src/App.jsx - Accounts
src/App.jsx - Premium controls
src/App.jsx - Ads and consent
src/App.jsx
Content and community
- F1 news
src/App.jsx - Live race data
src/App.jsx - Fantasy game
src/App.jsx - Community chat
src/App.jsx - Chat moderation
src/App.jsx - Admin tools
src/App.jsx - Notifications
src/App.jsx
Backend services
- Checkout session
functions/api/createCheckoutSession.js - Cancel subscription
functions/api/cancelSubscription.js - Stripe webhook
functions/api/stripeWebhook.js - Payment feedback
functions/api/paymentResult.js - Firebase Admin
functions/api/_lib/firebaseAdmin.js - Raw request body
functions/api/_lib/rawBody.js - CORS helper
functions/api/_lib/cors.js - Article generation
functions/api/generateArticle.js
External integrations
- Firebase data
- OpenF1
- Google AdMob
- Stripe
- OpenAI
Other components
- App user
Connections 28
- App user → App shell: uses
README.md - App shell → App navigation: shows
src/App.jsx - App navigation → F1 news: opens
src/App.jsx - App navigation → Live race data: opens
src/App.jsx - App navigation → Fantasy game: opens
src/App.jsx - App navigation → Community chat: opens
src/App.jsx - App shell → Firebase data: uses
README.md - App shell → OpenF1: reads live data
README.md - Community chat → Chat moderation: supports reports
README.md - Admin tools → Chat moderation: handles reports
README.md - App shell → Google AdMob: shows ads
src/App.jsx - App shell → Ads and consent: requests consent
README.md - Premium controls → Checkout session: requests checkout
functions/api/createCheckoutSession.js - Premium controls → Cancel subscription: requests cancellation
functions/api/cancelSubscription.js - Checkout session → Firebase Admin: loads account
functions/api/createCheckoutSession.js - Cancel subscription → Firebase Admin: loads account
functions/api/cancelSubscription.js - Checkout session → Stripe: creates session
functions/api/createCheckoutSession.js - Cancel subscription → Stripe: cancels subscription
functions/api/cancelSubscription.js - Stripe → Stripe webhook: sends events
functions/api/stripeWebhook.js - Stripe webhook → Raw request body: reads body
functions/api/stripeWebhook.js - Stripe webhook → Firebase Admin: updates premium
functions/api/stripeWebhook.js - Checkout session → Payment feedback: sets return URLs
functions/api/createCheckoutSession.js - App shell → Payment feedback: opens result
- Admin tools → Article generation: requests draft
functions/api/generateArticle.js - Article generation → OpenAI: generates text
functions/api/generateArticle.js - Checkout session → CORS helper: sets headers
functions/api/createCheckoutSession.js - Cancel subscription → CORS helper: sets headers
functions/api/cancelSubscription.js - Article generation → CORS helper: sets headers
functions/api/generateArticle.js