Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 

Repository files navigation

πŸ”§ TheSocial-Backend

TheSocial-Backend is the backend service for the Swamajik Madhyam ecosystem, built using CQRS (Command Query Responsibility Segregation) and DDD (Domain-Driven Design) principles.
This architecture ensures scalability, clean separation of concerns, and transparency in handling social interactions.


πŸš€ Features

  • βš™οΈ CQRS Pattern β€” Separate read and write models for efficiency and scalability.
  • 🧩 DDD Modules β€” Core business logic structured into domains (Users, Posts, Moderation, Ads, etc.).
  • πŸ›‘οΈ Content Moderation β€” Transparent pipelines with community + AI checks.
  • πŸ”‘ Authentication & Identity β€” Role-based access, optional decentralized identity support.
  • πŸ“Š Open Analytics β€” Privacy-respecting insights, visible to the community.
  • πŸͺ™ Transparent Ads β€” Auditable ad system with clear policies.

πŸ—οΈ Architecture

CQRS Flow

  • Commands β†’ Handle state-changing operations (create post, ban user, etc.).
  • Events β†’ Domain events that trigger reactions across services.
  • Queries β†’ Optimized read models for fast, scalable data access.

DDD Layers

  1. Domain Layer β€” Business rules & aggregates.
  2. Application Layer β€” Use cases, orchestration of commands/queries.
  3. Infrastructure Layer β€” Database, message bus, external integrations.
  4. API Layer β€” GraphQL/REST interface for apps.

πŸ“‚ Repository Structure (example)

the-social-backend/
β”œβ”€β”€ apps/
β”‚ └── api-gateway/ # API (GraphQL/REST) entrypoint
β”‚
β”œβ”€β”€ modules/
β”‚ β”œβ”€β”€ users/ # User domain (auth, profiles, roles)
β”‚ β”œβ”€β”€ posts/ # Posts & feeds domain
β”‚ β”œβ”€β”€ moderation/ # Moderation domain
β”‚ β”œβ”€β”€ ads/ # Advertisement domain
β”‚ └── analytics/ # Analytics & reporting domain
β”‚
β”œβ”€β”€ libs/
β”‚ β”œβ”€β”€ shared-kernel/ # Shared types, events, utilities
β”‚ └── infrastructure/ # DB, cache, message bus
β”‚
β”œβ”€β”€ database/ # Migrations & schemas
β”œβ”€β”€ docker/ # Deployment configs
└── README.md

πŸ› οΈ Tech Stack


🀝 Contributing

  1. Fork this repository and clone it locally.
  2. Install dependencies with npm install or yarn.
  3. Start services using docker-compose up.
  4. Use nx serve api-gateway to run the API locally.
  5. Submit issues or PRs to improve the backend.

πŸ“œ License

Licensed under Open Source principles β€” transparent, auditable, and community-driven.

About

A CQRS + DDD based backend powering the Swamajik Madhyam open-source social media ecosystem.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors