Skip to content

Repository files navigation

user-service

Customer profiles: the name, phone and address attached to an account, and the minimal public view of them.

Responsibilities

  • Owns: the user_profiles row for a given user — first and last name, phone, address — and the public display-name projection derived from it.
  • Does not own: identity. Credentials, username and email uniqueness, the authoritative users table and token issuance all belong to auth-service. The profile references a user id across that boundary with no foreign key.

Tech

Area Technology
Runtime Go 1.27
Transports HTTP only — no gRPC server, no client, no worker
Data PostgreSQL — one table, user_profiles
Platform libraries authmw, dbx, httpx, logger/zapx, migratex, obsx

API

  • Canonical contract: homelab/docs/api/user.md
  • Shared conventions: homelab/docs/api/api.md
  • Surfaces: a public read of one profile plus a JWT-protected read and update of your own profile. There is no create route — profiles arrive just-in-time from the verified token (see Gotchas). HTTP :8080 also carries /health and /ready.

Routes, payloads and error codes live in the contract, so there is one place to change when they change.

Run locally

Prefer the homelab local-stack — the private routes need a signed token, so auth-service has to be running.

Standalone you need PostgreSQL reachable through the DB_* variables:

go run cmd/main.go migrate   # apply schema migrations
go run cmd/main.go seed      # demo profiles — development only, refuses production
go run cmd/main.go           # serve HTTP :8080

Verify

The commands CI runs, so a green local run means a green pipeline:

go build ./...
go test -race ./...
go test -tags=integration ./internal/core/repository/...   # needs Docker (testcontainers)
golangci-lint run

Docs

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages