cd /news/ai-tools/from-localhost-to-production-40-trap… Β· home β€Ί topics β€Ί ai-tools β€Ί article
[ARTICLE Β· art-174729] src=dev.to β†— pub= topic=ai-tools verified=true sentiment=Β· neutral

From "Localhost" to "Production": 40 Traps Nobody Warns You About

A non-developer who builds tender responses shipped a multi-user life-management app alone in three weeks using an AI assistant, documenting 40 post-localhost production traps in a field journal. The account covers infrastructure choices such as Render's free tier versus a small European VPS, a week-long platform outage, and a deploy that showed "Live" while returning the platform's own 404 for about four minutes. The author credits a 55-entry decision log recording why, what was given up, and when to reopen each choice as the project's most valuable habit.

recommendation

Check the provider's status page before touching anything when your app stops answering, and never schedule a launch demo on infrastructure without an SLA.

more in playbook: Running AI in production
by read25 min views1 publishedNov 23, 2026

A field journal from a non-developer who shipped a functionnal multi-user app alone, with AI, in three weeks.

I am not a software engineer. I build tender responses for a living β€” spreadsheets, technical memos, cost models. In autumn 2026 I decided to turn a personal life-management app I had been using alone into something other people could sign up for.

I had the thing working on my laptop already. I thought the remaining work was "put it on the internet." That is the sentence this guide exists to disarm.

What follows is not a tutorial. There are thousands of tutorials and they all stop at the same place: the happy path, on your machine, with one user, with your own data, with no money involved. This is a list of the specific walls I hit after that point, what each one cost me, and what I did. Every one of them is written down because I wrote a decision log as I went β€” 55 entries, each one recording why, what I gave up, and when to reopen it. That habit is chapter 13 and it is probably the most valuable thing in here.

Who this is for. You started an app with an AI assistant. It works locally. You are one person. You now want real users, and you are discovering that the gap is not code.

Who this is not for. Teams with a DevOps person. Anyone who has shipped production software before. You already know most of this and you paid for it the same way I did.

One honest warning. I will name tools and prices. Both change. Verify before you commit money. Where I am uncertain, I say so.

This is the first wall and it stops more solo projects than any bug.

GitHub Pages, Cloudflare Pages, Netlify, Vercel's static tier β€” these serve files. They do not run a long-lived Python or Node process with a database connection. Neither does shared web hosting from a domain registrar: mine sells "web hosting" and it will not execute Python at all.

So the moment your app has a login, it needs somewhere fundamentally different from where your HTML lives. Budget for this before you design anything.

I evaluated every free option I could find. What I actually found, in autumn 2026:

Every blog post I read recommending one of these was written before the tier changed. Check the pricing page yourself, today. Mine is already out of date as you read this.

I chose Render's free tier knowingly. A 15-minute sleep and a one-minute cold start is unacceptable for a paying customer and perfectly acceptable for showing the app to five people who agreed to look at it.

The decision I wrote down was: free tier until the paid launch, then a small always-on VPS in a European datacenter (around €6–12/month depending on commitment length). Two phases, two different sets of requirements, one deliberate downgrade in between.

The mistake to avoid is the opposite: paying for always-on infrastructure for eight weeks while you have zero users, because it feels more professional.

Mid-project my platform went into an extended maintenance window. My app's address stopped answering for over a week. Nothing was broken. There was nothing to debug.

This is worth internalising because the first instinct β€” mine, for about an hour β€” is to assume you broke it. Before you touch anything: check the provider's status page. If your domain resolves and your app doesn't answer and you changed nothing, it is probably not you.

It also means do not schedule a launch demo on infrastructure with no SLA.

The single most useful four minutes of my project.

My platform's dashboard said the deploy was Live. I opened the URL. It returned Not Found. I spent a while hunting through my routing before realising the response was coming from the platform's edge, not from my application β€” the deploy had succeeded and the public address simply had not propagated yet.

