Initial draft commit (Work in progress) (Not for review) #1789
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stripe Integration and Authentication Implementation
Overview
This PR implements Stripe payment integration and authentication features into our Next.js application, enabling subscription-based features, payment processing, and user authentication.
Changes Made
1. Authentication Implementation
Firebase Authentication
src/lib/firebase.ts
Components
ProfileDropdown.tsx
for user profile management:Profile Management
src/app/profile/page.tsx
for user profile management2. Environment Configuration
Added Stripe API keys and webhook secret:
3. Stripe Integration
Stripe Configuration
src/lib/stripe.ts
to initialize and export the Stripe instanceAPI Routes Implementation
src/app/api/stripe/create-checkout/route.ts
:src/app/api/stripe/webhooks/route.ts
:checkout.session.completed
eventsinvoice.payment_succeeded
events4. Database Updates
Added new fields to user documents in Firestore:
Authentication data:
Stripe-related data:
stripeCustomerId
: Unique identifier for the customer in StripestripeSubscriptionId
: Active subscription IDstripePriceId
: Current price plan IDstripeCurrentPeriodEnd
: Subscription period end datestripeSubscriptionStatus
: Current status of the subscriptionDependencies Added
Fixes #1751