MongoDB SaaS Boilerplate: Build Fast Without Forcing Yourself Into SQL
Touseef Ibn Khaleel
Indie Hacker
Why Most SaaS Boilerplates Chose PostgreSQL (And Why That Wasn't Inevitable)
Open any popular SaaS boilerplate today and you'll find the same database underneath: PostgreSQL. ShipFast uses MongoDB (a notable exception), but MakerKit, Supastarter, LaunchKit, and most others are built on Postgres — often via Supabase, which bundles Postgres with auth and storage under one managed service.
Postgres is excellent software. The choice made sense for boilerplate authors: Postgres has strong tooling, SQL is familiar, and Supabase made it trivially easy to add Postgres to a Next.js project.
But that convenience came with a cost: it assumed your product fits a relational schema. And for a large class of real-world SaaS products — especially the kind built by indie hackers and early-stage founders — that assumption doesn't hold.
ShipQuick is a MongoDB SaaS boilerplate. It's a deliberate choice, grounded in what real products look like in the early months of development.
The Problem With Forcing a Relational Model on Early-Stage Products
SQL databases reward stable, well-understood data shapes. You define a schema up front, you write migrations, and your queries are optimized against that structure. When your data model is right, this is a powerful discipline.
When your data model is wrong — which it is, repeatedly, in the first six months of a SaaS product — it's a constraint that slows you down.
Here's what schema evolution looks like in practice on a Postgres-backed boilerplate:
- You add a new field to your user model
- You write a migration
- You run the migration against your local database
- You run it against staging
- You update your TypeScript types
- You update the ORM models (Drizzle, Prisma, or Sequelize, depending on the boilerplate)
- You deploy
This is not extreme complexity. But it's friction. And you repeat it every time your product's data requirements change — which, in month two of a new SaaS, is often.
MongoDB's document model means you change your TypeScript interface, update your Mongoose schema definition (optional for adding fields), and ship. The migration step is frequently unnecessary for field additions.
What MongoDB's Document Model Gets Right for SaaS Products
Flexible Schemas for Evolving Products
The feature set of an early-stage SaaS changes week to week. Users request things you didn't plan for. You discover that the data you thought you needed in separate tables actually belongs together. You add a metadata field that can hold different shapes depending on the subscription tier.
MongoDB's document model accommodates this naturally. You're not storing rows in tables — you're storing documents in collections. A user document can have a preferences sub-document with a different shape for each user, and that's not a problem. You can embed related data directly in a document (a user's recent activity log, for example) instead of maintaining a join table.
This is especially powerful for products that model anything domain-specific: a habit tracker, a communication analyzer, a spiritual companion app. Real-world domains rarely fit clean third-normal-form relational schemas without contortion.
No ORM Learning Curve
Every Postgres boilerplate ships with an ORM: Drizzle, Prisma, or Sequelize are the most common. These are excellent tools, but they're also things you have to learn.
- Drizzle's query builder has its own mental model
- Prisma has its own schema language and code generation step
- Both have edge cases around transactions, relations, and migrations that require study
Mongoose — the MongoDB object modeling library ShipQuick uses — is straightforward. You define a schema, you get a model, and you call .find(), .create(), .updateOne(), and .deleteOne(). The API maps naturally to how most developers think about data operations. If you've used any query builder before, Mongoose clicks within an hour.
This isn't a knock on Drizzle or Prisma — they're excellent for what they do. It's a recognition that an ORM is an additional abstraction layer, and fewer abstraction layers means fewer things to debug at 2am when your authentication flow breaks.
MongoDB Atlas: A Free Tier That Actually Scales
MongoDB Atlas — the managed cloud offering — has a free tier (M0) that's genuinely usable for early development and low-traffic production deployments. When you outgrow it, upgrading to M10 ($57/month) gives you a dedicated cluster with better performance and reliability.
Crucially, you're not locked into Atlas. The same Mongoose code that connects to Atlas connects to:
- A self-hosted MongoDB instance on any VPS
- MongoDB running in a Docker container locally
- MongoDB on Railway, Render, or any container hosting provider
The connection string changes. Nothing else does.
ShipQuick's MongoDB Architecture: What's Pre-Built
ShipQuick ships with MongoDB models, connection handling, and TypeScript types pre-configured for the data every SaaS product needs.
User Model
The User model includes fields for Better Auth's session management, email verification, OAuth account linking, and subscription status. It's designed to work directly with Polar's webhook events, so subscription state updates (active, canceled, past_due) are reflected in the user document automatically.
// Simplified representation of the pre-built User model
{
email: string,
name: string,
emailVerified: boolean,
image?: string,
subscriptionStatus: 'free' | 'active' | 'canceled' | 'past_due',
subscriptionId?: string,
polarCustomerId?: string,
createdAt: Date,
updatedAt: Date
}
Session and Account Models
Better Auth stores sessions and OAuth account links in MongoDB. ShipQuick pre-configures the MongoDB adapter for Better Auth so session management works out of the box — no manual schema setup, no migration to run.
Connection Management
ShipQuick handles MongoDB connection pooling correctly for serverless environments. The connection singleton pattern prevents connection exhaustion during development hot reloads and ensures efficient connection reuse in production.
Real Products Built on ShipQuick's MongoDB Stack
The case for MongoDB isn't theoretical. Here are real products that run on ShipQuick's MongoDB-backed architecture:
Deen — An Islamic operating system for daily life. Prayer tracking, Quran study, and daily reflection. MongoDB's document model stores each user's prayer ledger, learning progress, and personal reflection history as nested documents on the user record — no join tables needed. This makes per-user data retrieval a single document fetch.
Proofly — A video testimonial platform. Testimonials are documents with variable structure: some have video URLs, some have Twitter import metadata, some have prompt responses. MongoDB's flexible schema handles this naturally without nullable columns across a fixed relational schema.
Thynq — An AI communication coach. Communication analysis results are semi-structured data — each analysis has different detected patterns, different severity scores, different suggestion sets. Storing this as embedded documents in MongoDB is straightforward. Flattening it into SQL tables would require either JSON columns (defeating the purpose of SQL) or a normalized schema that's painful to query.
MongoDB vs Supabase/Postgres: The Honest Comparison
Supabase is a strong product. If your team has deep SQL expertise, if your data is genuinely relational, or if you want Row-Level Security for fine-grained access control, Postgres via Supabase is worth serious consideration.
But understand the trade-offs you're accepting:
| Concern | MongoDB (ShipQuick) | Postgres / Supabase |
|---|---|---|
| Schema evolution | Flexible, migration-optional | Requires migrations |
| ORM | Mongoose (simple API) | Drizzle / Prisma (more learning) |
| Self-hosting | Trivial (any Docker host) | Possible but more complex |
| Free tier | Atlas M0 (genuinely usable) | Supabase free (limited compute) |
| Vendor lock-in | Low | Medium (especially with Supabase Auth + RLS) |
| Real-time features | MongoDB Change Streams | Supabase Realtime |
| Best for | Document-centric, evolving data | Relational, stable schema data |
See the ShipQuick vs Supastarter comparison for a deeper look at the Supabase lock-in problem.
When MongoDB Is the Right Choice for Your SaaS
MongoDB is a strong default for products that:
- Store user-specific content — notes, activities, logs, preferences — that varies in structure per user
- Iterate rapidly on data models — you're adding and changing fields weekly, not annually
- Want to avoid ORM complexity — Mongoose's API is approachable, especially for developers already comfortable with JavaScript objects
- Need a flexible free tier to validate before scaling infrastructure costs
- Prefer self-hosting as an option, without restructuring the entire application
MongoDB is not the right choice if your product's core value is complex relational queries across many entities — a financial reporting tool, an analytics platform, or anything that fundamentally requires joins across dozens of normalized tables. Those products benefit from Postgres.
But most early-stage SaaS products are not those products.
Getting Started With ShipQuick's MongoDB Boilerplate
ShipQuick is production-ready out of the box. To get from zero to a running MongoDB-backed SaaS:
- Purchase at shipquick.app
- Clone the repository
- Set your
MONGODB_URIin.env.local(pointing to Atlas or a local instance) - Run
pnpm install && pnpm dev - Your user model, session management, and subscription tracking are already wired up
The documentation covers every MongoDB configuration option, including connection string formats, Atlas network access configuration, and the recommended Atlas tier for different traffic levels.
No Drizzle schemas to define. No Prisma migrations to run. Connect your MongoDB URI and you're developing.
For a comparison of how ShipQuick's MongoDB stack compares to competitors using Supabase, see ShipQuick vs MakerKit and ShipQuick vs Supastarter.
Share this article
Newsletter
Get the latest updates and articles directly in your inbox.