Developers November 23, 2020

The Tech Stack of a One-Man SaaS

Anthony @asimon
  1. 13

    I'm also a one man saas currently running a decently large distributed system. I echo a lot of what is said in this, but chose Pepsi over Coke:

    1. Ruby on Rails monolith
      I use Rails as my core framework

    2. Rails templating + Turbolinks + Stimulus whenever possible for frontend
      I am a strong opponent of single page applications, especially for soloists like myself. They really slow down your productivity, as you have to duplicate a lot of functionality (templating, routing, etc). I try to use the "Rails way" for my frontend whenever possible and am a big fan of their new library, Stimulus.js.

    3. React for the main app
      My product's main app is a pretty complex dashboard, so I use React here to handle it. Note that I only use React for this - I do not use it for my entire frontend.

    4. Sidekiq for job processing. Much of my product involves data harvesting, and I've found sidekiq to be really powerful for this. I've got dozens of sidekiq workers processing millions of jobs per day in parallel.

    5. Terraform + Amazon ECS for container management. This service allows me to run docker containers of all my core services (main app, sidekiq workers, redis, etc) in separate clusters. It's great because if something goes down, it automatically spins a replacement container up. Combined with Terraform, I can quickly add new resources and scale things up or down with a few keystrokes.

    6. Amazon Elasticsearch for searching. Rails has a great gem called "searchkick" that allows you to seamlessly pipe a model's data into elasticsearch.

    1. 4

      For the most part this is how I roll right here. I also agree with your thoughts on SPA. It's right for somethings but I think it is typically the exception, not the default.

    2. 4

      I really agree about your point re: SPAs, especially for a one-dev project. They add so much complexity in state management and dependencies. It’s just not worth it unless your application demands that kind of interactivity.

      1. 4

        That's exactly why I went with this "hybrid" model for Panelbear.

        The pages for signup/login/password-change/etc are just plain Django templates. Not much JS needed there.

        The dashboards are plain React with hooks for state management. There is no state management lib there.

        It's best of both worlds, without a complex custom setup.

        1. 1

          Same here. Standard Django with React sprinkled on a few of the pages in the dashboard. Zero fuss.

        2. 1

          Great minds think alike :)

          It's interesting, because from what I understand FB made React to function like this. They took a standard server-rendered app and sprinkled small React apps across it as needed, particularly on their ads platform. And then somewhere along the way it seemed like the whole community started pushing an SPA approach w/ React Router, Redux, etc... Every new startup I've come across in the bay seems to be doing things this way. I understand there are some pros to this approach, but they seem very minimal in comparison to the costs.

    3. 1

      Hi. I'd like to know a bit more about this stack as it sounds a bit like one I'm about to start building. I wonder if I could get your info to ask some advice

  2. 4

    I spent a lot of time researching the perfect tech stack for one-man saas as you. I decided on Svelte/Sapper on frontend and postgraphile for backend. I love this mix. If you want to get going as soon as possible, drop postgraphile and use hasura instead, it is better than firebase in my opinion

    1. 2

      I’m glad svelte is mentioned here! Such a great framework that simplifies much development with no cost to performance.

      1. 1

        With (massive) performance gains imo ;)

    2. 2

      Hasura looks pretty interesting! I've seen it recommended a few times before already. But I find the jump from 0 to $99 monthly between the free and standard tiers a bit steep for projects that are still in their early days!

      1. 2

        If i understand hasura right, it is opensource and completely free. You only have to pay them if you want them to manage the cloud servers for you
        https://github.com/hasura/graphql-engine

    3. 2

      How do you find working with svelte+graphql?

      1. 3

        I had some trouble getting apollo client working with sapper (should be no problems with svelte) https://github.com/timhall/svelte-apollo/issues/9

        So i just gave up on apollo client (which is kinda bloated anyway) and now i am just using fetch directly to /graphql and it is working beautifully

        This is my first time trying graphql and i'm loving it so far

    4. 2

      @bruhster, I’ve also been researching this—do you have anything written up about your research you can share?

      1. 2

        I don't have anything written up. Postgraphile is amazing if you are willing to learn sql and plpgsql for business logic, and willing to spend some time to get things set up with sapper etc. One problem with writing business logic in postgres is that the functions can become a bit unorganized, the best i've found is to have many schemas and use them like namespaces. You can get started with hasura really fast, thought it (might) have more problems long term than postgraphile, thought that is up for debate. Overall both postgraphile and hasura gives insanely fast api (faster than i could write), both can easily give 1000 req per second on a ok computer. They both also deliver an incredibly fast development experience, and they are both cheap af

        Some numbers, hasura:
        Hasura can process a large number of queries (1000 q/sec) in a tiny footprint of just 50MB RAM and importantly with low latency.
        https://hasura.io/blog/fast-graphql-execution-with-query-caching-prepared-statements/

        Some numbers, postgraphile:
        On a Digital Ocean compute-optimised droplet with 8GB of RAM, running PostGraphile, PostgreSQL and the benchmarking software all through Docker, PostGraphile running in cluster mode over 4 vCPUs can handle 3250 requests per second for the following simple query:

          allTracksList(first: 20) {
            trackId
            name
          }
        }
        

        https://www.graphile.org/postgraphile/performance/

        Svelte and sapper is a no brainer at this point. Blows gatsby, nextjs, react and vue out of the water

  3. 2

    I usually use plain PHP for the backend and HTML as the front-end (probably Javascript and some other well-built library by open source community). I just find using plain technology really fast at creating something rather than to use some kind of frameworks.

  4. 2

    Vanilla Rails + heroku. Anything else in the early days and you’re not prioritizing well enough IMO.

  5. 2

    I'm not super experienced with deployment or kubernetes, but for a one-man SaaS is there a little concern that there is a lot of going on for one man? I also should mention I'm mostly an experienced growth hacker and so I am very curious about Panelbear--What are the USPs of Panelbear vs other analytics platforms?

    1. 1

      Good questions!

      This stack actually removes a lot of overhead for me, I am already very familiar with it, and most of the stuff is automated. So I can focus on shipping features.

      I think the biggest operational effort right now is actually talking to customers, marketing, and onboarding. The tech stack is not really causing me problems :)

      Regarding the USP, I am not trying to "commit" to one yet, still talking with some customers to understand where I can really differentiate. It started as me scratching my own itch, and luckily it seems other people have found it interesting.

      It's my first, non-open source project, so learning a lot along the way.

      1. 2

        Yeah, sounds like you got the deployment down, espesecially if it is mostly automated.

        As far as Panelbear goes, yeah, I've used a big chunk of the analytics platforms out there. I can start to think about some of the gaps I've found in my decade of marketing and growth hacking.

        I do think the fact that it does not use cookies is a big value by the way!

  6. 2

    Some good ideas. I have a cookiecutter template I use for side projects and MVPs based on the Django stack with Tailwind and Turbolinks/StimulusJS for a minimal frontend - only a few of my projects need a full SPA and a more complicated infra than Heroku, so I try to keep things as simple as possible at the beginning.

    https://github.com/danjac/django-saas-starter

  7. 2

    Interesting, and maybe too complicated for me.

    Here is mine: https://blog.rubini.solutions/stack/ (I have multiple SaaS)

    1. 1

      Coming from an non-js background i found building web frontend a pure pain. React is a must tool for me.

  8. 2

    Awesome article. I also use Python (mostly Flask) for my projects. Reusing previously written modules helps a lot to speed up the development process.

  9. 1

    I also enjoy reading about tech stacks, especially in bootstrapped companies.

    Personally, I love Clojure and ClojureScript and it's 98% of the codebase for Wobaka.com (according to Github stats). Best thing about it is developer experience with hot reload that properly keeps state, immutability and that updating packages are so smooth I've yet to change any code for a major release.

  10. 1

    I mostly use React/NodeJs with serverless and dynamoDB

  11. 1

    How to handle authentication/authorization?

    1. 2

      Django includes this built-in, and also the popular allauth library can be used for more complex use cases.

  12. 1

    Interesting to see the comments here vs the ones over on Hacker News:
    https://news.ycombinator.com/item?id=25186342

    For myself, like others in the HN comments, I'd just go with Heroku on the backend. It costs a bit more, but (as the article mentioned), it just lets me get more real business logic done, faster. I also get much more reuse and never touch it after it's setup, basically. It's like having super powers, and is worth the extra $.

    I also stick with Rails for API rather than Django (did that for a couple of years but always felt better with Rails). On the frontend, I'm currently using SvelteJS+Sapper (soon to be Sveltekit) and don't think I could switch to something like React again. Svelte just seems so much faster to do anything.

    1. 1

      Is Heroku that good? I am not at all dev ops guy and am running on DO. It says you save a lot of time on dev-ops - like doing what? It takes minutes to spin up a server and install everything.

    2. 1

      I love the fact that it sparked so much discussion. It just goes to show that there is no "one-size-fits-all".

  13. 1

    Good article, bookmarked to read it in detail later. But out of curiosity, why didnt you check GCP or Azure for infrastructure ?

    1. 1

      Thanks! I use both AWS and GCP for my full time job, but I am more familiar with the Kubernetes offering from AWS.

      I guess it came down to using what I already know.

  14. 1

    This comment was deleted 2 months ago.

Recommended Posts