Firebase, Supabase, and similar tools let a client talk to the database directly, with a security rules engine as the only gate between a request and the data. There’s no API layer and no server-side validation, only the browser and the vendor’s infrastructure. That’s a legitimate architecture. For the wrong kind of app it’s also a liability that stays hidden until someone opens a database client and reads things the UI never shows.
What decides it is not the size of the app. It’s how much of the access-control logic can be expressed as a declarative rule, and how much needs real code running somewhere.
What rules engines are and aren’t good at
A rules engine like Firestore’s evaluates a predicate against the request and the document being touched: is the requester authenticated, is the requester’s UID the same as a field on the document, is a field within some range. That’s enough for a lot of apps. What it can’t do:
- Rate limit beyond what a handful of requests-per-window primitives support
- Authorize based on a computation that spans more than the one document being read or written
- Transform or validate data before it’s considered trusted (a rule can reject a bad value, it can’t clean one up)
- Coordinate a write that touches two different owners’ data where each owner should only be trusted with their own side
If an app’s access control fits entirely in those per-document predicates, “no backend” is simply correct. A server that re-implements the same rule in application code adds a deploy target and a second copy of the rule that can drift from the rules file, with no added security. If the access control needs anything on that list, “no backend” doesn’t fail loudly. It quietly exposes whatever the rules engine couldn’t express, until someone finds the gap.
A rules file that made this trade and says so
sd-tracker is a study-streak tracker: log a topic and a resource, watch a heatmap fill in, follow other people and see their streaks. It has no API routes and no server-side validation. The Next.js frontend talks to Firestore directly through the client SDK, and the entire access-control surface is this rules file:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{uid} {
allow read: if true;
allow write: if request.auth != null;
}
match /usernames/{username} {
allow read: if true;
allow write: if request.auth != null;
}
match /entries/{id} {
allow read: if true;
allow write: if request.auth != null;
}
match /following/{uid}/{document=**} {
allow read: if request.auth != null;
allow write: if request.auth.uid == uid;
}
match /followers/{uid}/{document=**} {
allow read: if request.auth != null;
allow write: if true;
}
}
}
Two lines matter here. entries allows read: if true, so anyone with a Firestore client, not just people using the app’s UI, can read every study entry in the collection. And followers/{uid} allows write: if true for anyone, not only the follower themselves, because the follow action needs to write into both the follower’s following subcollection and the target’s followers subcollection in a single client-side batch, and a rules predicate can’t express “the other party in this two-sided write consented to it.” Firestore rules evaluate one document at a time; they have no concept of a transaction’s other half.
From the project’s README: “
users,usernames, andentriesare readable by anyone with a Firestore client, not just through the app UI. It also means entry content (topic + resource text, not just the heatmap) is public for every account.”
This is the list above in practice. Authorizing “only the two consenting parties in a follow relationship” and “only the entry’s owner, unless they opt in” both need logic that spans more than one document, which a rules predicate can’t hold. There’s no bug; the rules file does what it was written to do. The cost is that the feature it enables (a public heatmap, a follow graph, both without a server) came bundled with entry content being public too, because the rules engine had no way to split “public heatmap” from “private content” without a second document and a second rule to go with it.
The data model didn’t have to know any of this
The entry shape predates the decision to use Firestore at all; it’s unchanged from when the app was localStorage-only:
// src/lib/firestore.ts
export interface StudyEntry {
id: string;
topic: string;
resource: string;
date: string;
createdAt: number;
userId: string;
}
Queries filter by userId and order by createdAt, which needs a composite index that Firestore won’t build automatically. With no server to own the query plan, that requirement surfaces directly to whoever’s running the app for the first time: Firestore returns an error with a link to create the index, rather than a backend catching it earlier in a migration step. That’s a minor, non-security cost of having no backend, with the same pattern: work a server would normally absorb shows up at the edge, for whoever hits it first.
The same decision, compared directly
| Concern | With a backend | No backend (Firestore rules only) |
|---|---|---|
| Access control | Application code, testable in isolation | Declarative predicates, one document at a time |
| Cross-document authorization | Straightforward | Not expressible; falls back to if true or gets pushed elsewhere |
| Ops burden | A server to deploy, monitor, scale | None beyond the client and the vendor |
| Failure mode of a mistake | A bug in a route handler | A gap in a rules file, harder to unit test, easier to miss |
For sd-tracker, the worst case of the current rules file is a stranger finding out someone studied “Consistent Hashing” on a Tuesday. That’s a fine trade for a study tracker with no server to run. If it stopped being fine, the fix is a schema change, not a new architecture: split entry metadata (date and count, which the heatmap needs) from entry content (topic and resource, which don’t need to be public) into separate documents with separate rules, so the heatmap stays public while the content defaults to private. The rules engine can express that split once the data is modeled to match what it can say.
So before choosing “no backend”, check whether every access-control decision the app needs can be written as a predicate over one document at a time. If so, skipping the server removes a deploy target for free. If not, the missing logic ends up in a rules file that can’t hold it.