> ## Content Index
> Fetch the complete content index at: https://blog.netpy.in/llms.txt
> Use this file to discover other available public pages before exploring further.

# From demo to shipped: what lives in the last 10% of an MVP
- URL: https://blog.netpy.in/from-demo-to-shipped-mvp/
- Published: 2026-11-30T04:34:12.000Z
- Updated: 2026-11-30T04:34:12.000Z
- Description: A demo proves one path works. Shipping an MVP means owning every other one: the four authentication states, an error envelope users can act on, request ids that survive a support ticket, onboarding that invites a second user, and billing writes that cannot double-charge.
- Author: Netpy Technologies
- Tags: Product, SaaS, Engineering

A demo is a narrow claim: this screen works, with this data, for this user, on this network, right now. An MVP that ships is a much wider claim, and every inch of that width gets built in what teams call the last 10% — the stretch between the review link and the first paying customer.

That stretch is not polish. It is the part where you discover that the demo never exercised a single failure path, that the app has one user because nothing invites a second one, and that your billing webhook has been retrying for six hours and charging someone twice. At NetPy we have shipped enough of these — for dairy cooperatives, CA firms, event businesses — to have a fixed list of what the last 10% contains. It is boring, mostly invisible in a screenshot, and skipping it is how an MVP becomes a demo that never leaves the review meeting.

## What the last 10% is actually made of

Count the states, not the screens. A routine SaaS MVP has maybe fifteen top-level views. Multiply each by the states a user genuinely passes through: loading, empty, populated, long-list, error, partial failure, unauthorized, offline, and rate-limited. That is roughly a hundred and twenty states. A demo exercises the fifteen "populated" cases, usually with seeded data that never triggers pagination.

The cost of a state is not linear in where you fix it. A missing empty state caught in week three is a copy change; caught in week twelve it is a support ticket, a screenshot in a WhatsApp group, and a hotfix. The last 10% is where you buy all hundred states at the cheap price.

## Authentication is four states, not a login page

Most MVPs ship a login form and call auth done. Production users exist in four states, and three of them break something:

- **Anonymous** — may read a marketing surface, must never see a cached authenticated page.
- **Authenticated but unverified** — email not confirmed, so most write actions must be blocked with an explanation, not a silent failure.
- **Authenticated but unprovisioned** — no tenant, no organisation, no role yet. This is the state right after signup that generates "the app is broken" reports.
- **Expired session mid-task** — the one that loses work.

The structural fix is to make the server the only authority on entitlement and let the client merely hide what it cannot use. If a client-side flag is the difference between reading and deleting, you do not have authorization, you have a suggestion.

The second fix is session recovery. A fifteen-minute access token with a rotating refresh token is standard; what is not is what happens when refresh fails mid-form. Preserve the draft locally, re-authenticate, and return the user to the exact state. An app that discards an eight-field form because a token expired teaches users to draft everything in a notes app first — a strong signal the product is being used under protest.

## Error states are the UI your users see most

In the first month of a real deployment, users see loading, empty and error states far more often than a full data grid, simply because there is not much data yet. Treat those as primary screens.

A taxonomy that holds up:

- **Validation** — the user can fix it. Inline, next to the field, never a toast that disappears.
- **Conflict** — a 409 from two editors. Reconcile and show what changed; do not silently overwrite.
- **Transient** — timeouts, 429s, flaky upstreams. Retry with exponential backoff plus jitter, cap it, and tell the user you are retrying.
- **Authorization** — 403 with a sentence explaining who can do this, not a generic denial.
- **Fatal** — degrade the feature, keep the rest of the app usable, and surface a real status page.

Every response carries one shape, so the client can branch without guessing:

```python
# app/errors.py — one envelope, classified once, handled everywhere
from fastapi import Request
from fastapi.responses import JSONResponse

class AppError(Exception):
    def __init__(self, code: str, msg: str, retryable: bool, status: int = 400):
        self.code, self.msg, self.retryable, self.status = code, msg, retryable, status

@app.exception_handler(AppError)
async def handle(request: Request, exc: AppError):
    return JSONResponse(status_code=exc.status, content={
        "error": {
            "code": exc.code,              # machine branch: BUDGET_EXCEEDED, RATE_LIMITED
            "message": exc.msg,            # human: one sentence, one next action
            "retryable": exc.retryable,    # client decides: back off, or stop and explain
            "request_id": request.state.request_id,  # ties the ticket to the log line
        }
    })

```

