5 Steps to Earning your first Dollars on the Internet
Project uses Next.js 14 (App Router), Supabase, PostgresSQL, Drizzle ORM, Stripe, Vercel AI SDK, Auth.js, Resend Emails, PostHog Analytics, Tailwind CSS, Shadcn UI, Acerternity UI, Magic UI and more.
"No Unit Testing before Reaching 100k Monthly active users or 10k Paid Users"
1. Setup Codebase
Clone the Ninetails GitHub Repository from here Ninetails GitHub.
Run Following Commands to install all required packagers.
$ npm i
2. Configure Environment Variables
Go to env.local and fill in all the mentioned environment variables. To Just get started, Below are the few platforms you will need to create account on to get some of the Variables values.
- Supabase Auth: Configure Auth Providers like Google, GitHub as per your wish
- Supabase DB: PostgreSQL Database
- Stripe: Payments Gateway
- Keys for Google Auth, GitHub Auth and any you want for your Auth.
- (If required) Resend: Email Delivery
- PostHog: Website Analytics
3. Setup Tables in Database
We are using Drizzle ORM to work with database. Go to database/schema.ts file to find all the tables schema we are using. You can add tables schema as you like. Make sure to not delete existing property of tables like users, accounts, sessions, verification_token as they are required for our Auth.js library.
Now go to terminal and run following commands.
$ npx drizzle-kit generate
$ npx drizzle-kit migrate
4. Create Subscription Product on Stripe
We are using Stripe for Payments collections of our paid plans. Go to Stripe, Set it up (if you don't know there are few simple video tutorials on youtube you can find).
- Create a Recurring Product, Get its Price ID and past it in .env file as mentioned before
- Go to Developers -> Webhooks in stripe
- Setup Stripe WebHook with these events selected:
- checkout.session.completed
- invoice.payment_succeeded
- customer.subscription.updated
- customer.subscription.deleted
- Set Webhook Endpoint URL as
$ https://your-website-domain.com/api/webhooks/stripe
5. Deployment
Deployment is very easy for Next.js App. Most commonly and easy to use platform you can use is Vercel
6. Have a Question?
If you have any questions you can reach out to below mentioned Handles.
7. Want to show Support?
If this starter template helped you and you want to show some support. Here are few ways.
- Star on GitHub
- Follow on Twitter
- Follow on GitHub
- Sponsor on Github