My quick start Svelte + Go monorepo template
Skip to the bottom to see the gist.
Every new project I’ve built has the same key parts: SvelteKit for the frontend, PocketBase for the backend, all deployable with a single docker-compose.yaml
file. In fact, this blog uses the very same tech stack.
I used to create these repos from scratch, manually copying and editing Dockerfiles until they started working. I took the time to write the process down so you don’t have to!
Why Svelte?
SvelteKit is great for its performance and flexibility. I can trust Svelte’s compiler-based approach to DOM updates because I know it’ll optimize reactive state changes for me. I don’t need to think if I’m using a hook wrong or if there’s a footgun I need to be aware about.
Why Go?
PocketBase is excellent as a small-to-mid sized project starter. It feels like SQLite with a builtin admin panel. I can iterate really quickly because I can just point-and-click through my database schema. They provide a JS SDK which gives you CRUD for free.
The best part about PocketBase is how extensible it is. You can extend it with JavaScript, which I used to do, or you can extend it with Go.
Extending with JavaScript lets you register new API routes or add new logic when a record is created, but you’re stuck with whatever builtin JS functions are exposed to you.
When you extend with Go, you’re basically writing, compiling, and running a regular Go app, which means you can go get
libraries like normal.
I’m in!
Here’s the gist I’ve written to get you from zero to docker compose up
!
SvelteKit PocketBase monorepo guide.md
From here, you can easily deploy to a VPS or a home server (which I do) with Coolify. But that’s a story for another time.
If you end up trying it out, let me know what you think! ✻