A user management and subscription-based application built with React, Next.js, and TypeScript. The project uses Supabase for authentication and database management and integrates Stripe to manage subscriptions and payments. Based on Next.js Subscription Payments Starter.
- User Authentication: Secure user login and registration using Supabase.
- Subscription Management: Integration with Stripe to handle user subscriptions, payments, and billing.
- Real-time Updates: Utilizes Supabase's real-time features to keep user data and subscription status up-to-date.
- TypeScript Support: Fully typed codebase for improved developer experience and reliability.
- Responsive Design: Ensures the application looks good on both desktop and mobile devices.
- Frontend: React, Next.js, TypeScript
- Backend: Supabase for database management and authentication.
- Payments: Stripe for handling subscription payments and billing.
- Deployment: Compatible with platforms like Netlify for easy CI/CD.
Follow these steps to set up the project locally:
-
Clone the repository:
git clone https://github.com/peyronnet-group/account.git cd account
-
Install dependencies:
npm install
-
Set up your environment variables:
- Create a
.env.local
file in the root directory. - Add the following environment variables:
NEXT_PUBLIC_SUPABASE_URL=<your-supabase-url> NEXT_PUBLIC_SUPABASE_ANON_KEY=<your-supabase-anon-key> SUPABASE_SERVICE_ROLE_KEY=<your-supabase-service-key> STRIPE_SECRET_KEY=<your-stripe-secret-key> NEXT_PUBLIC_STRIPE_PUBLIC_KEY=<your-stripe-public-key> STRIPE_WEBHOOK_SECRET=<your-stripe-webhook-secret>
- Create a
-
Start the development server:
npm run dev
The application should now be running at
http://localhost:3000
.
Users can sign up or log in through the app using Supabase's authentication methods. Ensure you have configured your Supabase project with the necessary settings for authentication.
The app uses Stripe to manage subscriptions. Users can select subscription plans, and the app will handle the checkout process using Stripe’s API. Ensure you set up the webhook endpoint /api/webhooks
in your Stripe dashboard to handle events such as subscription updates.
The project is optimized for deployment on Netlify/Vercel. Follow these steps:
- Link your repository to Netlify.
- Set up the environment variables in Netlify's dashboard to match your local
.env
file. - Deploy the application.
.
├── components # React components
├── pages # Next.js pages and API routes
├── public # Static assets
├── styles # CSS/SCSS files
├── types # TypeScript types
├── utils # Utility functions for Supabase and Stripe
└── .env.local # Environment variables (not included in version control)
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.