The Correct Architecture
Why four decades of experience led to breaking the standard rules of software design
First, and this needs to be emphasized, great architects and designers defer key decisions for as long as possible. Don’t decide which database to use if an in-memory data structure is good enough for now. You need to store files? Just use the local file system, and store the meta data in JSON, YAML, or even just Markdown with YAML front matter if necessary.
I’m going to break this rule because I’m going to go fast and mostly use AI to generate the code, and I’ve already made all of the architectural decisions. I know what works, what doesn’t, what scales, caveats, hidden traps, and surprising gems.
One decision that generally should be made first is the programming language(s). For this platform, Go, Typescript, SCSS, and HTML are my primary choices. If you’re following this series then I strongly recommend you follow suit for now. A significant amount of this project will be open source. In the end it’ll matter less, but I’m getting ahead of myself, so for now just trust my four decades of experience.
The next key to the architecture is the client: React, MUI.com for the outer shell, but with a hybrid approach where most modules are server side rendered using Go, a-h/templ, and htmx. For local first I’m using the Go Wails, and for mobile I’m using Ionic Capacitor, but only for the build, not the Ionic UI components.
For messaging I’m using NATS, but this choice covers much more than messaging. It’s also a key/value store, object store, encryption at rest, securely supports multiple tenants, and implements several messaging paradigms including scalable request/reply, pub/sub, durable clients, replication, and that barely scratches the surface. A huge advantage of making this choice early is that it can easily be embedded in my local application without requiring me to stand up a separate MongoDB, Redis, MinIO, or RabbitMQ clusters.
For containerization I’m using LXD instead of Docker. LXD natively supports clustering, VMs, containers, image registry, and a large variety of networking and resource allocation not supported by Docker without third party add ons.
If you’re finding this interesting, please subscribe to my Substack. The free tier is well worth the effort 🙂