It cleared on its own after about four minutes.

Rule: after a first deploy, wait five minutes before you conclude anything. And learn to tell your app's 404 from your platform's 404 β€” they look different. Mine returns JSON; the platform returns an HTML page. Knowing which one you are looking at saves hours.

I was tempted into a second Dockerfile for local development. Resist it. The two drift, and then you are debugging a difference between environments instead of a bug.

I ship a single Dockerfile, with the build context one level up so it can pull in the API, the user-facing frontend, and the static public pages together. Local compose uses the same file. Production-only settings are baked in as environment variables, not as a separate build.

Put alembic upgrade head (or your equivalent) in the container's start command.

The payoff is large and immediate: deploying new tables becomes a git push. I added five tables for a shared-household feature and did nothing else β€” the migration ran at boot on the new container. For a solo builder with no deploy pipeline, this removes an entire category of "I forgot to migrate production."

The caveat: a failed migration now means a container that won't start. Test migrations locally against a real database, not just SQLite.

Mine are declared in the deploy manifest as "do not sync" β€” the manifest names the variable, the platform holds the value, the repo holds nothing. The database URL, the owner's email, every API key.

Two things that bit me anyway:

.dockerignore initially did not exclude .env. The file was being baked into the image. Check this explicitly: docker build then inspect the image's filesystem. These cost me more wall-clock hours than any genuine bug, because each one makes you believe a change didn't work.

You edit a file. You reload. Nothing changes. You conclude the change is wrong. You "fix" the working code.

Chrome caches JavaScript aggressively. After editing a script, force-reload (Cmd+Shift+R / Ctrl+Shift+R). I lost an afternoon to this before it became reflex, and I still catch myself.

If you are automating a browser to test your own app, this is worse β€” your automation reads the stale file and reports a failure that does not exist. My app took about eight seconds to open. The cause was not the server being slow. It was roughly seventy conditional requests per page load, each one a round trip to a free-tier instance, just to be told "not modified."

The fix is boring and enormous:

style.css?v=7) with a long, immutable cache: private, max-age=604800, immutable. No revalidation for a week. no-cache. Because the HTML is never cached and it contains the version numbers, shipping a new version changes the asset URLs, and the browser fetches exactly the files that changed and nothing else. Eight seconds became well under one.

Obvious written down, invisible at 2am: editing a Python file that is already running changes nothing until the process restarts. I made a dedicated one-click restart script purely so I would stop forgetting.

This is the whole job of becoming multi-user, and it is not glamorous.

Every single piece of stored data gets a user_id. Every query filters on it. And then β€” this is the part people skip β€” you write a test that proves account A cannot read account B's data. Not a manual check. An automated test that fails your build.

I treat isolation tests exactly like any other test. A regression in data isolation breaks the build the same way a syntax error does. If that sounds dramatic: the alternative is finding out from a user.

I had around seventy working screens built for one person. Rewriting them properly would have taken months.

So I didn't. I wrote a clean, tested core β€” accounts, sessions, the shell β€” and ran the existing screens inside a compatibility layer: the old code still calls the same storage interface it always did, but that interface now talks to a per-account API instead of the browser's local storage. The old screens do not know they are multi-user.

The reasoning I wrote down at the time, and still believe:

Nothing sells faster than something that already works. The main risk to this project is not technical debt β€” it is never launching.

The deliberate cost: the debt is real, and it is localised. Old code lives in one clearly-marked directory. The core is clean. A screen gets properly rewritten when actual usage justifies it, not because it offends me.

I needed one module β€” the household one: shopping list, meal plan, shared calendar β€” visible to two accounts, while everything else (money, health, wardrobe) stayed private.

My first instinct was to make the module shared. That's a rewrite.

What actually worked: all my data was already key-value, owned by an account. So I made a single whitelist of 27 keys that are owned by the household instead of the account. One file. A module that wants to share a piece of data adds its key there and nowhere else.

