Users, authentication, and address book for ordered-system, extracted from the ordered-backend monolith. Owns user_db (PostgreSQL) — the only service that can issue a JWT.
- Registration and login, issuing stateless JWTs (JJWT, HS256) with custom claims —
userIdandroles— thatordered-gatewayverifies at the edge and every downstream service reads viaordered-commons'JwtClaimsAuthenticationFilter, without any service needing to call back here to check a session. - Roles:
USER/SELLER/ADMIN. Sellers self-promote through a dedicated endpoint (AlreadySellerExceptionguards against re-promoting), which issues a fresh JWT carrying the newROLE_SELLERclaim — the old token stays valid with the old roles until it expires, by design of stateless JWTs. - Address book (
AddressController/AddressService) — the buyer's saved delivery addresses. Note this is distinct from the snapshotted delivery address stored on a placedOrderover inorder-service: editing an address here never rewrites history on past orders.
Base path /api/v1/users, /api/v1/auth, /api/v1/addresses, reached through the gateway. /api/v1/auth/** is public (you can't authenticate with a token you don't have yet); everything else requires one. OpenAPI docs at /v3/api-docs.
Java 21 · Spring Boot 4.1.0 · Spring Security · PostgreSQL + Flyway · JJWT (HS256) · Eureka Client · Spring Cloud Config Client · Micrometer / Prometheus / OpenTelemetry tracing · ordered-commons
git clone https://github.com/ordered-system/ordered-commons.git
(cd ordered-commons && make install)
git clone https://github.com/ordered-system/ordered-user-service.git
cd ordered-user-service
make up
make runRuns on port 9093. Needs ordered-eureka and ordered-config-server reachable — the config server is what supplies the JWT signing secret, so this service and the gateway agree on it. Full stack: ordered-infra.
The Dockerfile needs ordered-commons supplied as an additional build context — build via ordered-infra's compose files rather than a bare docker build ..
make test-unit
make test-integrationRegisterLoginFlowIntegrationTest covers register → login → token issuance end-to-end against a real Testcontainers Postgres.
| Service | Database | Role |
|---|---|---|
| ordered-order-service | PostgreSQL | Orders, cart checkout, payments (Stripe) |
| ordered-product-service | PostgreSQL + Redis | Product catalog, stock reservation |
| ordered-user-service | PostgreSQL | Users, auth, JWT issuance |
| ordered-engagement-service | MongoDB | Reviews, browsing history |
Part of the ordered-system organization.
MIT — see LICENSE.