Expand description
§AllSource Core - High-Performance Event Store
A high-performance event sourcing platform built in Rust, following Clean Architecture principles.
§Architecture Overview
The codebase follows a layered Clean Architecture:
┌─────────────────────────────────────────────────────────────┐
│ Infrastructure Layer │
│ (HTTP handlers, WebSocket, persistence, security) │
│ infrastructure::web, infrastructure::persistence, │
│ infrastructure::security, infrastructure::repositories │
├─────────────────────────────────────────────────────────────┤
│ Application Layer │
│ (Use cases, services, DTOs) │
│ application::use_cases, application::services, │
│ application::dto │
├─────────────────────────────────────────────────────────────┤
│ Domain Layer │
│ (Entities, value objects, repository traits) │
│ domain::entities, domain::value_objects, │
│ domain::repositories │
└─────────────────────────────────────────────────────────────┘§Module Organization
- domain: Core business entities, value objects, and repository traits
- application: Use cases, services, and DTOs that orchestrate domain logic
- infrastructure: Concrete implementations (web, persistence, security)
§Quick Start
ⓘ
use allsource_core::{EventStore, Event, IngestEventRequest};
let store = EventStore::new();
let event = Event::from_strings(
"user.created".to_string(),
"user-123".to_string(),
"default".to_string(),
serde_json::json!({"name": "Alice"}),
None,
)?;
store.ingest(event)?;Re-exports§
pub use domain::entities;pub use domain::entities::Event;pub use domain::repositories;pub use application::dto::IngestEventRequest;pub use application::dto::QueryEventsRequest;pub use application::services::AnalyticsEngine;pub use application::services::Pipeline;pub use application::services::PipelineConfig;pub use application::services::PipelineManager;pub use application::services::ProjectionManager;pub use application::services::ReplayManager;pub use application::services::SchemaRegistry;pub use application::services::TenantManager;pub use infrastructure::persistence::CompactionConfig;pub use infrastructure::persistence::CompactionManager;pub use infrastructure::persistence::EventIndex;pub use infrastructure::persistence::ParquetStorage;pub use infrastructure::persistence::SnapshotConfig;pub use infrastructure::persistence::SnapshotManager;pub use infrastructure::persistence::WALConfig;pub use infrastructure::persistence::WriteAheadLog;pub use infrastructure::security::AuthManager;pub use infrastructure::security::Permission;pub use infrastructure::security::RateLimiter;pub use infrastructure::security::Role;pub use infrastructure::web::serve;pub use infrastructure::web::WebSocketManager;pub use error::AllSourceError;pub use error::Result;pub use store::EventStore;
Modules§
- api_v1
- API v1 module re-export
- application
- Layer 2: Application Layer - Application Business Rules
- auth
- Auth module re-export for backward compatibility
- backup
- Backup module re-export
- config
- Config module re-export
- domain
- Layer 1: Domain Layer - Enterprise Business Rules
- error
- Error types for the entire crate
- infrastructure
- Layer 3: Infrastructure Layer - Interface Adapters
- rate_
limit - Rate limiting module re-export
- security
- Advanced security module (anomaly detection, encryption, KMS)
- store
- Main EventStore facade
- tenant
- Tenant module re-export
Macros§
- require_
permission - Helper macro to require specific permission