recipes for docker-compose, svelte-kit, golang, pocketbase, python, ...

by Jitesh Doshi on

At SpinSpire, every year we take dozens of projects to production. But in order to get there, we have to build dozens of projects per month, only some of which gets released. In this process, we master several tech stacks. After going through this process many times we’ve made some common observations:

With those considerations in mind, I would like to introduce SpinSpire Recipes – A git monorepo designed to kickstart any project with a working foundation of tech stacks involed. The stacks are pre-configured and even have a small library of components.

Features

Docker & Docker Compose

We use Docker and Docker Compose to help provide a highly predictable, controlled, isolated, and hence secure runtime environment for all our apps. docker-compose.yml file is provided for every container in the stack.

SvelteKit (sk)

Svelte is our (browser) UI technology of choice and SvelteKit adds routing and server-side functionality to it.

PokcetBase & Golang (pb)

PocketBase is a self-hosted BaaS (backend as a service) which is very lightweight but provides a ton of features like a database (sqlite) fronted by a REST API, file uploads, email/3rd party single-sign-on, server push on data change, etc. Although a binary is provided, the best part is that it can be used as a Golang framework and extended without limits.

Python / FastAPI (py)

Python is the language of choice for data-science and AI, while FastAPI is the API of choice for async (ASGI) web services.

Metabase (mb)

Metabase is a power BI (Business Intelligence) and data visualization platform.

How to use

  1. First of all, read the project README file to understand the technical details.
  2. Then use the excellent tool degit for copying entire repo or a part of it.
  3. It’s a monorepo containing probably more than what you need. You can use the entire repo, or some part of it:
  1. Then copy .env.example into .env and edit it to match your environment.
  2. Delete the folders for the stacks you don’t need (e.g. mb/py/pb/sk)
  3. Delete their configuration from docker-compose.yml file and adjust docker-compose.override.yml
  4. Finally run docker-compose up -d and watch the logs (docker-compose logs -f) for a healthy compile and startup.

Browse the code and further delete what you don’t need. And only after that, start building on top of it. Of course, reach out to me if any questions.

How it works

[traefik https:443] --> [pb:8090]
     (prefix /apy) --> [py:8000]
     (prefix /mb ) --> [mb:3000]
[traefik https:443] --> [sk:5173] --> (prefix /_ || prefix /api) --> [pb:8090]
[traefik https:443] --> [pb:8090] + (dynamic /api + static /sk/build)

Coming soon …

We will keep building up this repo, for our own sake as well as the community’s. We will add many library functions and components. Also, other stacks:

Also, watch this space for a YouTube screencast tutorial video on how to take most benefit out of it.