Choosing a Tech Stack: Sveltekit + Pocketbase vs. Go/HTMX + GoAPI(SSR) – Opinions Needed! #3574
-
I'm currently building a small app using Sveltekit and Pocketbase. I find Pocketbase simply fantastic! While I genuinely appreciate Sveltekit, I struggle to warm up to TypeScript – it feels like there are too many possibilities for my taste. Hence, I'm considering building my frontend with Go and HTMX and adding a Go-API layer, functioning similarly to the Formactions and Load functions in Sveltekit. Golang feels stricter to me in terms of typing and allows me to think more clearly. Additionally, I'm keen on diving deeper into Go. I'm aware that Pocketbase is a BaaS system, and by pursuing this thought, I might be diverging from its core idea. I also understand that I'd have to directly call the API endpoints since Pocketbase doesn't offer a Go SDK. Ultimately, my goal is to develop multiple MVPs as swiftly (yet securely and scalably) as possible to validate my MicroSaaS ideas in a short timeframe. In short: Sveltekit + Pocketbase or Go/HTMX + GoAPI(SSR) + Pocketbase – what are your thoughts? Pros and cons? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
You usually don't need a Go client-side SDK to use PocketBase with your existing Go stack. PocketBase is distributed as a regular Go package and can be used as framework/toolkit, aka. it can live as part of your existing Go program and you can interact directly with the database without making extra http requests. It also exposes the underlying router (echo; it may change in the future) so users can use whatever rendering and template engine they prefer for handling the SSR routes. My personal preference for web apps is usually embedded static client side application (eg. SPA) + generic web API because most of the time my use cases require targeting more than one platform and it is just easier for me to maintain them. But if you are targeting primarily the browser and don't need too much js interactivity, then I think Go SSR is a good choice (in addition to the Go std template lib there are plenty of other external Go template libraries to make the integration with htmx easier like templ, pongo, liquid, etc.).
You don't have to use TypeScript with SvelteKit, you can use plain JS. You don't even have to use SvelteKit to use Svelte. For SPA a simple hash based router like svelte-spa-router is usually enough to get the job done. |
Beta Was this translation helpful? Give feedback.
Yes I think this is correct, but the above is just my personal preference so take it with a grain of salt.