Two rules follow from that shape. Never render a raw exception message to a user, and never render "Something went wrong" either — both leave the user with nothing to do. Give them one action and one correlation id they can quote to support.

## Three signals, one id, before you cannot reproduce it

An MVP does not need a full observability stack: request correlation, three metrics per endpoint, and one synthetic check.

- **Correlation**: generate a request id at the edge, put it in every log line, every error envelope, and every outbound call. Without it, a support ticket is a guess.
- **Metrics**: rate, errors, duration — per route, not per service. A service-level average hides the one endpoint that is slow.
- **Synthetic check**: drive the actual critical path end to end (sign in, create the core object, complete the money step) every five minutes from outside your network. Health endpoints that only prove the process is alive are theatre.

Budget the number before you argue about it. 99.5% availability is about three hours thirty-nine a month; the budget decides whether a bug is a hotfix tonight or a ticket on Monday.

One India-specific constraint: do not log request bodies to "make debugging easier". Under DPDP, a log full of names, phone numbers and addresses is a personal-data store with no retention policy and no deletion path. Log ids, status codes and hashed keys.

## Onboarding is the empty state, and the empty state is the product

The single biggest determinant of whether an MVP is adopted is time to first value, and most demos cheat on it by starting with seeded data.

Three changes we make routinely. Every empty state gets one sentence naming what the screen is for, one primary action, and one example of the result. Onboarding asks for the minimum needed to produce a real artefact, not a profile — a working document beats a filled-in form. And onboarding invites a second user, because software a team can see each other in gets adopted, while single-player software gets abandoned when the founder gets busy.

## Billing is where the last 10% turns into an incident

Money code is the one place where a demo-quality decision becomes an existential one. The rule: never let a browser redirect authorise a payment state change. The redirect is a hint; the webhook is the truth, and it will arrive twice, out of order, and six hours late.

Make the write idempotent at the database, not in application logic:

```sql
CREATE TABLE payment_attempt (
  idempotency_key TEXT PRIMARY KEY,     -- from the client, stable across retries
  order_id        UUID NOT NULL,
  state           TEXT NOT NULL,        -- pending | succeeded | failed
  amount_paise    BIGINT NOT NULL,
  gateway_ref     TEXT
);

-- A retried request can insert at most once; the second call is a no-op.
INSERT INTO payment_attempt (idempotency_key, order_id, state, amount_paise)
VALUES ($1, $2, 'pending', $3)
ON CONFLICT (idempotency_key) DO NOTHING;

-- State only moves forward, and only on a verified webhook.
UPDATE payment_attempt SET state = 'succeeded', gateway_ref = $2
WHERE idempotency_key = $1 AND state = 'pending';

```

Then add what nobody adds: a daily reconciliation job comparing your table against the gateway's settlement report, and dunning — a short sequence when a renewal fails, because involuntary churn from an expired card looks exactly like a customer who left. For Indian invoicing you also need GSTIN, place of supply and the right SAC code from day one; retrofitting statutory fields into generated PDFs is a genuinely unpleasant week.

## Migrations, config and the rollback you have never tested

The last 10% also includes the first deploy you can undo. Make migrations expand-and-contract: add the new column, backfill, dual-write, then drop the old one in a later release. A rolling deploy means old and new code run simultaneously for a few minutes, so a migration that drops a column before every pod restarts takes the site down during exactly the window nobody is watching.

Secrets live in one place per environment, and a seed script must be able to build a working environment from an empty database.

## The list we actually run before "launch"

1. Every screen has loading, empty, populated and error states.
2. A 401 mid-form preserves the draft and resumes.
3. One error envelope, one request id, and it appears in the UI.
4. Rate, errors and duration per route, plus one synthetic critical-path check.
5. Money and email writes are idempotent; the redirect is not trusted.
6. A daily reconciliation job exists for payments.
7. A migration has been reverted on staging on purpose.
8. A backup has been restored into a fresh environment.
9. Someone is on call, and there is a place to say "we know".

None of this makes a demo look better. It is the difference between a product a client can run a business on and a link nobody opens after week two. Our [web development](https://netpy.in/files/web%5Fdevelopment.php?ref=blog.netpy.in) and [enterprise IT](https://netpy.in/files/IT-enterprise.php?ref=blog.netpy.in) teams run this list on every build; the two items that repeatedly save a launch are the error envelope and the idempotent write.