Then the only real work was in one place β€” the storage service:

That last point is the whole trick. My frontend already polled a version number every 25 seconds to detect changes from my other devices. Because the household counter is included in the sum, a change made by the other person moves the version, and the existing sync mechanism picks it up. I added real-time collaboration between two users without touching the sync code at all.

And the property I cared most about: an account with no household reads and writes exactly as before. No regression is possible for solo users.

I nearly shared my calendar key wholesale. It contains personal appointments and everything synced from a work calendar.

Shared data needs its own key, with an explicit "this is shared" flag on each item. And then you discover your codebase touches that calendar in sixteen different places. I funnelled all sixteen through a single accessor that files each event into the right list based on its flag. Sixteen call sites is a refactor; sixteen call sites each deciding privacy independently is a leak waiting to happen.

Two cases, two behaviours:

The second one destroys data from the user's point of view. Say so, in plain language, before they confirm. Not in a tooltip.

My invitation tokens: random, prefixed so they are recognisable in logs, only the SHA-256 hash is stored, valid 14 days, single-use, and locked to the invited email address β€” someone who intercepts the link cannot redeem it from another account.

Only the owner can invite, cancel, or remove. An account belongs to exactly one household.

Each of those constraints came from asking "what happens if this link ends up in a group chat."

This chapter is specific to the path I took β€” personal tool first, product second β€” and it is the one I have found written down nowhere.

I made a copy of my app to serve to other people and started removing myself from it. I expected a database cleanup. What I found was my name, my city, my bank, my employer, file paths from my laptop, password hashes, phone numbers and email addresses scattered through source files, often as defaults that looked innocent.

This is the single best idea in this guide and it took twenty minutes to build.

An automated test walks every file the server will send to a browser and fails the build if it finds: any of a list of personal names, place names, 64-character hex strings (password hashes and keys), anything shaped like an email address, anything shaped like a phone number, or an absolute path from my machine.

It has caught things I would never have found by reading. And it keeps catching them β€” every time I port a feature over from my personal version, the test is standing there.

Here is how it goes wrong.

Sanitising the copy, I replaced my personal daily calorie target with a neutral default. The replacement was hardcoded in seven files. But other screens read the value from the user's profile. So the app showed my number on some screens and the default on others, alternating depending on which screen you came from. A genuinely confusing bug with no single cause.

The fix was not to correct the seven files. It was to delete all seven values and expose one function that derives it from the profile.

The rule: when you find a personal value hardcoded in several places, the bug is the duplication, not the value. Every time I broke this rule I paid for it β€” the same business rule existed in three copies in my finance code and produced two rent payments in the same month, and I had three separate places deciding whether an appointment belonged to a care record.

One rule, one place. Written once.

My personal version read documents from a mounted cloud drive, spoke through my laptop's voice synthesis, and cast a morning briefing to a screen on my wall. None of that exists for a stranger on a phone.

For each one, decide explicitly: remove, replace, or relay. The relay is the interesting one, and it has a sharp edge: when my laptop is asleep, that part of the product is down. I made it degrade to one clear message per minute rather than a wall of errors. If you build a relay, you have accepted a single point of failure. Know that you did.

My CSP was connect-src 'self', and it started breaking things. The breakage was the finding: the frontend was calling two third-party geocoding services with the user's location, plus a weather API, plus endpoints for a work calendar and a personal notes vault β€” all inherited from the personal version, all either dead or leaking.

I removed every one of them and did not relax the policy. The weather came back later as a server-side proxy with a city name from the profile, and no geolocation call at all.

If a strict CSP is inconvenient, it is telling you something true about your app. I will not pretend to be a security engineer. These are the decisions I made, with the reasoning, so you can evaluate them rather than copy them.

I chose a random session identifier in an HttpOnly cookie, with only its SHA-256 hash stored server-side.

Why, for a solo builder:

