Home

Awesome

<p align="center"> <picture> <img width="420" alt="SaaS Starter Header reading: The open source, fast, and free to host SaaS template" src="https://github.com/CriticalMoments/CMSaasStarter/assets/848343/12f47617-e5be-4694-affc-23310e54b885"> </picture> </p> <p align="center"> <a href="https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/build.yml" target="_blank"><img src="https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/build.yml/badge.svg?branch=main" alt="Built Status"></a> <a href="https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/format.yml" target="_blank"><img src="https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/format.yml/badge.svg?branch=main" alt="Format Check"></a> <a href="https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/linting.yml" target="_blank"><img src="https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/linting.yml/badge.svg?branch=main" alt="Linting"></a> <a href="https://github.com/CriticalMoments/CMSaasStarter/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/License-MIT-brightgreen?labelColor=32383f" alt="License"></a> </p> <p align="center"> <a href="https://saasstarter.work"><strong>Demo & Homepage</strong></a> • <a href="https://github.com/CriticalMoments/CMSaasStarter#quick-start"><strong>Quick Start Guide</strong></a> • <a href="https://github.com/CriticalMoments/CMSaasStarter/issues"><strong>Issues</strong></a> </p> <br/>

SaaS Starter: A SvelteKit Boilerplate/Template

Created by the folks at Critical Moments! Check out our website site for an example deployment of SaaS Starter.

Make mobile apps? Improve conversion rates and ratings with Critical Moments.

Demo

You can explore all the features using our fully functional demo saasstarter.work.

Try it Now

See criticalmoments.io for an example of what’s possible after this template has design, content, and functionality added.

<a href="https://saasstarter.work"> <kbd> <img width="500" alt="homepage" src="https://github.com/CriticalMoments/CMSaasStarter/assets/848343/34944c09-df72-4ac2-9099-01d25d99911b"> </kbd> <br> <kbd> <img width="200" alt="pricing page" src="https://github.com/CriticalMoments/CMSaasStarter/assets/848343/c3cb2ab7-3739-473e-a1fe-f82a4a31e844"> </kbd><kbd> <img width="200" alt="settings page" src="https://github.com/CriticalMoments/CMSaasStarter/assets/848343/2d947c97-3cc7-4ff5-a5b1-7c8478b6f31a"> </kbd><kbd> <img width="200" alt="payments portal" src="https://github.com/CriticalMoments/CMSaasStarter/assets/848343/0c4749c3-0d29-4edc-ae87-d8a4eefea3c9"> </kbd> </a>

Features

Everything you need to get started for a SaaS company:

Introduction Blog Post

What to learn why we picked the technologies we did, and how to keep your fork lightning fast as you add content? Check out our blog post on the process. Yes, it's hosted on a SaaS Starter fork!

Tech Stack

Suggested Hosting Stack

There’s no cost for using this template. The costs below reflect our suggested hosting stack.

Performance / Best Practices

The selected tech stack creates lightning fast websites.

The result is a perfect Google PageSpeed Insights score in all categories!

<img width="420" alt="Screenshot 2024-01-18 at 11 31 32 AM" src="https://github.com/CriticalMoments/CMSaasStarter/assets/848343/46b5e960-2aa0-4fb5-acd7-4f84b380e1d0">

Quick Start

Create a Copy of the Template

To get started, create your own copy of the project for development. There are two options:

Setup Local Development

On your development machine:

git pull [Your Repo Created Above]
cd CMSaasStarter ## or your repo name if different
npm install
## Create an env file. You'll replace the values in this in later steps.
cp .env.example .env.local
## Run the project locally in dev mode, and launch the browser
npm run dev -- --open

Note: some features won't work until you complete the rest of the setup steps below!

Developer Tools

The repo includes CI scripts designed for GitHub Actions. These confirm you don’t break your build, you use proper code formatting, code linting and typechecking passes, and even spell checking.

Enabling GitHub Actions

Github disables CI on new forks by default, so be sure to go into the Github Actions page for your repo and enable workflows.

Running Developer Tools Locally

To manually run all these tools run the following script. You can view it's contents for individual commands.

# first time only: chmod +x ./checks.sh
./checks.sh

Running Developer Tools in your IDE

Installing extensions in your editor can automatically format-on-save, show linting/type issues inline, and run your test cases:

Running Developer Tools from Git Hooks

To catch build, formatting, linting and test issues before you commit changes, we suggest the following local git hook. It will run before you commit, stop you from breaking the build, and show any issues that are found. Add the lines below to an executable git hook script at the location .git/hooks/pre-commit.

#!/bin/sh
# Run standard checks before committing
cd "$(dirname "$0")"
sh ../../checks.sh

Disabling Developer Tools

If you find build, formatting or linting rules too tedious, you can disable enforcement by deleting the CI files (.github/workflows/*) and removing the git hook (.git/hooks/pre-commit).

Setup Supabase Project

Setup Stripe

Deploy

We have two documented options for deploying SaaS Starter: Cloudflare Pages and Vercel. However, it can be hosted anywhere you can host a SvelteKit app.

Our official demo is hosted on Cloudflare Pages, and deployed each time the main branch is updated.

Deploy To Cloudflare

Cloudflare Pages and Workers is one of the most popular options for deploying SvelteKit and we recommend it. Follow Cloudflare’s instructions to deploy in a few clicks. Be sure to select “SvelteKit” as framework, and the rest of the defaults will work.

When prompted: add environment variables for your production environment (PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY, PRIVATE_SUPABASE_SERVICE_ROLE, and PRIVATE_STRIPE_API_KEY).

Optional: enable Cloudflare Analytics for usage metrics.

Deploy to Vercel

Deploy using Vercel's deploy button:

Deploy with Vercel

Here is a demo of of Saas Starter hosted on Vercel: vercel.saasstarter.work

Deploy Alternatives

If you prefer another host you can explore alternatives:

Setup Emailer -- Optional

SaaS Starter includes email capabilities for sending emails to users and admins.

These are optional and disabled by default. See email docs for details on how to enable and customize them.

Add Your Content

After the steps above, you’ll have a working version like the demo page. However, it’s not branded, and doesn’t have your content. The following checklist helps you customize the template to make a SaaS homepage for your company.

Community Extensions

The open source community is extending and improving SaasStarter!

These extensions are reference implementations of commonly needed features. We don't integrate them into the main branch to keep our dependencies minimal and simplify maintenance. However, if you need them you can cherry pick into your fork/repo:

Icons Credits

Homescreen Icons are from Solar Broken Line Icons and Solar Linear Icons via CC Attribution License.

Sponsor

We hope you enjoy SaaS Starter! If you build mobile apps, please check out its sponsor/creator.

Kiln AI: Free apps and tools for building high quality AI products.