ares/api/mod.rs
1//! HTTP API Handlers and Routes
2//!
3//! This module provides the REST API layer for A.R.E.S, built on the Axum web framework.
4//!
5//! # Module Structure
6//!
7//! - [`api::handlers`](crate::api::handlers) - Request handlers for each endpoint
8//! - [`api::routes`](crate::api::routes) - Route definitions and router configuration
9//!
10//! # API Endpoints
11//!
12//! ## Authentication (`/api/auth`)
13//! - `POST /api/auth/register` - Register new user
14//! - `POST /api/auth/login` - Login and receive JWT token
15//!
16//! ## Chat (`/api/chat`)
17//! - `POST /api/chat` - Send message and receive streaming response
18//! - `GET /api/memory` - Get user memory (facts, preferences)
19//!
20//! ## Conversations (`/api/conversations`)
21//! - `GET /api/conversations` - List user's conversations
22//! - `GET /api/conversations/{id}` - Get conversation with messages
23//! - `PUT /api/conversations/{id}` - Update conversation title
24//! - `DELETE /api/conversations/{id}` - Delete conversation
25//!
26//! ## RAG (`/api/rag`)
27//! - `POST /api/rag/ingest` - Ingest documents into a collection
28//! - `POST /api/rag/search` - Search for relevant documents
29//! - `GET /api/rag/collections` - List collections
30//! - `DELETE /api/rag/collections/{name}` - Delete a collection
31//!
32//! ## Health (`/api/health`)
33//! - `GET /api/health` - Health check endpoint
34//!
35//! # Authentication
36//!
37//! Most endpoints require a valid JWT token in the `Authorization` header:
38//! ```text
39//! Authorization: Bearer <token>
40//! ```
41//!
42//! # OpenAPI Documentation
43//!
44//! When the `swagger-ui` feature is enabled, interactive API documentation
45//! is available at `/swagger-ui/`.
46
47/// Request and response handlers for all API endpoints.
48pub mod handlers;
49/// Router configuration and route definitions.
50pub mod routes;