Cookie flags in production: Secure, SameSite=Lax, __Host- prefix. Plus an origin check on state-changing requests for CSRF.

I would reopen this for a native mobile app or a public third-party API. Not before.

Argon2id, following current OWASP guidance, with automatic re-hashing when parameters change. Rate limiting per email and per IP address. IP addresses stored only as a truncated hash.

On a failed login, return the same message and take the same amount of time whether or not the account exists. "Email or password incorrect," always.

Two honest limitations in my own build, which I wrote down rather than hid:

Both need a transactional email provider, single-use expiring tokens, and the flows around them. I deliberately did not build either during the prototype, and I deliberately did not build fake versions that looked real.

But write it on your launch checklist in capital letters, because you cannot charge money without password reset. A customer who loses their password and cannot recover it is a refund and a bad review.

My first login screen had two ambiguous buttons, no actual <form> element β€” so the Enter key did nothing β€” a generic error that lied about the cause, invisible password rules, and no state.

A login screen that does not embarrass you needs: a real <form>, correct autocomplete attributes so password managers work, visible rules validated live on the client while the server stays the source of truth, errors that offer an action ("create an account with this email"), a state, handling for the network being down, and accessibility (focus management, live regions, reduced-motion).

That is a day of work. It is the first thing every user sees.

My app's HTML, service worker, manifest, and asset directories are served only with a valid session. Explicit routes, an allowed-extensions list, no hidden files, no path traversal, no directory listing.

And the responses differ by type, which matters: a page gets a 303 redirect to the login screen with a return URL; everything else gets a 401 with a JSON body. Redirecting a service-worker request to an HTML login page produces baffling failures.

My app lets a user paste a calendar subscription link, and the server fetches it. That single feature is a server-side request forgery vector, and it is the most dangerous thing in my codebase.

If your app fetches any URL a user supplies β€” a calendar feed, an avatar, a webhook, an RSS URL, "import from link" β€” read this twice. localhost is nowhere near enough The naive check is a string match on the hostname. That is defeated by: a domain that resolves to a private address, a redirect to a private address, an IPv6 literal, a decimal-encoded IP, a hostname with an internal suffix.

Here is what my fetcher does, and every item is there because the item above it was insufficient:

https (or webcal) only..local, .internal, and friends. Host header and SNI. This closes the DNS-rebinding window between your check and your request β€” otherwise the name can resolve to something else by the time you connect. Then rate-limit it (mine: 30 fetches per hour per account) and cache the result.

Having safely fetched a file, you now parse a format designed in 1998 with recurrence rules. Put hard ceilings on everything: maximum events read, maximum events returned, maximum recurrence expansions. A single calendar entry can describe an infinite series. Mine stops at 20,000 read, 2,000 returned, 4,000 recurrence steps.

A calendar subscription link grants read access to someone's calendar. Mine is stored and never returned to the client β€” the UI shows only the hostname. If your settings page helpfully displays the saved URL, you have built a credential-disclosure feature.

If your app calls a language model, this is your largest variable cost and your most abusable endpoint. It does not matter how obfuscated. Anyone can read it. One route on your server, the key only in the server environment, never returned by any endpoint β€” my status endpoint exposes booleans, nothing else.

I started with "20 requests a day free, 300 paid." That is not a budget, because requests differ in cost by orders of magnitude. A long document costs a hundred times a short question.

What I built instead: a monthly ceiling in actual currency, per account, stored in micro-units. Free accounts €0.50, paid €6, my own account €30.

This is the pattern, and it is the whole chapter:

Without step 1 you discover the overspend afterwards. Without step 4 you charge users for your provider's outage.

Per-account ceilings do not protect you from a thousand accounts, or from a bug of your own making. I added a global daily spend cap that trips and stops all calls. It is the difference between a bad day and a bad month.

My relay accepts only: an explicit list of allowed models, a capped max_tokens, a bounded payload size, text and image blocks only, and exactly one tool (web search) with a capped number of uses.

