So basically I have a unique app that is 3 apps. Dashboard, StoreFront and Scanner App. apps/ |--dash/(sveltekit) |--scanner/(sveltekit) |--store/(Astro) pkgs/ |--core/ |----src/ |-----schemas/ (Astro action/remote funcs input) |-----repositories/ |-------Postgres/ |-------DoSqlite/ |-------LocalScanner/ |-----services/ (Business logic to call in handlers) |-----layers/ (this is like “infra” or ports) |-----adapters/ |-------Cloudflare/ |---------kv.ts |---------email.ts |---------… |-------Neon/ |-------Resend/ (before changing into CF email) |-------PGlite/ (crucial for local testing) My “Layers” are something like ports. And I have one for every external provider. Email, KV, DB, Analytics, Images, even Durable Objects etc… In this setup AI can’t f up. My logic is infra agnostic, and easy to test, but still very Cloudflare shaped.
Honest feedback from someone that built 3 apps on SvelteKit/Astro Stack I no longer build on Framework First setups, always monorepo and core logic like Repository and Services get their module. And Cloudflare is an adapter to ports. So you can swap KV for redis. Or Cf email sending for Resend. I know many people are MVP and want to “fail fast” but this pay dividends.
As a fellow Multi Tenant Saas Author: quick suggestion, drizzle gets old really fast, as soon as you get in transaction territory and atomicity, you get into unsafe queries when you write CTEs. I recommend Kysely.
Neon is super cool, the branching is very polished. I wish they put the effort on bringing full feature parity with better-auth.
people cannot write without ai these days huh