Skip to content

fmazmz/distributed-chat-ms

Repository files navigation

Distributed Chat

A distributed chat application demonstrating a modern microservice architecture with WebAuthn authentication,
a BFF exposing REST and WebSocket APIs, and federated GraphQL services for user profiles, messaging history, and analytics.

High-Level Overview

architecture-overview

Requirements

  • JDK 25+
  • Docker Engine / Desktop
  • Minikube

Quick start (Minikube Cluster)

  1. Clone project
  2. Build services and deploy to k8s cluster:
./scripts/deploy-minikube.sh
  1. Port forward BFF (and optional services):
What URL
Chat SPA / BFF http://localhost:8080 — needs minikube kubectl -- port-forward svc/bff 8080:8080
Apollo Sandbox (optional) http://localhost:4000 — needs port-forward svc/graphql-router 4000:4000
Kafka UI (optional) http://localhost:8089 — needs minikube kubectl -- port-forward svc/kafka-ui 8089:8080
  1. Register two users (two browsers) and complete the passkey flow.
  2. Invite by UUID: both tabs must show WebSocket Connected.
  3. Accept invite → conversation sidebar loads history via federated GraphQL through the BFF.

BFF → GraphQL

The SPA calls POST /api/v1/graphql: the BFF proxies to Apollo Router with the user’s JWT.

BFF runs in APP_FEDERATED_GRAPH_URL
Minikube http://graphql-router:4000/graphql
Local JVM (bff/) http://localhost:4000/graphql — requires host router (see below)

Optional: host router (Sandbox without port-forwarding the cluster router)

Use when running subgraphs on localhost:8082–8084 via port-forward and Router on your laptop:

./federated-graph/scripts/port-forward-subgraphs.sh   # terminal 1
./federated-graph/scripts/run-router.sh             # terminal 2

About

A distributed chat application demonstrating a modern microservice architecture using Java Spring Boot

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors