mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-12 18:43:50 +00:00
62 lines
2.7 KiB
Markdown
62 lines
2.7 KiB
Markdown
# SvelteKit Saas Boilerplate
|
|
|
|
A SvelteKit boilerplate project for a Software As A Service (SaaS) application, to get you started quickly.
|
|
|
|
[](https://app.netlify.com/sites/sveltekitsaasboilerplate/deploys)
|
|
|
|
## Developing
|
|
|
|
After you have cloned the repository you can install the dependencies with `npm install`, and start a development server:
|
|
|
|
```bash
|
|
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](/docs/database-setup.md) document and make use of the local supabase instance and a local email service.
|
|
|
|
- [Local DB Url](http://localhost:54323/)
|
|
- [Local Email Monitoring Url](http://localhost:54324/)
|
|
|
|
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:
|
|
|
|
```bash
|
|
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](https://www.netlify.com/) and uses [Supabase](https://supabase.io/) for database storage and user authentication ([Supabase Auth](https://supabase.com/auth)).
|
|
|
|
The application is written in Typescript using the [SvelteKit](https://kit.svelte.dev/) framework.
|
|
|
|
For styling, the application uses [Tailwind CSS](https://tailwindcss.com/) with the [DaisyUI](https://daisyui.com/) component library and [HyperUI](https://www.hyperui.dev/).
|
|
|
|
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
|
|
|
|
- [Update types automatically](https://supabase.com/docs/guides/api/rest/generating-types#update-types-automatically-with-github-actions)
|
|
|
|
Please see the Issues tab for `enhancement` tagged issues.
|
|
|
|
## [Database setup](/docs/database-setup.md)
|
|
|
|
## [Stripe webhook event listening](/docs/stripe-setup.md)
|
|
|
|
## 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.
|