Five stack decisions from the Wintura build, and how they look now

By Alvi Lika, Founder, Soatech

· · 6 min read

Raw SQL over an ORM, Auth.js over a hosted auth platform, Tailwind v4 CSS-first config, PDF rendering moved out of serverless, and end-to-end-only tests: each reason as recorded, what it costs, and what has changed since.

Stack advice is usually written as if one answer fits every product. These are five decisions taken from the decision log of wintura.ai, a multi-tenant B2B SaaS. For each one: the reason as recorded at the time, what the choice costs, when a different choice would be better, and what has changed since. The log opens on 3 March 2026. Where a vendor fact matters, it has been checked against current documentation as of 7 November 2026.

For decisions about correctness (tenant scoping, model output, signatures, payments), see the Wintura decision record.

1. Raw SQL instead of an ORM

Recorded reason: "Faster to start, no migration overhead for MVP, full control." The entry also set a revisit point: month three, if query complexity grew significantly.

What it looks like: queries are written as SQL through @neondatabase/serverless, and all of them live in lib/db/. Migrations are plain .sql files applied by a small runner that records each file's SHA-256 checksum in a _migrations table and refuses to continue if an applied file has been edited since.

What it costs: row types are written by hand in TypeScript, so a column rename doesn't produce a compile error at the call sites. You find it at runtime or in end-to-end tests. Migrations also have to be written to be safely re-runnable (IF NOT EXISTS), because a file that fails halfway is retried on the next run.

Choose differently when several people write queries, or the schema changes often. A query builder or ORM that generates types from the schema turns a whole class of runtime errors into compile errors. That trade gets better as the team grows.

2. Auth.js v5 instead of a hosted auth platform

Recorded reason: the database was already on Neon, and the alternative under consideration (Supabase) would have added a second paid platform for one capability. The entry notes that v5 was labelled beta and chose it anyway as "the path forward".

What it looks like: Auth.js v5 with the Neon adapter, database-backed sessions, and Google plus email sign-in.

What it costs: you own the configuration, including the subtle parts. One example from Wintura's own config: with database sessions, the value the session callback returns is what /api/auth/session serves to the browser. Returning the raw session row would expose the session token to page scripts. The callback has to return an explicit, minimal shape.

What has changed: on 7 November 2026, v5 is still published under npm's beta tag (the latest tag points to v4), and the Auth.js documentation now says the project "is now part of Better Auth" (authjs.dev). The original log entry already noted the governance change. A new project should weigh that before starting on v5.

Choose differently when you want hosted sign-in UI, MFA and organisation management without building and maintaining them, and the data-residency terms work for your customers. That's a legitimate trade of control for time.

3. Tailwind v4 with CSS-first configuration

Recorded reason: use the latest stable versions at the start of the build. Tailwind 4 meant no tailwind.config.js. Design tokens live in an @theme inline block in globals.css.

What it costs: plugins written for v3 don't always work. The log records one concrete case: tailwindcss-animate is incompatible with v4, so Wintura uses tw-animate-css instead. Every component library you add has to be checked the same way.

Choose differently when an existing v3 project depends on plugins that haven't moved to v4. For a project mid-build, the migration is real work with little product value. For a new project, starting on v4 avoids doing that migration later.

4. PDF rendering outside serverless, files on R2

Recorded reason: PDF rendering runs as a separate Puppeteer service on Railway because, as the log puts it, serverless functions timed out at 10 seconds while Puppeteer needed 15 to 30. Generated PDFs and logos go to Cloudflare R2: "Free tier 10GB covers months of usage. No egress fees."

What has changed: the timeout reason no longer holds as written. Vercel's current documentation lists a default maximum duration of 300 seconds with fluid compute, configurable up to 800 seconds on Pro (Vercel docs). Wintura's own AI generation route declares maxDuration = 300. Whether rendering should move back in depends on other factors too, such as packaging a headless browser into a function and the cost of each render. The point is that the original reason should be re-examined, not assumed.

R2's pricing still matches the recorded reason: Cloudflare lists free egress and a 10 GB-month free tier for Standard storage (R2 pricing). Note that the same log later sends AI-generated images to Vercel Blob instead, for "less setup". Storage choices can differ by use case within one product, and that's fine.

Choose differently when your documents are rarely downloaded (egress pricing matters less), or when one platform's simplicity is worth more to the team than the per-gigabyte difference.

5. End-to-end tests only

What it looks like: Playwright suites organised by project: public pages, authenticated flows, mobile, and an audit matrix that runs layout and axe-core accessibility checks across mobile, tablet and desktop viewports for public, private and onboarding routes. There is no unit-test runner in the project.

Why it holds up: in a multi-tenant product, the expensive bugs sit at the edges between components: a real session, a real tenant, a real database row. End-to-end tests exercise those edges. Unit tests with a mocked tenant don't.

What it costs: slow feedback on pure logic. Pricing totals, payment schedules and status transitions are pure functions that a unit-test runner could check in milliseconds, while a browser suite takes minutes. A small unit layer for those lib/ modules would complement the end-to-end suites. It wouldn't replace them.

Choose differently when most of your risk lies in calculations rather than integration. Then unit tests should come first.

The habit worth copying

Every entry above has the same shape: a decision, a reason, a known cost and, ideally, a condition for revisiting it. Several of those reasons have since changed, and that's only visible because they were written down. A minimal template:

## 2026-03-03 — Database access: raw SQL over ORM
Decision: what was chosen, and what was rejected.
Reason: the constraint that made it the right call at the time.
Cost: what this makes harder.
Revisit when: the observable condition that would change the answer.

You can see how these choices show up in the running product in the Wintura case study.

See the full build these notes come from.

Read the Wintura case study

Working on a feature this article touches? A 30-minute call is the quickest way to scope it.

Discuss your project