Nextjs Billing screenshot

Nextjs Billing

Author Avatar Theme by Lmsqueezy
Updated: 19 Aug 2024
700 Stars

Next.js billing app with Lemon Squeezy

Categories

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

  1. Prerequisites:

    • Lemon Squeezy Account and Store
    • Neon Account
  2. Getting Started:

    • Clone the Repo
      git clone [repo_link]
      cd project_directory
      
    • Install Dependencies
      npm install
      
    • Set Environment Variables
      cp .env.example .env
      
      Fill in the necessary environment variables for Lemon Squeezy, webhook URL, Postgres URL, and GitHub OAuth.
  3. 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.
  4. Webhook Configuration:

    • Obtain a web-accessible URL using services like ngrok or LocalCan.
    • Add the URL to the .env file for webhook events.
  5. Postgres URL:

    • Obtain the Postgres URL from your Neon account and add it to the .env file.
  6. 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.