Skip to content

Conversation

Copy link

Copilot AI commented Nov 26, 2025

Adds foundation for premium channel subscriptions: 210-channel dataset with gold-tier gating and skeleton Stripe+Firebase webhook integration ready for credential wiring.

Channel Dataset

  • src/data/channels.full.json: 210 channels (60 original + 150 synthetic IDs 25-220)
  • Gold tier IDs: 26, 33, 36, 40 (all others free)
  • src/utils/loadChannels.js: Loader with require() + fs fallback

Client Gating

  • src/components/ChannelLock.stubs.jsx: Mock entitlement checker with lock overlay/CTA
  • Shows integration pattern for Firestore real-time entitlement queries
<ChannelLock channel={channel}>
  <VideoPlayer stream={channel.stream} />
</ChannelLock>

Webhook Handler

  • functions/stripe-webhooks/index.js: Express app for checkout/subscription events
  • Handles: checkout.session.completed, customer.subscription.*, invoice.*
  • Signature verification disabled - enable before prod (see TODOs)
  • Maps Stripe customer → Firebase UID via customer.metadata.firebase_uid

Documentation

  • functions/README.md: Deployment, config, security warnings
  • docs/STRIPE_FIREBASE_INTEGRATION.md: Architecture, Firestore schema, implementation flow
  • README/DEVNOTES.md: Credential checklist, env vars, build steps

Required to Complete

  • Confirm/adjust gold-tier channel IDs
  • Provide Stripe test keys (sk_test_, pk_test_, whsec_*)
  • Provide Firebase service account or grant Cloud Functions/Firestore permissions
  • Provide Android keystore if APK signing desired

⚠️ Security: No secrets committed. All sensitive data via environment variables. Webhook signature verification must be enabled before production deployment.

Original prompt

Create a draft pull request that adds a large sample channel dataset and starter Stripe+Firebase integration stubs.

Summary of changes to include in the PR (all files must be added under the repo):

  1. src/data/channels.full.json
  • Add the combined channel dataset (210 channels). This file contains the original 60 channels plus 150 synthetic channels (IDs 25–220). Several channels are marked with tier values; gold-tier channel ids: 26, 33, 36, 40. All other synthetic channels default to "free". Streams and logos use placeholder domains and images.
  1. src/utils/loadChannels.js
  • Add a loader utility that exports loadChannels() which reads src/data/channels.full.json and returns the array. Use require() fallback and a fs fallback for environments that don't support require-ing JSON.
  1. src/components/ChannelLock.stubs.jsx
  • Add a client-side gating stub component demonstrating how to check user entitlements and render a lock overlay + "Upgrade to Gold" CTA. Include a mock useUserEntitlements() hook and instructions in comments to replace with real Firestore-backed entitlement checks.
  1. functions/stripe-webhooks/index.js
  • Add a skeleton Express app intended for Firebase Cloud Functions that receives Stripe webhooks, parses the raw body, and includes TODOs for verifying webhook signatures and writing subscription/entitlement updates to Firestore. Read secrets from env variables (STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET). Do NOT include any real secrets in the code.
  1. functions/README.md
  • Add deployment and environment variable instructions for the webhook functions (how to set firebase functions:config, deploy, and hazards of not verifying signatures).
  1. docs/STRIPE_FIREBASE_INTEGRATION.md
  • Add an integration overview describing Firestore schema suggestions, the recommended flow (client creates Checkout Session via function -> Stripe Checkout -> webhooks update Firestore), mapping stripe customer to firebase uid via metadata, security notes, and rules suggestions.
  1. README/DEVNOTES.md
  • Add a developer checklist that lists credentials and access required to finish end-to-end wiring and build steps for APK/ZIP. Include exact env var names expected in CI: STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_WEBHOOK_SECRET, FIREBASE_SERVICE_ACCOUNT (base64), FIREBASE_PROJECT_ID, ANDROID_KEYSTORE (or CI signing instructions).

PR details and constraints:

  • Open the PR as a draft so we can iterate after secrets/access are provided.
  • Do NOT include any real secrets or service account JSON in the commit. Any code that requires secrets must read them from environment variables.
  • Keep commits minimal and include clear TODO comments where additional wiring is required.

PR description (to include in the PR body):

  • Add src/data/channels.full.json with 210 channels (IDs 25-220). Gold-tier channel ids: 26, 33, 36, 40.
  • Add src/utils/loadChannels.js loader.
  • Add src/components/ChannelLock.stubs.jsx gating stub.
  • Add functions/stripe-webhooks/index.js webhook skeleton and functions/README.md.
  • Add docs/STRIPE_FIREBASE_INTEGRATION.md and README/DEVNOTES.md with integration steps and credentials checklist.

