Files
sxchnge/backend/README.md

40 lines
2.1 KiB
Markdown

# Go backend modules
`backend/` groups independent Go modules. It is not an executable or a Go module.
```text
backend/
├── product/ Customer-facing BFF executable
│ ├── main.go
│ ├── go.mod
│ ├── app/ Startup, composition, HTTP server and health
│ ├── customers/ Customer service, models and Mongo repository
│ ├── auth/ Login/protected HTTP routes, DTOs and configuration
│ ├── sessions/ Session models, refresh storage, cookies and tokens
│ └── verification/ Verification models, configuration and storage
├── notifications/ Internal gRPC notification service and email workers
│ └── interface/ Independent protobuf/client contract module
└── shared/ Reusable library module
├── go.mod
├── database/ Connection, transactions and repository primitives
├── errors/
├── logging/
└── … Generic HTTP, configuration and rate-limit helpers
```
The backoffice BFF belongs in a separate `backend/backoffice/` executable module,
with its own `main.go`, `go.mod`, configuration and operator authentication. It is
not implemented by this customer-BFF bootstrap. Shared infrastructure has no
`main.go` and must not depend on an executable module. The product module uses a
local `replace` for `../shared`; each module has its own dependency manifest.
Run the product with `make run-backend`; see its [run guide](product/README.md).
`make test` runs all backend modules and the frontend. `make lint-backend` checks
all Go modules and their architecture boundaries.
Copied source remains locally owned. See [provenance](PROVENANCE.md), the
[architecture/API plan](../docs/architecture/bff.md) and the
[delivery record](../docs/implementation.md).
Notifications uses shared database and messaging infrastructure. See its [run guide](notifications/README.md) and [protobuf interface](notifications/interface/proto/v1/interface.proto). Generated client bindings are ignored; Make generates them before backend checks.