Warning: this project is in beta. Design, workflows, and user accounts are subject to change.
Deno SaaSKit is an open-sourced, highly performant template for building your SaaS quickly and easily.
- No build step
- Deno's built-in formatter, linter and test runner and TypeScript support.
- User authentication with Supabase Auth, including email/password and OAuth flows.
- Session management
- Database management with Supabase Database and Row-Level Security (RLS).
- Billing management with Stripe.
- Fresh as the web framework and Tailwind CSS as the CSS framework.
Want to know where Deno SaaSKit is headed? Check out our roadmap.
- Clone the repo:
git clone https://github.com/denoland/saaskit.git
cd saaskit
- Create a
.env
file to store environmental variables:
cp .example.env .env
The values of these environmental variables will be gathered in the following steps.
- While Docker is running, start the Supabase services:
supabase start
This will automatically configure the database tables and their settings for us.
- Copy the values of the printed Supabase
API URL
,anon key
, andservice_role key
variables into the environmental variables in your.env
file asSUPABASE_URL
,SUPABASE_ANON_KEY
, andSUPABASE_SERVICE_KEY
, respectively.
- Copy your Stripe secret key as
STRIPE_SECRET_KEY
into your.env
file. We recommend using the test key for your development environment. - Run
deno task init:stripe
and follow the instructions. This automatically creates your "Premium tier" product and configures the Stripe customer portal.
Note: go to tools/init_stripe.ts if you'd like to learn more about how the
init:stripe
task works.
- Listen locally to Stripe events:
stripe listen --forward-to localhost:8000/api/subscription
- Copy the webhook signing secret to .env as
STRIPE_WEBHOOK_SECRET
.
Finally, start the server by running:
deno task start
Go to http://localhost:8000 to begin playing with your new SaaS app.
Note: You can use Stripe's test credit cards to make test payments while in Stripe's test mode.
The utils/constants.ts file includes global values used across various aspects of the codebase. Update these values according to your needs.
To create a new blog post, create a Markdown (.md
) file within
/data/posts/
with the filename as the slug. E.g.
/data/blog/hello-there.md
will correspond to the /blog/hello-there
route.
See /data/posts/
for examples.
Post properties are to be added to the starting Front Matter section of the
Markdown file. See the Post
interface in /utils/posts.ts
for a full list of properties and their types.
You can customize theme options such as spacing, color, etc. By default, Deno
SaaSKit comes with primary
and secondary
colors predefined within
twind.config.ts
. Change these values to match your desired color scheme.
TODO
Set up your branding on Stripe, as the user will be taken to Stripe's checkout page when they upgrade.
Keep your customers
database up to date with billing changes by
registering a webhook endpoint in Stripe.
- Endpoint URL:
https://{{ YOUR DOMAIN }}/api/subscription
- Listen to
Events on your account
- Select
customer.subscription.created
andcustomer.subscription.deleted
TODO
TODO
When submitting a pull request, please:
- Follow the Deno Style Guide.
- Include tests for any added functionality.
- Ensure
deno task test
passes successfully.
For the user, the website should be fast, secure and have a design with clear intent. Additionally, the HTML should be well-structured and indexable by search engines. The defining metrics for these goals are:
- A perfect PageSpeed Insights score.
- Fully valid HTML, as measured by W3C's Markup Validation Service.
For the developer, the codebase should minimize the steps and amount of time required to get up and running. From there, customization and extension of the web app should be simple. The characteristics of a well-written codebase also apply, such as:
- Easy to understand
- Modular functionality
- Clearly defined behavior with validation through tests
Join
the #saaskit
channel in Deno's Discord
to meet other SaaSKit developers, ask questions, and get unblocked.
Here's a list of articles, how to guides, and videos about SaaSKit: