X-Socials Platform
A four-service distributed social media platform — Node.js API, Next.js frontend, Laravel admin panel, and a FastAPI hybrid AI moderation engine — built end-to-end as an architectural showcase.
Role
Architect & Full-Stack Engineer
Capacity
Solo build
Year
2026
Stack size
23 tools
Overview
X-Socials is a full distributed system built across four independent, production-deployed services. The Node.js/Express API is the platform core: multi-database (MongoDB for social content, SQL for users/tokens), JWT auth with refresh token rotation, BullMQ email queue, per-route rate limiting, Prometheus metrics on a dedicated port, OpenTelemetry tracing, and 390+ Vitest tests with coverage gates. The Next.js 16 frontend consumes the API with server-side rendering, authentication flows, and a social feed with cursor pagination. The Laravel 13 + Inertia.js + React admin panel provides a human moderation review queue, an auto-enforcement scheduler, on-demand content analysis, a full audit trail, and a live operational dashboard surfacing pipeline health metrics. The FastAPI AI moderation engine analyses every post and comment for policy violations using a hybrid pipeline: a local detoxify classifier handles roughly 60% of content for free, passing only the ambiguous middle band (scores 0.15–0.80) to an LLM via OpenRouter with automatic failover. Three enforcement paths — real-time webhook, auto-remove scheduler (≥ 95% confidence), and a daily reconciliation sweep for missed items — ensure content violations are caught within seconds of creation. All four services are containerised with Docker and deployed via GitHub Actions CI/CD.
Responsibilities
- Designed the full distributed system architecture: four independently deployable services with a shared MySQL database as the integration point between FastAPI and Laravel.
- Built the Node.js/Express social platform API with multi-database routing (MongoDB for posts/comments/likes, SQL for users/tokens/OTPs), modular single-action controllers, and a typed BullMQ email queue with exponential backoff.
- Implemented JWT auth with refresh token rotation, email verification, OTP flows, and per-route rate limiting.
- Instrumented the API with OpenTelemetry tracing, Prometheus metrics, and structured Winston logging — enabling Grafana dashboards for production observability.
- Achieved 390+ Vitest tests with 65% statement/function/line coverage gates; all service tests use repo fakes with no real database required.
- Built the FastAPI hybrid AI moderation engine: detoxify local classifier as the pre-filter, escalating only ambiguous content to OpenRouter LLMs with automatic multi-provider failover, cutting paid API calls by ~60%.
- Implemented three enforcement paths: real-time webhook, auto-remove scheduler at ≥ 95% confidence, and a daily reconciliation sweep for items missed during downtime.
- Built the Laravel 13 admin panel with HMAC-signed API calls to Node.js, a human review queue, on-demand content analysis with model escalation, and a full admin_action_logs audit trail.
- Containerised all four services with Docker and deployed via GitHub Actions CI/CD pipelines.
Highlights
- Four independently deployable services with clean service boundaries
- ~60% of content resolved free by detoxify — LLM costs scale sub-linearly with platform growth
- Three-path enforcement: real-time, auto-remove, and daily reconciliation
- Full observability: Prometheus metrics, OpenTelemetry, Grafana, structured logging
- 390+ automated tests with coverage gates
Tech stack
Services in this system
Node.js + Express + TypeScript social platform backend — multi-DB, BullMQ, Prometheus, 390+ tests
Next.js 16 frontend — SSR, auth flows, social feed with cursor pagination
Laravel 13 + Inertia + React admin panel — review queue, auto-enforcement scheduler, audit trail
FastAPI hybrid AI engine — detoxify pre-filter + OpenRouter LLM failover, three enforcement paths