4 releases
Uses new Rust 2024
| new 0.2.2 | Feb 6, 2026 |
|---|---|
| 0.2.0 | Jan 27, 2026 |
| 0.1.1 | Dec 28, 2025 |
| 0.1.0 | Dec 28, 2025 |
#681 in Data structures
Used in 4 crates
220KB
4K
SLoC
ceres-core
The foundation of Ceres.
This crate provides the core building blocks: types, errors, configuration, and data models used throughout the project.
What it provides
- Core Types & Errors: Fundamental data structures and error definitions.
- Configuration: Environment settings and database configuration.
- Data Models: Domain models like Dataset and Portal.
lib.rs:
Ceres Core - Domain types, business logic, and services.
This crate provides the core functionality for Ceres, including:
- Domain models:
Dataset,SearchResult,Portal, etc. - Business logic: Delta detection, statistics tracking
- Services:
HarvestServicefor portal synchronization,SearchServicefor semantic search,ExportServicefor streaming exports - Traits:
EmbeddingProvider,DatasetStore,PortalClientfor dependency injection - Progress reporting:
ProgressReportertrait for decoupled logging/UI
Architecture
This crate is designed to be reusable by different frontends (CLI, server, etc.). Business logic is decoupled from I/O concerns through traits:
Server Development Notes (ceres-server)
TODO(server): Use utoipa for automatic OpenAPI documentation
When creating ceres-server, use the utoipa crate (compatible with Axum/Actix)
to auto-generate OpenAPI specs from Rust types and handlers via derive macros.
Expose /swagger-ui endpoint for interactive API documentation.
This makes the API immediately usable by frontend developers without reading code.
EmbeddingProvider- abstracts embedding generation (e.g., Gemini API)DatasetStore- abstracts database operations (e.g., PostgreSQL)PortalClient- abstracts portal access (e.g., CKAN API)
Example
use ceres_core::{HarvestService, SearchService};
use ceres_core::progress::TracingReporter;
// Create services with your implementations
let harvest = HarvestService::new(store, embedding, portal_factory);
let reporter = TracingReporter;
let stats = harvest.sync_portal_with_progress("https://data.gov/api/3", &reporter).await?;
// Semantic search
let search = SearchService::new(store, embedding);
let results = search.search("climate data", 10).await?;
Dependencies
~43–60MB
~863K SLoC