The catalogue service in a small microservices backend, built during Scaler’s backend course alongside the user and auth service and the Stripe payment service.
What it does
- REST APIs to list (with pagination), read, create, update and delete products, plus categories, with a controller advice that turns errors into consistent responses.
- Two implementations behind one
ProductServiceinterface: one stores products in MySQL, the other reads them from an external store API and caches them in Redis. - Browsing is public. Adding, updating or deleting a product needs an OAuth2 access token from the user service, checked as a resource server, with roles read from the token’s claims.
How it’s built
- Spring Data JPA over MySQL, with Flyway managing the schema.
- Database, port and token issuer all come from environment variables.