Complete implementation across all 13 phases: - vault-core: types, YAML frontmatter parsing, entity classification, filesystem ops, config, prompt composition, validation, search - vault-watch: filesystem watcher with daemon write filtering, event classification - vault-scheduler: cron engine, process executor, task runner with retry logic and concurrency limiting - vault-api: Axum REST API (15 route modules), WebSocket with broadcast, AI assistant proxy, validation, templates - Dashboard: React + TypeScript + Tailwind v4 with kanban, CodeMirror editor, dynamic view system, AI chat sidebar - Nix flake with dev shell and NixOS module - Graceful shutdown, inotify overflow recovery, tracing instrumentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
624 B
Rust
28 lines
624 B
Rust
pub mod error;
|
|
pub mod routes;
|
|
pub mod state;
|
|
pub mod ws;
|
|
pub mod ws_protocol;
|
|
|
|
use axum::Router;
|
|
use std::sync::Arc;
|
|
use tower_http::cors::{Any, CorsLayer};
|
|
use tower_http::trace::TraceLayer;
|
|
|
|
pub use state::AppState;
|
|
|
|
pub fn build_router(state: Arc<AppState>) -> Router {
|
|
let cors = CorsLayer::new()
|
|
.allow_origin(Any)
|
|
.allow_methods(Any)
|
|
.allow_headers(Any);
|
|
|
|
let api = routes::api_routes();
|
|
|
|
Router::new()
|
|
.nest("/api", api)
|
|
.route("/ws", axum::routing::get(ws::ws_handler))
|
|
.layer(cors)
|
|
.layer(TraceLayer::new_for_http())
|
|
.with_state(state)
|
|
}
|