Shared services
Christofer Bäcklin, 2026-01-21
To punch out apps fast I'm packing reusable functionality into shared services. These are deployed separately and accessed via client libraries. I'm pretty sure this is how Lovable and similar sites are set up too, how else can you add a working login flow in just a single prompt?
The proof-of-concept for this setup is Morfis' band site, which contains a publicly available form for sending an email to me. To make this modest functionality I've set up the following flow.
- Service provider = Resend = Publicly available tool.
- Shared service = Alert = An internal messaging service that forwards to Resend and a publicly available client package (@nofuss/alert) for interacting with it.
- App = Morfis' band site = Publicly available website that utilize the Alert client.
It's taken a bit of time (I'm on parental leave managing a tough little customer all day!) but now when it's done I can: Quickly add email alerts to any app; and Quickly pack other functionality into new shared services by reusing the boilerplate code. My back-of-an-envelope roadmap is:
- Authentication via Clerk
- Authorization via AuthZed + SpiceDB
- Payments via Mollie
- Realtime collaborative sync (think Google Docs) via Automerge
Stay tuned!
AI assistance
Zed with Claude and also free web ChatGPT helped me a lot in getting this in place. Primarily it has greatly improved my knowledge of systemd, sudoers, DNS email records, protobuf code generation, NPM packaging and distribution. I've carefully reviewed all code AI has written for me because this setup will be a linchpin in the platform going forward. I wouldn't dare to use it as foundation for more serious apps without understanding all of it in full detail.