feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready #1

Merged
GKaszewski merged 334 commits from v2 into master 2026-05-16 09:42:43 +00:00
2 changed files with 4 additions and 1 deletions
Showing only changes of commit ff82764eb0 - Show all commits

View File

@@ -16,6 +16,7 @@ postgres-federation = { workspace = true }
activitypub = { workspace = true }
activitypub-base = { workspace = true }
nats = { workspace = true }
event-publisher = { workspace = true }
auth = { workspace = true }
sqlx = { workspace = true }
async-nats = { workspace = true }

View File

@@ -5,6 +5,8 @@ use sqlx::PgPool;
use activitypub::ThoughtsObjectHandler;
use activitypub_base::{ApFederationConfig, FederationData};
use domain::{errors::DomainError, events::DomainEvent, ports::EventPublisher};
use event_publisher::EventPublisherAdapter;
use nats::NatsTransport;
use postgres::activitypub::PgActivityPubRepository;
use postgres_federation::{PostgresApUserRepository, PostgresFederationRepository};
use presentation::state::AppState;
@@ -40,7 +42,7 @@ pub async fn build(cfg: &Config) -> Infrastructure {
Some(url) => match async_nats::connect(url).await {
Ok(client) => {
tracing::info!("Connected to NATS at {url}");
Arc::new(nats::NatsEventPublisher::new(client))
Arc::new(EventPublisherAdapter::new(NatsTransport::new(client)))
}
Err(e) => {
tracing::warn!("NATS connect failed ({e}) — falling back to no-op publisher");