Published on

Make a SAAS app that serves user content at their own domains

Authors
  • avatar
    Name
    Chris
    Twitter

Introduction

Welcome to my review and tutorial of the Platform Start Kit - a starter kit with multi-tenancy and custom domain support. I investigated the Platforms Starter Kit while researching solutions for a client. I used it and it works for it's described purpose but requires significant work to develop the feature set that would accompany product visions needing this starter kit's out-of-the-box functionality.

As always, this information is for informational purposes only and is not intended to be advice of any kind. There's an inherent risk involved with decisions and the website owner will not be held liable for decisions others make.

Results

Platform Starter Kit

In late September, 2023, I attempted to use the deploy to Vercel feature on the starter kit's page. Ultimately, I abandoned the deployment, started locally and deployed successfully. There is a lot of features built into the solution. Ultimately, I removed the ones I didn't need and replaced them with ones I wanted. For example, I didn't want social authentication. So I updated NextAuth to use email authentication.

Summary

I used the Platform starter kit to create a SAAS app that allowed users to authenticate, create sites and add posts to them. It took a few days to get to this point, mostly because I was evaluating the starter kit at the same time. I spent another month of full time development implementing features to reach the first milestone of the client's vision. It would take another month or more of integrating features to reach the next milestone.

Steps

Step 1. Define the Product

  1. I spec'd the project with my client.

  2. As always, I survey solutions to meet less common features. The requirement of custom domains for end users led me to research the starter kit at https://vercel.com/templates/next.js/platforms-starter-kit.

  3. We looked at some of the other features that weren't part of my client's build spec. We planned to removed the features we didn't want and add the missinh ones we wanted.

Step 2. Install the Start Kit

  1. I tried to use the "Deploy" button on the starter kit page. I ran into issues so I installed it locally and deployed successfully.

Step 3. Swap features

  1. I found the starter kit had a lot of great technology and clean code. It uses Next.js, Prisma, Postgres and TailwindCSS follow good models and good authorization practices. I found some conflict between the AI content generator styles and the platform styles, which turned out to be a bug with the AI generator not restricting its styles to itself. The issue was already documented in GitHub.

  2. I removed features we didn't need. For example, I removed the AI writer because we didn't want it. I replaced social login to NextAuth's email login.

Step 4. Test features

  1. I was able create accounts, authenticate, add sites, assign domains and add posts to the sites quickly. The gave me a jump start on building the client's spec'd features.

Conclusion

This is a cool kit that provides SAAS projects with production-ready features that are ordinarily big obstacles to implement. Out of the box, this kit provides authentication, customer site creation at custom domains and customer blogging. It's easy to see so many ways this can be serve as the base of SAAS applications with greater features.

Of note, the 2 main features depend on single-option providers:

  • the multi-tenancy implementation depends on NextAuth, which depends on Next.js. It makes sense the developers used NextAuth because this is a Next.js solution. It's functionality could be replaced with another method, but would require some effort.
  • the sub and custom domain feature depends on Vercel's Domain API. This means it has to be served from Vercel. It makes sense the developers used Vercel's Domain API because it's turnkey. This functionlity could be replaced but that would require some effort.

Other considerations

  • The kit uses Vercel's blob storage for file storage. It makes sense the devs would use it because it's turnkey and the files being stored aren't sensitive. Vercel's blob storage stores files at obscure urls, but doesn't have access control, meaning anyone with the url can access the files. Another solution would probably be needed for sensitive files.

All in all, the Platform Starter Kit provides a SAAS solution that provides multi-tenancy and custom domains. It uses reasonable choices to provide these features and the user is free to replace any technology to meet their needs. The starter kit is easily extensible.

Support

Using this tutorial? Support this effort by becoming a sponsor.