SaaS Onboarding Workflow : Integrating Stripe, Clerk, and PostgreSQL in a Next.js App
Unanswered
European pilchard posted this in #help-forum
European pilchardOP
Hello everyone,
I'm currently working on a Next.js project and facing some challenges with integrating Stripe for payment processing, Clerk for user authentication, and updating my PostgreSQL database accordingly. I'm using Prisma ORM for database interactions. Here's a brief overview of my requirements and current setup:
Project Overview:
- A Saas web application that generates marketing copy with AI
- App built with Next.js + Typescript + App Router.
- Users can pick among two one-payment plans (no subscriptions) and pay via Stripe.
- There are two plans : Single Generation Plan, Unlimited Generations Plan
- Post-payment, users create an account using Clerk.
- User and payment information is stored in a PostgreSQL database with the help of Prisma ORM.
Current Progress:
- Clerk is integrated for user authentication.
- Prisma ORM is configured for database operations.
Challenges:
- Ensuring a seamless flow from Stripe payment to Clerk user creation.
- Efficiently updating the database with user and payment details post-transaction.
Specific Questions:
- What's the best practice for securely handling Stripe integration in a Next.js environment?
- How should I structure the database schema to link Stripe payments with user accounts created via Clerk?
- Any tips on synchronizing the payment flow with user account creation in Clerk?
- Is there an alternative workflow to handle user payment + onboarding ? meaning would it be better to authenticate the user with Clerk and after that redirect to Stripe for payment ?
I would greatly appreciate any advice, code snippets, or resources that could guide me in the right direction. If anyone has tackled similar integrations or has insights on best practices for such a workflow, your input would be invaluable.
Thank you in advance for your help!
Best regards,
I'm currently working on a Next.js project and facing some challenges with integrating Stripe for payment processing, Clerk for user authentication, and updating my PostgreSQL database accordingly. I'm using Prisma ORM for database interactions. Here's a brief overview of my requirements and current setup:
Project Overview:
- A Saas web application that generates marketing copy with AI
- App built with Next.js + Typescript + App Router.
- Users can pick among two one-payment plans (no subscriptions) and pay via Stripe.
- There are two plans : Single Generation Plan, Unlimited Generations Plan
- Post-payment, users create an account using Clerk.
- User and payment information is stored in a PostgreSQL database with the help of Prisma ORM.
Current Progress:
- Clerk is integrated for user authentication.
- Prisma ORM is configured for database operations.
Challenges:
- Ensuring a seamless flow from Stripe payment to Clerk user creation.
- Efficiently updating the database with user and payment details post-transaction.
Specific Questions:
- What's the best practice for securely handling Stripe integration in a Next.js environment?
- How should I structure the database schema to link Stripe payments with user accounts created via Clerk?
- Any tips on synchronizing the payment flow with user account creation in Clerk?
- Is there an alternative workflow to handle user payment + onboarding ? meaning would it be better to authenticate the user with Clerk and after that redirect to Stripe for payment ?
I would greatly appreciate any advice, code snippets, or resources that could guide me in the right direction. If anyone has tackled similar integrations or has insights on best practices for such a workflow, your input would be invaluable.
Thank you in advance for your help!
Best regards,