Overview
The Next.js Billing App with Lemon Squeezy is a demo application suitable for developing subscription-based SaaS apps. It offers features like authentication, billing integration, ORM support, serverless architecture, and various other tools to facilitate app development.
Features
- Framework: Next.js 14
- Language: TypeScript
- Billing: Lemon Squeezy
- Auth (GitHub OAuth): Auth.js v5
- ORM: Drizzle
- Styling: Tailwind CSS
- Components: Wedges
- Serverless Postgres: Neon
- Linting: ESLint
- Formatting: Prettier
Installation
Prerequisites:
- Lemon Squeezy Account and Store
- Neon Account
Getting Started:
- Clone the Repo
git clone [repo_link] cd project_directory
- Install Dependencies
npm install
- Set Environment VariablesFill in the necessary environment variables for Lemon Squeezy, webhook URL, Postgres URL, and GitHub OAuth.
cp .env.example .env
- Clone the Repo
Lemon Squeezy Setup:
- API Key: Obtain a new API key from the Lemon Squeezy Settings > API and paste it in the .env file.
- Store ID: Get the store ID from Lemon Squeezy Settings > Stores and add it to the .env file.
- Webhook Secret: Generate a random webhook secret key and include it in the .env file.
Webhook Configuration:
- Obtain a web-accessible URL using services like ngrok or LocalCan.
- Add the URL to the .env file for webhook events.
Postgres URL:
- Obtain the Postgres URL from your Neon account and add it to the .env file.
GitHub OAuth:
- Set up a GitHub OAuth app to get the GITHUB_SECRET and GITHUB_ID for authentication.
Summary
The Next.js Billing App with Lemon Squeezy provides a comprehensive base for building subscription-based SaaS applications. By using a stack of industry-standard tools and integrations, developers can kickstart their projects with ready-made auth, billing, and serverless Postgres setups. The detailed installation guide ensures a smooth setup process for utilizing the app’s features seamlessly.