Backend service (multi-tenant SaaS)
Shimantik ERP (Backend)
Multi-tenant ERP backend handling core business operations — inventory, records and reporting — for multiple client organizations from one codebase.
GoEchoPostgreSQLGORMDocker
Overview
A multi-tenant ERP backend that serves multiple client organisations — inventory, records and reporting — from a single codebase.
Problem
Maintaining a separate deployment per client is expensive; the business needed one system that isolates each tenant's data safely.
Solution
A Go/Echo service with tenant-scoped data access, shared business logic and per-tenant reporting, deployed as a single containerised service.
Architecture
Stateless Go API behind a reverse proxy, PostgreSQL with tenant isolation, and background jobs for report generation.
Database Design
PostgreSQL schema with a tenant_id on core tables, enforced through query scoping and indexes, covering inventory, records and reporting entities.
API Design
Versioned REST API with tenant resolution middleware, role-based authorisation and consistent error envelopes.
Results
- One codebase serves multiple client organisations
- Tenant-scoped data access keeps client data isolated
- Containerised deployment simplified operations
Lessons Learned
- Enforcing tenant scoping at the data layer prevented leaks
- Go's performance kept reporting responsive under load