A Next.js application demonstrating Stripe Connect integration for content creators to receive payments from their audience.
- Creator onboarding with Stripe Connect Express
- Secure payment processing
- Creator dashboard showing earnings
- Direct access to Stripe dashboard
- Support for multiple currencies
- Node.js 18+ and npm
- A Stripe account
- Stripe API keys (test mode for development)
Create a .env.local
file in the root directory with the following variables:
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
NEXT_PUBLIC_APP_URL=url //has to be https, use ngrok on localhost for a tunnel to port 3000
- Install dependencies:
npm install
- Run the development server:
npm run dev
- Open http://localhost:3000 in your browser.
/src/app/api/stripe/*
- Stripe API endpoints/src/app/onboarding
- Creator onboarding flow/src/app/dashboard
- Creator dashboard/src/app/purchase
- Payment processing
The current implementation uses a simple email-based lookup for accessing creator dashboards. For production use, I strongly recommend implementing a proper authentication system:
- Set up a database to store user accounts
- Implement email/password authentication
- Link Stripe accounts to user accounts
- Use secure session management
- Add proper authorization checks
- Never expose Stripe secret keys in client-side code
- Use environment variables for sensitive data
- Implement rate limiting
- Add request validation
- Built with Next.js 13+ (App Router)
- Uses TypeScript for type safety
- Styled with Tailwind CSS
- Implements Stripe Connect Express for creator onboarding
- Set up environment variables in your hosting platform
- Build the application:
npm run build
- Start the production server:
npm start