For beginners

Build a SaaS MVP in a weekend with Go and React

A weekend is enough for a SaaS that takes money, if you spend it on the right things. Most weekend attempts fail on Saturday afternoon, rebuilding authentication, and never reach the part that makes the product worth anything.

This is a plan with an order. The order matters more than the speed: two decisions here are cheap now and very expensive in three months, and both are made before lunch on Saturday.

18 min read. Commands and output last run against Grit v3.560.0.

What you will have at the end

A deployed multi-tenant application with sign-up, a subscription, and one feature that does something worth paying for.

The two irreversible decisions made deliberately rather than discovered later: tenancy and the billing model.

A list of what you deliberately did not build, which is most of the plan.

Three rules for the weekend

  • One feature. Not a platform. The thing somebody would pay for, working, and nothing beside it. If you cannot say it in one sentence, you are not ready to start building.
  • Nothing bespoke that exists already. Auth, billing, email and file uploads are solved. Building them is how the weekend disappears, and yours will be worse.
  • Deploy on Saturday night, not Sunday evening. A thing that is not deployed is not finished, and discovering a deployment problem with two hours left is how a weekend produces nothing.

The two decisions to make before writing anything

1. What is a tenant, and is it a person or an organisation?

This is the decision that is nearly impossible to reverse. If accounts belong to individual users, and in six months a customer asks to add three colleagues, you are retrofitting an organisation layer through every query, every permission check and every billing record in the system.

Build organisations from the start, even with one member each. A user belongs to an organisation, data belongs to the organisation, and the subscription belongs to the organisation. The cost today is one extra table and one extra column. The cost later is a migration you will put off until it is a quarter of work.

type Organisation struct {
ID uint `gorm:"primaryKey"`
Name string `gorm:"not null"`
Plan string `gorm:"not null;default:'free'"`
}
type User struct {
ID uint `gorm:"primaryKey"`
OrganisationID uint `gorm:"index;not null"` // never nullable
Email string `gorm:"uniqueIndex;not null"`
Role string `gorm:"not null;default:'owner'"`
}
// And on everything else you store:
type Project struct {
ID uint `gorm:"primaryKey"`
OrganisationID uint `gorm:"index;not null"`
Name string
}

The scope goes in the query, from the first query

Every read and every write is scoped to the organisation, in the WHERE clause rather than in a check afterwards. Add it later and you will miss one, and the one you miss is a customer seeing another customer's data, which ends the business you spent the weekend starting.

db.Where("organisation_id = ?", orgID).Find(&projects)
db.Where("id = ? AND organisation_id = ?", id, orgID).First(&project)

2. What are you charging for?

Per seat, per usage, or a flat tier. Decide now, because it determines what you must count from the first write, and counting retroactively is impossible: the events are gone.

  • Flat tiers are the simplest to build and the simplest to explain. Start here unless you have a reason.
  • Per seat needs a member count and a webhook that updates the subscription quantity when it changes.
  • Per usage needs a usage table from day one, written in the same transaction as the work. Add it later and your first invoices are guesses.

01Saturday morning: the foundation

Two hours, and nothing in it is specific to your product. This is exactly the part worth not writing by hand.

Terminal
$grit new myapp
$cd myapp
$docker compose up -d # Postgres, Redis, MinIO, Mailhog
$grit plugin add multitenant # organisations, membership, scoped queries
$grit migrate
$grit seed
$grit start

You now have sign-up, sign-in, password reset, email verification, sessions with per-device revoke, an admin panel and organisation scoping. Running, on your machine, before coffee.

Checkpoint. Register two accounts in two different browsers, create something in each, and confirm neither can see the other's. That is the isolation test, and it is the only one that matters today. Repeat it on Sunday after you have written your own endpoints.

If you would rather assemble it yourself

The same two hours by hand is a Gin project, GORM, bcrypt, a JWT library, refresh token rotation, an email provider, a compose file and the organisation model. Each step is covered in these guides, and the point of the plan stands either way: this is foundation work that is identical in every SaaS, and the weekend should be spent elsewhere.

02Saturday midday: your one feature

The part only you can write. Model it as a resource, generate the scaffolding, then spend your time on the logic that is actually yours.

Terminal
$grit generate resource Project \
--fields "name:string:required,status:select[active, paused, done],due:date,notes:text" \
--owned-by organisation

That gives you the model, the API with pagination and filtering, the TypeScript types, the React hooks and an admin screen, all scoped to the organisation. The hours you have left go on the behaviour that makes somebody pay: the calculation, the integration, the thing nobody else does.

Resist adding the second feature. A product with one feature that works is sellable; a product with three half-features is a demo.

03Saturday afternoon: billing

Two hours, and most of it is the webhook rather than the checkout.

Terminal
$grit plugin add stripe
  • Checkout. Use the hosted page. Card fields on your own domain mean a compliance conversation you do not want on day one.
  • The webhook is the source of truth. Not the redirect back from checkout, which the user can close, refresh or never reach. Payment state changes when Stripe says so.
  • Verify the signature, with a constant-time compare, and store the event id so a redelivery is ignored rather than processed twice. Stripe retries, and it will deliver the same event more than once.
  • Enforce the plan in the API, not in the interface. A limit that lives in a React component is a limit anybody can skip with curl.