If you forward arbitrary parameters from the client to a paid API, the client controls your bill. Upstream error messages leak implementation details and sometimes request content. Return a generic message. Log the detail server-side, without personal data in the log.

And calibrate your prices: my cost table and currency conversion were estimates. Replace them with numbers from a real invoice before you set a subscription price on top of them, or your margin is fiction.

I use a managed Postgres from a backend-as-a-service, but only as Postgres β€” accounts, sessions and security are my own code. That choice has consequences people miss.

These platforms expose an automatic REST API over your tables, intended to be used directly from the browser and secured by row-level security policies. If you are not using it, turn it off, enable row-level security on every table anyway, and revoke the public roles' privileges. My backend connects as the owner role; nothing else should be able to connect at all.

Note the ordering trap: enabling RLS protects existing tables. Tables created by a later migration are unprotected until something enforces it. I eventually put the enforcement β€” RLS on, public roles revoked β€” inside a migration, so it applies to every table that exists at that point and is part of the deploy rather than a thing I remember to click.

Mine: 500 MB total, the project s after inactivity, and β€” the important one β€” no automatic backups. No backups is not a limitation you can accept once real users store real data. My plan before taking money: a nightly dump to my own cloud storage. The paid tier with daily backups costs more per month than my server does, and it only becomes worth it when paying customers justify it.

Per account: 6 MB per file, 1,000 files, 100 MB total, 8 KB of settings, 40 MB of key-value data. Request bodies are read in chunks and cut off at the limit rather than buffered whole.

This is not about abuse. It is about knowing your cost per user well enough to price a subscription. Mine is roughly 60 MB β€” and one 15 MB PDF forced me to split files into 5 MB parts and reassemble them on read, which is exactly the kind of thing you want to discover with one user rather than fifty.

My app looked fine on my laptop. On an iPhone, everything was slightly, uniformly, unreadably small.

The cause: 14 of my 58 screens were wider than the viewport β€” one of them 1,351 pixels wide. Safari's response to a page wider than the screen is to zoom the whole page out. So four screens I rarely opened were making the other fifty-four unreadable.

Measure every screen's width programmatically. Do not eyeball it.

Fifty-eight individual fixes is a week and a permanent maintenance burden. One media query at the end of the stylesheet is an afternoon.

What mine does: forces min-width: 0 and max-width: 100% inside screens (flex children default to min-width: auto, which is what lets them push past the viewport β€” this is the single most common cause); allows card headers and button rows to wrap unless explicitly told not to; makes tables, tab strips and chip rows scroll horizontally; and keeps overflow-x: hidden as a safety net.

A font size below 16px on a focusable input makes Safari zoom in on focus, and it does not zoom back out. Set 16px on mobile. There is no way around it and no reason to fight it.

The user feedback was "text is stretched" and "my measurements disappeared."

min-width: 0 applied to <table> elements directly. But some of my tables sat inside a container that scrolled itself to the most recent date on open. Making the table scroll broke the container's scroll, and a table that auto-scrolled to today now opened on a date from years ago. Corrected by excluding tables that already have a scroll container.overflow-wrap: anywhere broke "10 000" across two lines. break-word is almost always what you want. Keep manual zoom enabled. Disabling it is an accessibility failure.

I tested in WebKit β€” Safari's actual engine β€” at two phone sizes. Worth doing; it found the width problems.

It did not reproduce one error a real user hit. The reason turned out to be that on Safari, an error's stack trace does not include the message, so my error display showed an empty box. I changed the display to show type, message, file and line separately. Your error reporting is code, and it has bugs, and they appear at the worst moment.

I had a main branch deployed and a second branch with substantial unmerged work. Both added a migration numbered 0007, each claiming the same parent.

Merging the branches gives you two migration heads and a tool that refuses to proceed. The fix is a merge revision (alembic merge), and it is routine if you see it coming. It is unpleasant to discover during a deploy.

