← Field Notes

Snailed It

How I Built Three Websites (And Counting) With One Codebase

I have three websites:

Convention City Seattle, a showcase of QR Cards for Guest Services, connecting visitors to local businesses through easy-to-scan QR codes that link to neighborhood recommendations. ivantohelpyou, which serves as my general portfolio site for speaking topics, publications, and ongoing projects. Model Citizen Developer, which will contain newsletter posts and related materials, such as code repositories and tutorials.

If you've ever tried your hand at building websites, you know what a hassle it can be. And how expensive. Popular options include:

Website hosting services: WordPress, Squarespace, or Wix will cost anywhere from $15-30/month per site, and you have to handle admin for each one separately WordPress Multisite: Only supported by some hosts, and then only at a premium and with limited support. Cloud deployment platforms: Separate apps on Vercel, Netlify, Heroku, with separate deployments, environment variables, and databases. And the meter's running. Traditional shared hosting: You can still find sites offering unlimited domains through one hosting account, but you'll get a shared environment with slow performance, limited flexibility, and difficulty scaling. DIY approach: Build your own website using any combination of web host, app server, database, and deployment process. This has the ideal balance of cost and capability, but it has a major drawback of complexity -- and if anything goes wrong, you're the one responsible.

All that was before AI.

With AI, website hosting services now offer design suggestions, writing assistants, layout generators, and full website builders. You're still using the same templates, but they look much better. Cloud deployment platforms now include AI coding assistants, AI-powered deployment, and AI-generated functions. Powerful stuff, and you pay for it.

But the option most transformed by AI has been the DIY approach. With AI coding agents, you can go through rapid iterations to experiment with deployment configurations, database schemas, and web frameworks. Ask for what you want, test, document, deploy, and repeat.

Here's a behind-the-scenes peek of what I built. Before I get into the real techie stuff, I'll share that the home pages for all three sites are served up through Canva. It's an ideal starting point for web design, easy to design and edit pages, and you can push it live in a few clicks. And it's cost-effective too! Under a single Pro subscription ($15/mo.), you can create brochureware pages for any number of home pages.

But I'm sure you want more than brochures.

For each of my three sites, I created a separate subdomain, e.g. app.ivantohelpyou.com for ivantohelpyou.com. When you visit those subdomains, the DNS servers point you (via Cloudflare) to the same Flask application running on PythonAnywhere.

Flask is a lightweight Python web framework - think of it as the minimalist alternative to heavy content management systems. Instead of wrestling with WordPress plugins or platform limitations, Flask gives you exactly what you need: a way to handle web requests, connect to databases, and serve up pages.

If you know Python, Flask is simple and reliable. To add a home page, you add a new section of code that looks something like this:

@app.route('/corporate/home') def corporate_home(): return render_template('corporate/home.html') In other words, when someone requests a webpage <website-domain>/corporate/home, Flask returns corporate/home.html as the matching template.

But I didn't want to have to get into the habit of cracking open Python files on the server every time I wanted to add a webpage. And so I came up with a different approach, using a database query to find the right template.

My code looks something like this:

@app.route('/path:url_path') def dynamic_route(url_path): # ONE route handles ALL sites through database lookups site = resolve_site(site_prefix) # Database lookup page = resolve_page(site, page_path) # Database lookup return render_template(template, site=site, page=page) When someone shows up at any one of my sites, the same chunk of code figures out:

"What's your site_prefix?" (Answer: app.ivantohelpyou.com) "What's your url_path?" (Answer: /sci-fi/accidental-franchise)

If that site prefix and URL path are both in the database, Flask pulls up the appropriate template, which in this case displays a sci-fi story called The Accidental Franchise.

Let's go through that one more time... Single Flask Process: All three sites are served by one Python application. No microservices. No container orchestration. No complex infrastructure. Just one process handling everything. And if the traffic gets to be too much, I can always split it, controlling exactly how and when that happens. (Try that on platform-locked solutions.)

Database-Driven Routing: When a request comes in, we look up the domain in the database. The database tells us which content to serve, which templates to use, which environment we're in. It's like having a smart dispatcher that knows exactly what each domain needs.

Template Hierarchy: Each domain gets its own branded experience through template inheritance. Path-specific templates override domain templates, which override defaults. Same content engine, completely different presentations. That's how the same site that shows my AI-generated reading list based on Harvard Extension coursework also shows AI-generated sci-fi story based on a drawing of a three-eyed alien.

Note that while AI coding agents helped me implement this, there's no AI involved on the front end. It's straightforward business logic that's easy to debug, fast to run, and super scalable. But AI helped me to build it, test it, and deploy it. That's what I call the Mullet Method:

AI party in the back, business rules in the front. And since everything is database-driven, AI agents can programmatically create new sites, pages, and content without touching code.

Adding it up: Three sites running on one back-end server for about $25/mo, with home pages on Canva for $15/mo. Incremental cost for a new site: $3/mo. (Domain names not included.)

And that's how to get ROI on AI: Build something on the back end that minimizes your costs on the front end, this month, next month, and every month.

← Field Notes