func (s *BillingService) Allow(ctx context.Context, orgID uint, feature string) error {
org, err := s.orgs.ByID(ctx, orgID)
if err != nil {
return fmt.Errorf("load org: %w", err)
}
// The check is here, in the service, so every caller gets it: the
// API, the admin, a scheduled job and whatever you add next month.
if !plans[org.Plan].Includes(feature) {
return ErrPlanRequired
}
return nil
}

Use Stripe's test mode and their CLI to replay webhooks at your local machine. You can exercise the entire subscription lifecycle, including cancellation and failed payment, without a real card.

04Saturday evening: deploy

Before you are tired, and before anything depends on it. A deploy that works tonight is a deploy you can repeat on Sunday without thinking.

Terminal
$grit deploy --host myapp.com
  • A real domain, with HTTPS. A product on an IP address does not get signed up to.
  • A sending domain for email, with SPF and DKIM configured. Without them your welcome email goes to spam and you conclude nobody wanted the product.
  • Error reporting switched on, so Sunday's crashes are visible rather than anecdotal.
  • A database backup, taken and restored once to confirm it is real.

05Sunday morning: the landing page

Nobody signs up to an application. They sign up to a promise, and the landing page is the promise. Give it real hours; it is not decoration.

  • One sentence saying what it does, for somebody who has never heard of you. Not what it is built with, not your mission.
  • A screenshot of the actual product. Real screens, with plausible data. People look at the picture before they read anything.
  • Three benefits, in the customer's words, taken from how they describe the problem rather than how you describe the solution.
  • Prices, visible. "Contact us" at this stage means nobody contacts you.
  • One call to action, repeated. Not four competing ones.

Never invent a number

No fabricated user counts, no invented testimonials, no logos of companies that are not customers. It is the one mistake on a landing page that is not a matter of taste: it is a claim the business has to stand behind, and it is the first thing a sharp visitor checks. Leave the social proof section out until you have some.

06Sunday afternoon: the things that lose customers

Not features. These are the gaps that make a working product feel unfinished, and each is under an hour.

  • The empty state for a new account. The first screen every single customer sees, and usually the last one anybody designs. It should say what to do first, with a button that does it.
  • The welcome email. Sent, arriving, not in spam, and saying one useful thing rather than "thanks for signing up".
  • Error states that are honest. "Something went wrong" with no next step is worse than the error.
  • A way to contact you, visible. One email address is enough.
  • Working cancellation. People check before they subscribe, and a subscription you cannot cancel is a chargeback.
  • Mobile. Open every screen at 375 pixels. Half your first visitors arrive on a phone, from a link somebody sent them.

What to deliberately not build

Each of these is a day, and none changes whether the first ten customers appear.

  • Social login. Email and password is fine. Add Google when somebody asks.
  • A roles and permissions system. Owner and member is enough for an organisation of one to five.
  • An onboarding tour. A good empty state does more, in a tenth of the time.
  • Dark mode, unless it comes free with what you are using.
  • An analytics dashboard for customers who have no data yet.
  • A public API, before anybody has asked for one.
  • Kubernetes. One server. One.

The test for a feature this weekend

Would its absence stop somebody paying? If no, it is next weekend's work. Almost everything fails that test, which is why the plan fits in two days.

Monday

The weekend produced a product. It has not produced a customer, and the next bit is harder than the building was.

  • Show it to ten people who have the problem. Not developers, unless developers are the customer. Watch them use it without helping, which is uncomfortable and is where the real list comes from.
  • Charge from the first customer. A free product tells you nothing about whether it is worth money, and converting free users later is a different and harder product.
  • Fix the three things everybody trips over before building the fourth feature.

Frequently asked questions

Is a weekend realistic?
For a focused product with one feature, yes, if you do not build authentication, billing or a tenancy model from scratch. People who fail at this spend Saturday on login and Sunday on deployment, and never reach the feature. The weekend is realistic precisely because most of what a SaaS needs is identical in every SaaS.
Organisations or individual user accounts?
Organisations, always, even when every organisation has one member. Retrofitting a tenancy layer means touching every query, every permission check and every billing record in the system. Building it on day one costs one table and one column.
How do I keep one customer from seeing another customer’s data?
Put the organisation id in the WHERE clause of every query rather than checking after the fetch, so a row outside the scope cannot be returned at all. Then test it: two accounts, two browsers, and an attempt to reach the other's records by id. Run that test again whenever you add an endpoint, especially an export or a bulk action, which are the ones that get written without the scope.
Should the MVP be free to start with?
Charge from the first customer. A free product measures curiosity, not demand, and the feedback from people paying nothing is systematically different from the feedback from people paying. A free trial with a card up front is fine; free forever is a different product, and a harder one.

Next steps