Skip to main content

Back to Projects

Project Detail

SocialHub Backend

A modular GraphQL API server implementing a social networking backend: users, follow graph, posts with images, comments, reactions, notifications, direct/group messaging (chatrooms), and real-time subscriptions. Provides a single backend s...

Backend EngineerDuration: 6 monthsType: platform

Key Achievement Metrics

Prisma migrations

8

DB models

11

GraphQL schema types (approx)

~50

Architecture View

Processing state: architecture signal graph is initializing...

Decision Log

Code-first GraphQL with Apollo + graphql-ws

Single source of truth (TypeScript types -> schema), tight integration with NestJS dependency injection and guards.

Trade-off: Faster developer experience and type-safety vs larger generated schema artifact; requires extra care to keep DTOs/resolvers performant (no schema stitching).

Prisma ORM (Postgres) for data layer

Strong TypeScript integration, migration history, and expressive relation modeling. Unique/index constraints (e.g., @@unique([postId, createdById])) encode idempotency rules.

Trade-off: Abstraction simplifies queries but can hide SQL optimizations; for complex reporting queries raw SQL or materialized views may be required.

Redis Pub/Sub for cross-instance subscriptions

Enables multi-instance deployment without in-process pubsub; Redis offers low-latency fan-out and familiar operational model.

Trade-off: Redis cluster adds operational cost; developer must ensure message topology and retention are managed; subscriber reconnection semantics must be hardened.

Architecture Narrative

Challenge

Provides a single backend service that manages social data (profiles, feed, chat, notifications) with realtime updates and strong type safety for clients.

Solution

Monolithic, modular NestJS application using an event-driven style internally (CQRS + EventEmitter) with external real-time delivery via Redis Pub/Sub and GraphQL Subscriptions.

Result

Key measurable signals: Prisma migrations (8), DB models (11), GraphQL schema types (approx) (~50).

Trade-off Matrix

DimensionSelected OptionImpactCompromise
API protocolGraphQL (code-first) + websocket subscriptionsStrong typing, flexible client-driven queries, native realtime pushMore complex server-side resolver performance concerns and over-fetching prevention must be managed
Data accessPrisma ORM on PostgreSQLType-safe queries, fast iteration, migrations versionedComplex analytical queries may need raw SQL or separate OLAP store

What I'd Do Differently

+

Add distributed tracing (OpenTelemetry) and metrics (Prometheus) to correlate GraphQL operations, DB queries, and Redis pub/sub latency.

+

Introduce a durable background job queue (e.g., BullMQ / Redis Streams) for side effects (email, push notifications, heavy denormalizations) to improve resiliency and allow retries with dead-lettering.

Estifanos Kebede

System Engineer & Full Stack Developer

Social

SYSTEM: ESTIFANOS.PORTFOLIO

STATUS: OPERATIONAL

LAST_UPDATED: 2026

© 2026 Estifanos Kebede. Built with precision and intent.