Skip to content

About

a template for self-hosting open saas on open ship

Resources

Stars

10 stars

Watchers

0 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

Repository files navigation

Open SaaS x OpenShip Template 🐝 🚢

You've decided to build a SaaS app with the Open SaaS x OpenShip template. Great choice!

This template is:

  1. fully open-source & free to use
  2. comes with a ton of features out of the box
  3. is pre-configured for instant OpenShip deployments

Warning

This is a special version of Open SaaS designed for instant OpenShip deployments.
Do not use Wasp's built-in deploy commands as it will interfere with your OpenShip setup.

Using this Open SaaS x OpenShip template

This template ships with a docker-compose.yml that defines three services — server, client, and db — built from the Dockerfiles in the openship/ directory. OpenShip reads that file and deploys the whole stack for you.

Initial Deployment

  1. Create a project in OpenShip and connect this repository (or your fork of it).
  2. OpenShip parses docker-compose.yml and creates the server, client, and db services for you.
  3. Expose the server and client services and assign each a public domain.
  4. Set the required environment variables (see the comments in docker-compose.yml):
    • On the server service: set WASP_SERVER_URL and REACT_APP_API_URL to the server's domain, WASP_WEB_CLIENT_URL to the client's domain, and a real JWT_SECRET (32+ random chars).
    • On the client service: set REACT_APP_API_URL to the server's domain. This value is baked into the client at build time, so set it before the client's first successful build.
  5. Deploy. On each push to main, OpenShip rebuilds and redeploys your services with zero downtime. 🚀

Note

The dummy payment/auth/analytics values in docker-compose.yml just let the server boot. Swap in real keys for the features you actually use.

Getting your copy of the template

Fork or clone this repository into your own GitHub account, then connect that repo to OpenShip:

git clone https://github.com/<your-user-name>/open-saas-openship.git

Now you can start building your SaaS app locally. When you push a new commit to main, OpenShip will automatically deploy your changes! 🚀

Local Development

1️⃣ Install the Wasp CLI:

npm i -g @wasp.sh/wasp-cli@latest

Read the Installation Instructions for more details (prerequisites, installing on Windows).

2️⃣ Start the app by reading the Getting Started Docs.

3️⃣ Although the app will run, you'll need to set up the integrations to get all its functionality. The Open SaaS Docs contain detailed guides on setting up:

  • Auth,
  • Payments,
  • Analytics,
  • Email Sending,
  • AI-assisted coding,
  • and more.

Warning

Remember that this version of Open SaaS is pre-configured for instant OpenShip deployments. Because of this, the deployment features via the Wasp CLI should not be used. Just simply push to main on your instance's GitHub repo and OpenShip will automatically deploy your changes!

What's inside?

Project Structure

This template consists of three main dirs:

  1. app - Your web app, built with Wasp.
  2. e2e-tests - Playwright tests for your Wasp web app.
  3. blog - Your blog / docs, built with Astro based on Starlight template.

The openship/ dir contains the Dockerfiles and Caddyfile used to build and serve the app on OpenShip, wired together by the root docker-compose.yml.

For more details, check READMEs of each respective directory!

The Tech Stack

The template itself is built on top of some very powerful tools and frameworks, including:

  • 🐝 Wasp - a full-stack React, NodeJS, Prisma framework with superpowers
  • 🚢 OpenShip - open-source deployment platform for instant, zero-downtime deploys
  • 🚀 Astro - Astro's lightweight "Starlight" template for documentation and blog
  • 💸 Stripe or Lemon Squeezy (with Polar.sh and Paddle coming soon!) - for products and payments
  • 💅 ShadCN UI - for components & styling (plus admin dashboard!)
  • 🤖 AI-Ready - full set of Cursor rules & llms-full.txt for ai-assisted coding
  • 📈 Plausible or Google Analytics
  • 🤖 OpenAI - OpenAI API w/ function calling example
  • 📦 AWS S3 - for file uploads
  • 📧 SendGrid, MailGun, or SMTP - for email sending
  • 🧪 Playwright - end-to-end tests with Playwright

Because we're using Wasp as the full-stack framework, we can leverage a lot of its features to build our SaaS in record time, including:

  • 🔐 Full-stack Authentication - Email verified + social Auth in a few lines of code.
  • ⛑ End-to-end Type Safety - Type your backend functions and get inferred types on the front-end automatically, without the need to install or configure any third-party libraries. Oh, and type-safe Links, too!
  • 🤖 Jobs - Run cron jobs in the background or set up queues simply by defining a function in the config file.
  • 🚀 One-command Deploy - Wasp can also deploy your DB, Server, & Client with one command to Railway or Fly.io via the CLI. Note that this template uses OpenShip instead — see the deployment section above.

You also get access to Wasp's diverse, helpful community if you get stuck or need help.

Getting Help & Providing Feedback

There are two ways to get help or provide feedback (and we try to always respond quickly!):

  1. Open an issue
  2. Wasp Discord -- please direct questions to the #🙋questions forum channel

About

a template for self-hosting open saas on open ship

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages