PS027

System architecture

How each required microservice is realised, and how they communicate.


  Browser ──► API Gateway (routing, protected area)
                 │
                 ├──► Auth Service ── issues JWT ──► every request is token-verified
                 │
                 ▼
          Complaint Service ──(event: created / status_changed)──┐
                 │                                               │
                 ▼                                               ▼
          Assignment Service ──(event: assigned)──────► Notification Service
                                                                 │
                                                  realtime push  ▼
                                                     in-app alerts (customer & agent)

API Gateway

Single ingress & routing

All browser traffic enters through one routed web entry point. Routes are split into public pages and a protected area that rejects unauthenticated requests before any data loads.

Auth Service

JWT issuance & validation

Email/password and Google sign-in issue signed JWT access tokens. Every data request carries the token; the database verifies it and applies role-based row-level policies (customer, agent, admin).

Complaint Service

Logs issues, owns lifecycle

Owns the complaints table and lifecycle states (open → assigned → in progress → resolved → closed / reopened). Inserting a complaint emits a 'created' event.

Assignment Service

Routes tasks to departments

Owns assignments and departments. Creating an assignment updates the complaint's department/agent and moves it to 'assigned', then emits an 'assigned' event.

Notification Service

Alerts users on updates

Consumes events from the other services and writes notifications for customers and agents. Delivered instantly via a realtime push channel to the in-app bell.

Discovery & load balancing

Eureka equivalent

Services are addressed by name inside the managed platform; the edge runtime auto-scales stateless instances and balances traffic, so support surges never need manual registration.

The full write-up, including a Spring Boot / Eureka reference mapping, test plan and deployment steps, lives in docs/ARCHITECTURE.md.