Check for divergent heads before you merge, not after. And if you keep a long-lived branch, note in your project doc that it has its own migrations.

I lost real time being confused about which version was live. Two habits fixed it:

If you use git worktrees for a second branch, deleting the directory with rm corrupts your repository state. Use git worktree remove. Not legal advice. I am an engineer, not a lawyer, and this is specific to my situation in France. Verify everything with your tax authority or an accountant.

My rule, written down early: beta and validation entirely free, with no company registered. Payment processor, legal status, and legal notices before the first invoice β€” not before.

This kept me moving. Registering a company before knowing whether anyone wants the product is a cost and an administrative burden paid for nothing.

The hard line in the same note: never take money without the right status. The deferral is about sequencing, not avoidance.

Billing lives behind a provider interface with no implementation. The cost is an hour. The benefit is that adding a payment processor later is writing one adapter, not threading payment logic through my business code under deadline pressure.

I kept a salaried job throughout. Exclusivity and non-compete clauses are real, they vary enormously, and the moment they start to matter is the moment money changes hands. Read the clauses. If you are changing employers, read the new contract too.

My working name turned out to be close to an existing registered trademark in a relevant class in my jurisdiction, and the name I actually wanted was already taken.

Because the name appears only in configuration and interface strings β€” never in code, never in database keys, never in URLs β€” changing it is a controlled find-and-replace with zero technical impact. My internal data keys still carry the original prefix, and that is fine: they are a data contract, not a brand.

Do a trademark search before your first invoice, not after you have printed anything.

If you take one thing from this, take this. I kept a decision log. One entry per decision, 55 by the end. Each entry has exactly three parts:

That third part is what makes it work. "Monolith, not microservices. Reopen at 10,000 active users or a team larger than three." Now it is not dogma. It is a bet with an expiry condition, and when the condition arrives, the reasoning is sitting there instead of being reconstructed from memory.

Three things this gave me that I did not anticipate:

It made AI assistance actually compound. This is the real reason it matters for us. Every new session with an AI assistant starts from zero context. A decision log plus a handover document means the first thing it reads is why the architecture is what it is, what has already been tried and rejected, and what the current state is. Without that, you get a confident assistant re-proposing something you rejected three weeks ago for good reasons. Half of working effectively with AI on a long project is maintaining the document it reads first.

It caught me repeating a mistake. My log records that I once restructured a screen into titled sections, was told to undo it, and reverted. That entry is annotated "false trail, do not repeat." A week later the same idea looked appealing again. The note stopped me.

It let me record limitations honestly. "Rate limiter is in memory, works only on one instance, interface ready for Redis." A known, written-down limitation is a manageable risk. The same limitation unwritten is a production incident with no explanation.

Write the log for the version of you that comes back in three weeks with no memory. That person is real, and if you work with AI assistants, that person is also every session you start.

What I will not take money without:

Functional

Security

Operational

Commercial / legal

Nothing in here is advanced. That is the point I want to leave you with.

The gap between "it works on my machine" and "a stranger can pay for it" is not made of hard problems. It is made of forty small ones, each of which costs an afternoon, and none of which appears in the tutorial you learned from. Knowing their names in advance is worth more than being clever.

The decision log is the only thing I would call a method. Everything else is just the list.

Go ship it.

I turned this whole log into a rules file you hand to your coding agent instead of reading it yourself β€” drop it in your repo as CLAUDE.md, .cursorrules or AGENTS.md and it stops making these on your behalf. 40+ rules grouped by trigger, plus the decision-log and handover templates. It's here if it's useful: SHIP-ALONE

Either way, I hope the list above saves you an afternoon. Happy to go into any of them in the comments β€” especially the SSRF one, which took me longest to get right.

── more in #ai-tools 4 stories Β· sorted by recency
── more on @github pages 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/from-localhost-to-pr…] indexed:0 read:25min 2026-11-23 Β· β€”