Back to home
Personal project

ConnectHub — Microservices Backend

Overview

A social-networking backend built to practise production-style microservice architecture end to end.

Architecture

6 independently deployable services — User, Posts, Connections, Notification, API Gateway, Discovery Server.

ConnectHub architecture A client calls the API Gateway, which validates the JWT and routes to the User, Posts, Connections and Notification services, registered with Eureka. Posts and Connections publish to Kafka, which feeds Notification; User and Posts use PostgreSQL and Connections uses Neo4j. Client API Gateway (JWT) User Posts Notification Connections Eureka registry Kafka PostgreSQL Neo4j
ConnectHub services, discovery, messaging and data stores

Highlights

  • Service discovery & routing: Netflix Eureka for discovery; the API Gateway handles routing, load balancing and JWT validation, and passes user context to downstream services in headers.
  • Event-driven notifications: Apache Kafka topics (post-created, post-liked, connection-request) decouple the Notification service for fault tolerance and independent scaling.
  • Polyglot persistence: PostgreSQL for relational data, Neo4j for the connection graph. Database-per-service, with OpenFeign for synchronous calls.
  • Security: stateless JWT authentication, BCrypt password hashing.
  • One-command setup: Docker Compose runs all 6 services plus PostgreSQL, Neo4j and Kafka.

Tech used

  • Java
  • Spring Boot
  • Spring Cloud (Eureka, Gateway, OpenFeign)
  • Kafka
  • PostgreSQL
  • Neo4j
  • JWT
  • Docker Compose