Skip to main content

Getting Started with SvelteBolt

Follow this guide to set up SvelteBolt and start building your SaaS application in no time.


Prerequisites

Before you begin, ensure you have:

  • Node.js: Version 16 or higher.
  • npm or pnpm: For managing dependencies.
  • A Supabase account with a project ready.
  • A Stripe account for payments integration.

Step 1: Clone the Repository

First, clone the SvelteBolt repository to your local machine:

git clone https://github.com/your-repo/sveltebolt.git
cd sveltebolt

Step 2: Install Dependencies

Install all required dependencies:

npm install

Or, if you’re using pnpm:

pnpm install

Step 3: Configure Environment Variables

Create a .env file in the root directory and add the following variables:

PUBLIC_SUPABASE_URL=<your-supabase-url>
PUBLIC_SUPABASE_ANON_KEY=<your-anon-key>
SUPABASE_SERVICE_ROLE_KEY=<your-service-role-key>
STRIPE_API_KEY=<your-stripe-api-key>
STRIPE_WEBHOOK_SECRET=<your-webhook-secret>

Refer to Environment Variables for Authentication for details on where to find these values.

Step 4: Set Up the Database

Run the following command to apply the preconfigured schema to your Supabase project:

supabase db push --file schema.sql

Alternatively, follow the Database Setup Instructions if you prefer using the Supabase Dashboard.

Step 5: Start the Development Server

Run the development server:

npm run dev

Visit http://localhost:3000 in your browser to see SvelteBolt in action.

Step 6: Test Authentication and Payments

Authentication: Try signing up or logging in with email magic links or social providers.

Payments: Add a Stripe test plan in the dashboard and initiate a test subscription.