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
3 changed files with 13 additions and 0 deletions
Showing only changes of commit 2524440fe4 - Show all commits

View File

@@ -0,0 +1,10 @@
use axum::{extract::State, Json};
use crate::state::AppState;
pub async fn health_handler(State(s): State<AppState>) -> Json<serde_json::Value> {
let db_ok = s.users.list_with_stats().await.is_ok();
Json(serde_json::json!({
"status": if db_ok { "ok" } else { "degraded" },
"db": if db_ok { "connected" } else { "error" },
}))
}

View File

@@ -1,6 +1,7 @@
pub mod api_keys;
pub mod auth;
pub mod feed;
pub mod health;
pub mod notifications;
pub mod social;
pub mod thoughts;

View File

@@ -16,6 +16,8 @@ use crate::{handlers::*, state::AppState};
pub fn router(fed_config: &ApFederationConfig) -> Router<AppState> {
let api_routes = Router::new()
// health
.route("/health", get(health::health_handler))
// auth
.route("/auth/register", post(auth::post_register))
.route("/auth/login", post(auth::post_login))