How We Run 4 Services From One Go Monorepo
We're building Towami — a commerce platform that combines white-label online stores with country marketplaces. One codebase produces four long-running services, each with a separate entry point and responsibility. The Four Binaries cmd/ ├── site/ → marketplace portal + country catalogs ├── shops/ → merchant storefronts on custom domains ├── admin/ → back-office panel └── worker/ → background jobs…
Towami is a commerce platform that utilizes a single codebase to manage four long-running services: site, shops, admin, and worker. Each service has its own entry point and responsibility, making for a modular monolith rather than microservices. The source code is organized in a shared internal/ package tree with sub-packaging by application components such as router, middleware, handler, service, repository, and model/DB.
This structure allows for atomic refactors, where changes to one area of code update all related components in a single commit. The worker service processes email, Telegram, and import tasks via Asynq, using Redis queues. The repository also includes an importer command, which is a CLI utility outside of the four binaries. Development involves running each service in Docker with Air for hot reload, but scoped watch configs prevent rebuilding every service when shared code changes.
This Go monorepo approach allows for process-level separation while maintaining a single go.mod file and atomic refactors, making it a suitable choice as long as the applications share a schema and are maintained by a single team.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.