Checklist for maintainers (include in PR body):

  • Confirm gold-tier channel ids (26, 33, 36, 40) or provide additional IDs to mark gold.
  • Provide Stripe test keys or invite a Stripe user so products/prices can be created.
  • Provide Firebase service account or grant deployer permissions for functions and Firestore so webhook functions can be deployed.
  • Provide CI signing access or keystore for APK generation if you want a signed build.

Notes: If anything in this problem statement is unclear, ask for clarification before creating files. Otherwise create a draft PR on the default branch of STACEY77/RAG7 containing these changes and return the PR URL and a short summary of what was added.

This pull request was created as a result of the following prompt from Copilot chat.

Create a draft pull request that adds a large sample channel dataset and starter Stripe+Firebase integration stubs.

Summary of changes to include in the PR (all files must be added under the repo):

  1. src/data/channels.full.json
  • Add the combined channel dataset (210 channels). This file contains the original 60 channels plus 150 synthetic channels (IDs 25–220). Several channels are marked with tier values; gold-tier channel ids: 26, 33, 36, 40. All other synthetic channels default to "free". Streams and logos use placeholder domains and images.
  1. src/utils/loadChannels.js
  • Add a loader utility that exports loadChannels() which reads src/data/channels.full.json and returns the array. Use require() fallback and a fs fallback for environments that don't support require-ing JSON.
  1. src/components/ChannelLock.stubs.jsx
  • Add a client-side gating stub component demonstrating how to check user entitlements and render a lock overlay + "Upgrade to Gold" CTA. Include a mock useUserEntitlements() hook and instructions in comments to replace with real Firestore-backed entitlement checks.
  1. functions/stripe-webhooks/index.js
  • Add a skeleton Express app intended for Firebase Cloud Functions that receives Stripe webhooks, parses the raw body, and includes TODOs for verifying webhook signatures and writing subscription/entitlement updates to Firestore. Read secrets from env variables (STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET). Do NOT include any real secrets in the code.
  1. functions/README.md
  • Add deployment and environment variable instructions for the webhook functions (how to set firebase functions:config, deploy, and hazards of not verifying signatures).
  1. docs/STRIPE_FIREBASE_INTEGRATION.md
  • Add an integration overview describing Firestore schema suggestions, the recommended flow (client creates Checkout Session via function -> Stripe Checkout -> webhooks update Firestore), mapping stripe customer to firebase uid via metadata, security notes, and rules suggestions.
  1. README/DEVNOTES.md
  • Add a developer checklist that lists credentials and access required to finish end-to-end wiring and build steps for APK/ZIP. Include exact env var names expected in CI: STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_WEBHOOK_SECRET, FIREBASE_SERVICE_ACCOUNT (base64), FIREBASE_PROJECT_ID, ANDROID_KEYSTORE (or CI signing instructions).

PR details and constraints:

  • Open the PR as a draft so we can iterate after secrets/access are provided.
  • Do NOT include any real secrets or service account JSON in the commit. Any code that requires secrets must read them from environment variables.
  • Keep commits minimal and include clear TODO comments where additional wiring is required.

PR description (to include in the PR body):

  • Add src/data/channels.full.json with 210 channels (IDs 25-220). Gold-tier channel ids: 26, 33, 36, 40.
  • Add src/utils/loadChannels.js loader.
  • Add src/components/ChannelLock.stubs.jsx gating stub.
  • Add functions/stripe-webhooks/index.js webhook skeleton and functions/README.md.
  • Add docs/STRIPE_FIREBASE_INTEGRATION.md and README/DEVNOTES.md with integration steps and credentials checklist.

Checklist for maintainers (include in PR body):

  • Confirm gold-tier channel ids (26, 33, 36, 40) or provide additional IDs to mark gold.
  • Provide Stripe test keys or invite a Stripe user so products/prices can be created.
  • Provide Firebase service account or grant deployer permissions for functions and Firestore so webhook functions can be deployed.
  • Provide CI signing access or keystore for APK generation if you want a signed build.

Notes: If anything in this problem statement is unclear, ask for clarification before creating files. Otherwise create a draft PR on the default branch of STACEY77/RAG7 containing these changes and return the PR URL and a short summary of what was added.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Stacey77 <54900383+Stacey77@users.noreply.github.com>
Copilot AI changed the title [WIP] Add large sample channel dataset and Stripe+Firebase integration stubs Add sample channel dataset (210 channels) and Stripe+Firebase integration stubs Nov 26, 2025
Copilot AI requested a review from Stacey77 November 26, 2025 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants