Skip to main content

reifydb_sub_server_admin/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4//! Admin server subsystem for ReifyDB.
5//!
6//! This crate provides an Axum-based HTTP server for web-based administration
7//! of ReifyDB. It integrates with the shared tokio runtime and implements the
8//! transaction ReifyDB `Subsystem` trait for lifecycle management.
9//!
10//! # Features
11//!
12//! - REST API for configuration and metrics
13//! - Authentication support (optional)
14//! - Static file serving for admin UI
15//! - Health check endpoint
16//! - Graceful shutdown support
17//!
18//! # Endpoints
19//!
20//! - `GET /health` - Health check
21//! - `POST /v1/auth/login` - Login
22//! - `POST /v1/auth/logout` - Logout
23//! - `GET /v1/auth/status` - Auth status
24//! - `GET /v1/config` - Get configuration
25//! - `PUT /v1/config` - Update configuration
26//! - `POST /v1/execute` - Execute query
27//! - `GET /v1/metrics` - System metrics
28//! - `GET /` - Admin UI
29//!
30//! # Example
31//!
32//! ```ignore
33//! use reifydb_core::SharedRuntime;
34//! use reifydb_sub_server_admin::{AdminConfig, AdminSubsystem, AdminState};
35//!
36//! // Create shared runtime
37//! let runtime = SharedRuntime::new(4);
38//!
39//! // Create application state
40//! let state = AdminState::new(engine, 1000, Duration::from_secs(30), false, None);
41//!
42//! // Create and start admin subsystem
43//! let mut admin = AdminSubsystem::with_runtime(
44//!     "127.0.0.1:9090".to_string(),
45//!     state,
46//!     Arc::new(runtime),
47//! );
48//! admin.start()?;
49//! ```
50
51#![cfg_attr(not(debug_assertions), deny(warnings))]
52
53pub mod assets;
54pub mod config;
55pub mod factory;
56pub mod handlers;
57pub mod routes;
58pub mod state;
59pub mod subsystem;