00 — Why This Layer Exists
You are not going to hand-build a database schema or wire up OAuth tokens. That is the point of the last four layers — you now know how to brief an AI tool, pick a builder, and get something running. This layer is different: it's not a skill, it's literacy. When your AI coding tool says "I added a backend endpoint but the database migration failed," you need to know enough to ask the right follow-up question instead of pasting the error back and hoping. When it proposes "let's use Clerk for auth," you need to know what that decision commits you to. This layer gives you the five nouns — frontend, backend, database, auth, payments — and enough real texture on each that you can direct the work and sanity-check the output, without ever opening a code editor yourself.
01 — Frontend vs. Backend, With a Real Example
Every web app splits into two halves that run in two different places.
The frontend is what runs in the user's browser (or phone screen). It's the buttons, forms, layouts, colors, and animations — everything the user sees and clicks. It's built with HTML, CSS, and JavaScript (often via a framework like React or Next.js, which you don't need to understand beyond the name). The frontend's job is presentation and interaction.
The backend is code that runs on a server somewhere else — not on the user's device. It handles logic that shouldn't be visible or trustable in the browser: checking passwords, charging credit cards, deciding who's allowed to see what data, talking to other services. The backend usually exposes an API (a defined set of "doors" the frontend can knock on to ask for or send data — more on this in Section 06).
Concrete example: a "Save Note" button in a notes app.
- User types a note and clicks "Save." That's frontend — it captured the text and the click.
- The frontend sends the note's text to the backend, via an API call — essentially a structured message: "here's a note, please save it, and here's who I am."
- The backend checks: is this user actually logged in? Is the note under some size limit? Is this user allowed to create more notes on their current plan? That's business logic — it lives on the backend because a user could otherwise edit the frontend code in their own browser and lie about who they are or what plan they're on.
- The backend writes the note into the database (Section 02) and sends back a confirmation.
- The frontend updates the screen to show "Saved."
If an AI tool tells you "the frontend renders fine but the backend is throwing a 500 error," it means: the buttons and screen work, but the server-side logic — the part deciding whether to actually save your note — is crashing. That's a different problem, in a different place, than a button that doesn't visually respond to a click.
02 — What a Database Schema Actually Is
A database is where your app's data lives permanently — users, notes, orders, subscriptions — structured so it can be found and updated reliably. Most SaaS apps use a relational database (Postgres is the dominant default AI tools reach for today), which organizes data into tables — think of each table as a spreadsheet tab.
A schema is the blueprint for those tables: what columns exist, what type of data goes in each column, and how tables relate to each other. For a notes app, the schema might say:
- A
userstable:id,email,created_at - A
notestable:id,user_id(which links back to a row inusers),text,created_at
That link — notes.user_id pointing at users.id — is called a relationship (or foreign key), and it's how the database knows which notes belong to which person. This is why AI tools ask (or should ask) "what does a user need to store, and how does it connect to what else?" before writing any code — the schema is the foundation everything else sits on. Changing it later (adding a column, splitting a table) is called a migration, and it's one of the riskier things an AI tool can do to a live app, because it touches real, already-saved data. When an AI proposes a schema change, it's worth asking: "does this affect existing data, or only new data going forward?"
03 — Authentication: Why You Almost Never Build Your Own
Authentication ("auth") is how an app confirms who a user is — login, signup, password reset, "sign in with Google," session management, multi-factor codes. It sounds simple. It is not. Auth touches password storage (get it wrong and you leak every user's credentials), session security, token expiry, social login protocols (OAuth), email verification, and increasingly compliance requirements. A single subtle mistake here isn't a bug — it's a breach.
Because of that, the near-universal advice — from senior engineers and AI coding tools alike — is: use a managed auth provider, don't roll your own. These are companies or open-source libraries that specialize entirely in this problem, get it audited, and hand you a tested integration instead of you (or your AI) reinventing password hashing from scratch.
As of late 2026, this space has consolidated somewhat. Clerk remains a popular drop-in, fully-hosted option, especially for teams that want auth to "just work" with minimal setup. Supabase Auth is the default if you're already using Supabase as your database/backend platform — it comes bundled. Auth.js (formerly NextAuth) remains the standard open-source library for developers who want auth code that lives inside their own app rather than a third-party's hosted UI. And notably, Vercel acquired Better Auth in 2026 — a newer open-source auth framework — signaling it's becoming a default option for teams already building on Vercel's platform (the company behind Next.js). None of this is a call you need to make unassisted: an AI tool will usually pick one based on the rest of your stack, and your job is to ask "why this one, and what does it mean for cost and vendor lock-in" rather than to pick it yourself.
04 — Landscape: Current Auth Options at a Glance
| Option | What it handles | Best for |
|---|---|---|
| Clerk | Hosted login/signup UI, social login, session management, user management dashboard | Teams that want auth working in under an hour with minimal configuration; willing to pay per active user at scale |
| Supabase Auth | Auth bundled with a Postgres database and backend platform | Apps already using Supabase for their database — auth and data live in one place |
| Auth.js (formerly NextAuth) | Open-source auth library you integrate into your own app's code | Teams that want auth logic living in their own codebase rather than a hosted third-party UI, and want to avoid per-user fees |
| Better Auth (now backed by Vercel) | Open-source, framework-agnostic auth library; gaining first-party support in Vercel/Next.js projects | Teams building on Vercel/Next.js wanting an open-source option with growing platform-level support |
Don't treat this table as a ranking — treat it as a map. The right choice depends on what backend/database your AI tool has already chosen, and whether you'd rather pay a subscription for convenience or accept more setup for a free, self-hosted option.
05 — Payments: What "Integrating Stripe" Actually Involves
Stripe remains the standard payments processor most AI tools default to for SaaS billing. "Integrating Stripe" is not one step — it's a handful of distinct pieces, and knowing them helps you tell whether an AI tool's payment setup is actually complete or just superficially working:
- Collecting payment details — usually via Stripe's own hosted Checkout page or an embedded payment form, so that raw card numbers never touch your own servers (this matters for security compliance called PCI-DSS — you want Stripe handling this, not custom code).
- Creating a charge or subscription — a one-time payment, or ongoing billing tied to a plan (monthly/annual).
- Webhooks — this is the part beginners most often miss. A webhook is Stripe notifying your backend, in real time, when something happens on Stripe's side — a payment succeeded, a subscription renewed, a card was declined, a customer canceled. Without webhooks wired up, your app might show someone as "paid" only at the moment of checkout and never learn later that their card failed on renewal, or never actually unlock their features at all.
- Reflecting payment state in your own database — when Stripe says "this customer is now subscribed," your backend needs to update your own
usersorsubscriptionstable so the rest of the app (what features they can access) reacts correctly. - Handling the messy edge cases — failed renewals, refunds, upgrades/downgrades, cancellations. This is usually where "we integrated Stripe" projects are thinner than they look — the happy path (successful first payment) is easy; the edge cases are where real effort goes.
If an AI tool says payments are "done," a fair sanity-check question is: "does this handle what happens when a renewal payment fails?" That single question exposes whether webhooks and edge cases were actually built or just the checkout button.
06 — Calling Third-Party APIs, in General
Beyond auth and payments, most SaaS products call other companies' services for pieces they don't want to build themselves — sending email (e.g., through an email API), generating AI text or images, looking up an address, sending SMS. Each of these is used through an API, and the pattern is always roughly the same: your backend sends a request with an API key (a secret password that identifies your app to that service), the third-party service does its job, and sends data back.
Two things matter for you as the non-coder in the room:
- API keys are secrets. They should live only on the backend (or in a securely stored environment variable — covered in Layer 06), never visible in frontend code, because anyone could copy a key out of their browser and rack up charges on your account, or worse.
- Third-party APIs cost money and can fail or rate-limit you. When an AI tool bolts on a new integration, it's worth asking what happens if that service is down or your usage exceeds a free tier — is there a fallback, or does the whole feature just break?
07 — How It All Fits Together
Here's a typical SaaS app's shape in plain words, matched to the pieces above:
| Layer | Role | Talks to |
|---|---|---|
| Frontend | What the user sees and clicks; runs in their browser | Backend (via API calls) |
| Backend | Business logic, permissions, coordinates everything else | Database, Auth provider, Payments provider, other APIs |
| Database | Stores users, their data, and app state permanently | Backend only (frontend never touches it directly) |
| Auth provider | Confirms who's logged in; issues a token proving identity | Backend (and sometimes frontend, for the login screen itself) |
| Payments provider | Handles charging cards, subscriptions, webhooks | Backend (which updates the database when payment events arrive) |
The throughline: the frontend never talks directly to the database, auth internals, or payment processing — everything routes through the backend, which is the trusted gatekeeper deciding what's allowed. That single rule is the most useful architecture fact you can carry into any conversation with an AI coding tool.
08 — How to Actually Use This: Reading an AI-Built Architecture
When an AI tool describes or scaffolds an app for you, you're not evaluating code quality — you're checking that the shape makes sense. A practical routine:
- Ask it to describe the architecture in the five-row table above, filled in for your specific app. If it can't cleanly say what the backend does versus the frontend, that's a sign the plan itself is muddled, not just under-explained.
- Ask what happens to sensitive data. Where do passwords live? Where do payment details go? ("Nowhere in our database — Stripe holds card data" is the correct answer for payments.)
- Ask what the database schema looks like before a lot of code gets written, in plain English — what are the main "things" being stored, and how do they relate? This is cheap to check early and expensive to fix later.
- Ask which pieces are third-party services versus custom-built, and for each third-party piece, what it costs at your expected scale.
- You don't need to read a line of code to do any of this — you need the vocabulary from this layer, and the habit of asking.
09 — Common Mistakes Beginners Make
- Assuming "it works in the demo" means the backend is solid. A frontend can look finished while the backend behind it is stubbed out or fake.
- Treating auth or payments as a small feature to build custom, "just for now." These are the two areas where cutting corners creates real security or financial risk, not just bugs.
- Not asking about webhooks when payments are involved. A checkout button working once is not the same as subscription billing actually working over time.
- Confusing "the database" with "the backend." They're distinct: the database stores data; the backend contains the logic that decides what to do with it.
- Never asking what happens when a third-party service fails. AI tools often build the happy path only unless prompted otherwise.
Where this leads
You now have the vocabulary to hear "the backend's throwing an error on the auth webhook" and know roughly what broke and where to point the AI tool next. But knowing the architecture is only half the picture — you also need to know where this code actually lives, how changes move from "AI just wrote this" to "real users can see it," and what it means when someone says "push to production." That's Layer 06 — Git, Environments & Deployment, where the abstract boxes in this layer's table become real, running infrastructure you can point at and say "that's live."