TuranBilgi Platform: API, Microservices & Client Applications

(July 2025 - Present)

TuranBilgi is a modern, API-first, multi-client backend platform designed to support complex business workflows alongside high-performance real-time communication. The platform follows a microservices-oriented and event-driven architecture, enabling independent scaling, fault isolation, and long-term extensibility across backend services and client applications.

Platform Overview

TuranBilgi is designed as a unified backend system serving multiple client applications through a shared API layer. All business logic, authentication, authorization, and real-time capabilities are centralized within the platform, ensuring consistency across all consuming clients. The platform consists of two primary backend components:

1. Core Business Microservice

The core microservice is implemented using Node.js (Express.js with TypeScript) and exposes both REST and GraphQL interfaces. It acts as the central business layer of the system and is responsible for domain workflows and transactional operations including:

The following infrastructure is used to handle data:

2. Interaction & Discussion Microservice (Shared Collaboration Layer)

To support structured communication, decision-making, and accountability across all business domains, TuranBilgi includes a dedicated Interaction & Discussion microservice. This service implements a unified, reusable interaction model that enables threaded discussions, contextual replies, moderation workflows, and historical traceability for all major business entities. Rather than embedding isolated comment systems within individual services, TuranBilgi centralizes all collaborative interactions into a shared domain layer, ensuring consistency, scalability, and governance.

Shared Interaction Model:

All major platform entities require structured communication and collaborative workflows:

Entity Purpose Discussion Support
Idea Brainstorming Yes
Support Ticket Problem Solving Yes
Project Coordination Yes
Project App Requirements Analysis Yes
Contract Negotiation Yes
Invoice Billing Questions Yes
Payment Dispute Resolution Yes

These entities share common interaction requirements:

This unified design is referred to internally as the Shared Interaction Model.

Core Responsibilities:

The Interaction & Discussion microservice is implemented using NestJS and provides both REST and GraphQL APIs. It operates independently from the Core Business API and focuses exclusively on collaborative workflows. Key responsibilities include:

  1. Thread & Comment Management
    • Creation and management of discussion threads
    • Hierarchical reply structures
    • Entity-agnostic attachment of discussions
    • Rich metadata support (status, visibility, ownership)
    • Soft deletion and version history
  2. Moderation & Governance
    • User and administrator moderation tools
    • Reporting and review workflows
    • Content visibility control
    • Policy enforcement
    • Abuse detection and escalation pipelines
  3. Accountability & Auditability
    • Immutable activity logs
    • Per-action attribution
    • Historical change tracking
    • Legal and compliance support
  4. API & Developer Interfaces

    The service exposes:

    • REST APIs with OpenAPI (Swagger) documentation
    • GraphQL APIs with Apollo Sandbox support
    • JWT-secured endpoints for client and service access
    • Legal and compliance support

    This dual-interface strategy enables frontend teams to select the most appropriate interaction model for each client application.

Data Management:

The interaction subsystem is optimized for high-volume, write-heavy collaboration workloads.

All discussions are linked to business entities through a generic entity reference model, enabling flexible cross-domain associations without schema coupling.

Event Integration:

The service integrates with the platform’s event-driven infrastructure.

This ensures synchronization between business workflows and interaction state.

Architectural Benefits:

The Interaction & Discussion microservice provides:

It functions as the platform’s unified collaboration and discourse layer.

3. Real-Time Communication, Notification & Audit Processing Microservice

A dedicated NestJS and Socket.IO–based microservice is responsible for managing all real-time communication, notification delivery, and centralized audit projections across the distributed TuranBilgi platform. The service maintains persistent WebSocket connections and exposes REST and GraphQL APIs to support scalable, low-latency client interactions.

Rather than acting as a centralized event authority, this microservice operates as a specialized consumer and processor within a federated, domain-driven event architecture. Each domain service owns its own event production and outbox mechanisms, while this service focuses on real-time delivery, notification orchestration, and audit aggregation.

Core Responsibilities:

1. Real-Time Chat & Collaboration System

The microservice provides a full-featured, managed chat and collaboration subsystem supporting both private and room-based communication.

Administrative & Management APIs

Through REST and GraphQL interfaces, administrators can:

These management capabilities enable controlled, enterprise-grade collaboration environments.

Messaging Features

The chat subsystem supports:

All messaging operations are synchronized across distributed gateways using Kafka and Redis to ensure consistency and fault tolerance.

2. Notification Management System

The platform implements a flexible, event-driven notification system supporting both manual and automated workflows. This microservice acts as the primary notification orchestration and delivery engine, consuming domain events emitted by distributed services and transforming them into user-facing notifications.

Notification Types
Notification Creation Modes

A. Manual (Admin-Driven)
Administrators can:

B. System-Generated (Event-Driven)
Distributed domain services emit notification-related events via their own MongoDB Outbox and Kafka publishing mechanisms for business events such as:

These events are published to Kafka by the originating services and consumed by the notification processors for delivery.

Notification Interaction Tracking

The notification subsystem supports:

This enables accurate notification lifecycle management and user engagement tracking.

3. Centralized Audit Processing

The microservice operates as the centralized audit projection and compliance processing layer for the platform. All domain services emit standardized audit events through their own outbox and event-publishing pipelines. This microservice consumes, validates, and persists these events into an immutable audit log store. Core functions include:

This design and approach preserves domain ownership while enabling unified audit visibility by decoupling other microservices from audit infrastructure.

Distributed Scalability & Coordination:

To support multi-instance deployments and horizontal scaling:

This infrastructure enables independent scaling of producers and consumers while maintaining platform-wide consistency, or ensuring consistent behavior across clusters.

Architectural Benefits:

This microservice is designed to scale independently from core business and interaction microservices and provides:

It functions as the platform’s real-time delivery and compliance projection layer, rather than as a centralized event authority.

Security & Authentication

All API or services use a shared JWT-based authentication model, enabling secure client-to-server and service-to-service communication to simplify identity propagation while maintaining clear trust boundaries between system components.

Testing & Quality Assurance

TuranBilgi adopts a comprehensive, multi-layered automated testing strategy to ensure correctness, reliability, and long-term maintainability across the platform. The testing approach includes:

Testing is implemented using modern, ecosystem-appropriate frameworks (such as Jest, Nock, SuperTest, Vitest, and language-native testing tools) depending on service requirements. This layered testing strategy supports safe refactoring, reduces regression risk, and ensures consistent behavior in a distributed environment.

Containerization & Deployment

The entire ecosystem is containerized under the TuranDocker project. This includes Core Business API, Real-time microservices, PostgreSQL, MongoDB, Redis, Apache Kafka and RabbitMQ. This setup enables fast, repeatable deployments on any Linux VPS and provides a strong foundation for future orchestration with Kubernetes or other container platforms, while remaining fully operational with Docker Compose or Docker Swarm.

Architectural Focus

TuranBilgi emphasizes:

The platform is designed to evolve, allowing additional services, clients (web, mobile, desktop), and integrations to be added without architectural rewrites.

Client Applications

TuranBilgi is a multi-client platform, designed to serve different user experiences through a shared backend infrastructure. Client applications include:

All client applications consume the same TuranBilgi APIs (REST, GraphQL, and WebSockets), ensuring: