Skip to content

jcreek/SvelteKitSaasBoilerplate

Repository files navigation

SvelteKit Saas Boilerplate

A SvelteKit boilerplate project for a Software As A Service (SaaS) application, to get you started quickly.

Netlify Status

Developing

After you have cloned the repository you can install the dependencies with npm install, and start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

An example .env file is provided in the repository. You will need to copy .env.example to .env and fill in the values with your own credentials.

If you want a fully local development environment (other than stripe) then you can follow the instructions in the database setup document and make use of the local supabase instance and a local email service.

For stripe, you can forward the events to your local server using stripe listen --forward-to localhost:5173/api/webhook/stripe --skip-verify in a separate terminal window.

Building

To create a production version:

npm run build

You can preview the production build with npm run preview.

Hosting and Tech Stack

This application is designed to run on Netlify and uses Supabase for database storage and user authentication (Supabase Auth).

The application is written in Typescript using the SvelteKit framework.

For styling, the application uses Tailwind CSS with the DaisyUI component library and HyperUI.

For taking payments the Stripe Checkout is used.

In its current configuration, the application can be easily linked to Netlify via git for CI/CD, enabling automatic deployments on push to the main branch.

To Do

Please see the Issues tab for enhancement tagged issues.

Testing the example credits management system

There is an example system in this project for being able to manage credits that are sold to users. To test this system you can visit the http://localhost:5173/test/test-credits route. This will allow you to add credits to a user and then spend them by clicking the buttons on the page, and will show the user's credit balance updating in real time.