Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshnuss/sveltekit-saas
https://github.com/joshnuss/sveltekit-saas
authjs saas stripe svelte sveltekit
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/joshnuss/sveltekit-saas
- Owner: joshnuss
- Created: 2023-01-27T04:36:25.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-26T06:36:39.000Z (11 months ago)
- Last Synced: 2024-10-14T22:21:33.138Z (2 months ago)
- Topics: authjs, saas, stripe, svelte, sveltekit
- Language: JavaScript
- Homepage:
- Size: 57.6 KB
- Stars: 60
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SvelteKit SaaS Demo
Code examples from the video course [Build a SaaS with SvelteKit](https://joshuanussbaum.podia.com/build-a-saas-with-sveltekit)
## Features
- Authentication with Auth.js
- Database with Prisma
- Plans & pricing page
- Payments with Stripe Checkout
- Syncing subscription status via webhooks## Setup
Start by copying the example `.env`:
```sh
cp .env.example .env
```Then customize the `.env` file. You'll need to provide values for:
- `DATABASE_URL`: The url of your database.
- `AUTH_SECRET`: The secret Auth.js uses. Can be generated using `openssl rand -base64 32`
- `GITHUB_ID`: The id of your GitHub OAuth client.
- `GITHUB_SECRET`: The secret of your GitHub OAuth client.
- `SECRET_STRIPE_KEY`: Your Stripe API secret key.
- `STRIPE_WEBHOOK_SECRET`: Your Stripe secret for webhooks.Install the dependencies:
```sh
pnpm install
```Create the database:
```sh
pnpm prisma db push
```## Install the Stripe CLI
To tunnel Stripe webhooks in development mode, install Stripe's CLI.
Follow instructions here:
https://stripe.com/cli
## Development mode
First, run the dev server
```sh
pnpm dev
```Then, tell Stripe to tunnel webhooks to the local dev server:
```sh
stripe listen --forward-to localhost:5173/integrations/stripe
```## Seed data
You can adjust the seed data in `prisma/seed.js` to use price ids from your Stripe account.
To load seed data, run:
```sh
prisma db seed
```## Video course
For more info, here's the full video:
https://joshuanussbaum.podia.com/build-a-saas-with-sveltekit## License
MIT