![Saas cookbook](/_next/image?url=%2Fimages%2Fdall-e-2024-07-15-08.39.16---a-creative-and-colorful-illustration-for-a-blog-post-titled--saas-cookbook-.-the-scene-should-depict-a-kitchen-with-a-chef-cooking--but-instead-of-foo-U0Mj.webp&w=3840&q=75)
Saas cookbook
I enjoy doing open source side projects and thought I'll try to document the different pieces needed to get a Saas service up and running. The scope of the this projects it to make a service that either can be self hosted or to used as a service. This can of course be solved in many ways, but this is my favourite tools for now.
This is a list or the different components needed:
- Website for the project with documentation.
- Api and database hosting.
- Admin dashboard for the managing the service.
- Npm library for importing the service into a project.
- Npm library for creating a new project
Website
The website is typically pretty static so any of the open source static site generators like docusaurus, vitepress or nextra work just fine. I think it's a bit of a hassle to edit the md-files directly though, so my personal favourite is Outstatic which feels more like a classic CMS but with the simplicity of a SSG.
Outstatic is a newer player in the field and does lack some features that are bundled in some of the other solutions, like search, but I think it should be fairly easy to add.
Anything web is really easy to host with Vercel for free, but it will start to cost quite a bit if the team grows. I also recently realized that that the free plan on vercel doesn't allow the use of github organizations which is a pity. I'm planning on trying out CloudFlare Pages as an alternative to Vercel which should be almost as easy and likely much cheaper over time.
Api and database hosting
Now, this is really a personal preference and it depends a lot on what you're used to using. My current favourite javascript/typescript stack is:
- Hono router with zod/openapi. I really like hono as it uses the web standards as far as possible. It runs on any runtime like for instance CloudFlare workers, AWS lambda or docker with bun. The zod/openapi makes it easy to have runtime validated type that also generates your documentation. Fantastic!
- Sqlite with drizzle for storage.