@reactforums/core

The core domain package for reactForums.

This package contains the foundational business logic, contracts, and domain abstractions that power the entire reactForums ecosystem.

It is intentionally framework-agnostic and transport-agnostic.

@reactforums/core does not know about:

  • HTTP
  • WebSockets
  • React
  • Databases
  • ORMs
  • Rendering
  • UI frameworks

Instead, it defines:

  • Domain models
  • CQRS contracts
  • Permission boundaries
  • Events
  • Repositories
  • Services
  • Feature workflows

Responsibilities

The core package is responsible for the business rules surrounding:

  • Forums
  • Threads
  • Posts
  • Users
  • Groups
  • Permissions
  • Moderation
  • Reputation
  • Notifications

Non-Responsibilities

The core package is NOT responsible for:

  • API routing
  • Request parsing
  • Persistence implementation
  • UI rendering
  • Authentication transport
  • Real-time networking

These concerns belong to adapters and platform packages.


Design Goals

Framework Agnostic

The core should be usable from:

  • Browser apps
  • Mobile apps
  • Desktop apps
  • APIs
  • Workers
  • CLIs

without modification.


CQRS First

The system is built around explicit command and query boundaries.

Commands:

  • mutate state
  • emit events
  • enforce business rules

Queries:

  • return optimized read models
  • never mutate state

Event Driven

Important domain actions emit immutable events.

Examples:

  • thread.created
  • post.created
  • thread.locked

Events enable:

  • notifications
  • analytics
  • search indexing
  • real-time updates
  • plugins

without coupling systems together.


Explicit Boundaries

Every feature module owns:

  • its commands
  • its queries
  • its events
  • its services
  • its contracts

Cross-feature coupling should remain minimal.


Package Structure

src/
  forums/
  threads/
  posts/
  users/
  groups/
  permissions/
  moderation/
  reputation/
  notifications/

  events/
  contracts/
  shared/

Architectural Philosophy

reactForums is designed around three core principles:

Structure

Threads and forums are durable knowledge structures.


Conversation

Live interaction should enhance structured discussion, not replace it.


Identity

Users accumulate trust, reputation, and moderation history over time.

Identity is persistent across the platform.


Stability Guarantees