Today I’m starting a series of posts about my journey to build a SaaS with Rust. I have an idea for a service that would satisfy a particular interest that I have and I’ve decided to start building it. I may talk more about that later or just wait until I can launch it.

In the meantime this series is about building the generic SaaS parts in Rust and how all of those things come together. I hope that someday that can be used as a boilerplate/kit buy others to start their own SaaS using Rust.

But before we even get started what are some things we’ll want?

  • The ability to take payments through subscriptions with third-party providers
  • Email provider integration for sending newsletters, account sign-ups, recoveries, password resets, etc.
  • Built-in database support
  • User management and some sort of authentication/authorization scheme (probably RBAC)
  • Integrated API session management using something like OAuth, etc.

This is obviously just a very short list to get us started.

I’ve chosen to use the very cool loco-rs as my framework to build around. It’s Ruby on Rails inspired, looks excellent and I expect it to be a force to be recokened with.

I am using the loco-cli built from source at this commit 406bb96847b6c53020050d3ec0f7d8190c852dca. I initially used the version installed with cargo (v0.1.9) but found some behavior did not work as expected so I switched to building it from source for now.

We’re going to use the SaaS generated app starting point with Loco. I’ve created a repo here for this purpose.

While the Saas generated app is a great starting point with authenticated endpoints using JWT I don’t think that will suffice for our needs. And since user auth and management is such and important part I think it’s useful to focus on that first.

The first thing I’m going to check out for this purpose is integrating something like Casdoor for this. As we go we’ll also build up a dev stack using docker compose. This won’t be a production deployment but will serve us to make it easy as we build out and test our stack.

Stay tuned!