Haithem Mustafa
Loading
Back to projects
TORCH · 2025 — Current

Torch Core Backend

Microservices platform for a business OS

In development · no public link
Overview

The backend powering Torch's business OS: an Nx monorepo of independently deployable Fastify microservices for HR, payroll, email, authentication, notifications, documents, domains, and more. I lead the backend team here, owning architecture, code reviews, and technical direction.

RoleBackend Team Lead
Year2025 — Current
Stack
  • Fastify 5
  • TypeScript
  • Nx Monorepo
  • Prisma
  • PostgreSQL
  • Redis
  • BullMQ
  • WebSockets
  • MinIO
  • Docker
  • OpenTelemetry
The build
  1. 01Architected an Nx + pnpm monorepo of ~20 independently deployable Fastify 5 services (auth, HR, email, notifications, documents, domains, vault, automation, and more), with shared DDD and schema packages so services stay consistent without coupling.
  2. 02Designed an event-driven core: a shared Redis pub/sub event bus lets services react to each other (auth and domain events fan out to the notification engine) without direct calls.
  3. 03Built the HR service as the largest domain — payroll, attendance, leave, and scheduling — over a 130+ model Prisma schema, with ZK Teco biometric device integration.
  4. 04Built email as its own service: IMAP/SMTP with Mailcow, real-time inbox push over WebSockets, and split worker processes for sync, send, and domain-sync so heavy mail work never blocks the API.
  5. 05Designed the auth service as the central identity hub: RS256 JWT, MFA, WebAuthn, SAML and OpenID, Argon2 hashing, and entity/session management consumed by every other service.
  6. 06Built a document center with OCR, e-signatures, retention policies, and templates, and a zero-knowledge vault (encrypted password sync), both backed by MinIO object storage.
  7. 07Containerized every service with hardened multi-stage Docker images (non-root, health checks, graceful SIGTERM) and wired in OpenTelemetry traces and Prometheus metrics across the fleet.
  8. 08Set up the testing strategy: Vitest, TestContainers (Postgres + Redis), and Pact contract tests so services can evolve independently with confidence.
Highlights
Back to projects