Go-based ERP system. Currently laying down the foundational plumbing—auth, role-based access control, and multi-tenant company structures—before diving into the actual business logic (accounting, inventory, etc.). Building it with strict typing and schema-first design from day one so it doesn't collapse on itself later. It happens.
- Backend: Go (1.22+), standard
net/httpmux. - API Setup: OpenAPI 3 schema-first, generated strictly via
oapi-codegen. - DB: PostgreSQL (
pgxpool),sqlcfor type-safe queries,goosefor migrations. - Auth: JWT (v5) + bcrypt.
- Other:
viperfor config management,slogfor structured logging, custom OpenAPI validation middlewares.
This isn't a toy CRUD app, but it is still the foundation. The modules currently cover:
Auth & Security
- JWT issuance, password hashing, expiration handling.
- Strict OpenAPI request/response validation middleware (malformed payloads get rejected before hitting the handlers).
User Management & RBAC
- Users, Roles, and Permissions.
- Many-to-many relationship mapping (Assign roles to users, assign permissions to roles).
Core Setup (Multi-tenant prep)
Companiesmodule — basic CRUD for company profiles.
Tooling
traverse.go: A custom context-gathering script to dump the codebase for AI analysis.sqlc.yaml&openapi-config.yamlto regenerate the tedious parts of the codebase.
You'll need a local Postgres instance running.
- Update
config.envwith your actual database credentials. - Run the database migrations:
goose -dir internal/modules/base/migrations postgres "postgres://username:password@localhost:5432/go-erp2?sslmode=disable" up- Fire up the server:
go run main.goIf you change the SQL queries or the OpenAPI spec, you'll need to regenerate the code:
sqlc generate
go generate ./...Since this is an API-first backend, there's a custom black-box testing script test.py in the root. It hammers the API endpoints to validate both happy paths (200/201/204) and unhappy paths (400/404/422 constraint violations). Run it with:
python3 test.pyBeing upfront:
- No frontend yet. It's just a raw API right now. Bring your own UI.