- Update claude_bot_acp.rs with personality-focused query - Update workflow_coding_agent.rs context - Update all domain client_server.rs examples - Add network domain schema updates (Farm, Contract, VDC types) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| data/mock | ||
| docs | ||
| examples | ||
| sdk | ||
| specs/schemas | ||
| src | ||
| static | ||
| tests | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
HeroOsis
A human-centric backend server entirely generated from schema definitions using OSIS (Object Storage with SmartID).
Quick Start
make run # Build and run server
make dev # Run with debug logging
make help # Show all available commands
Server runs at http://127.0.0.1:3377/api:
- RPC endpoints:
/api/hero_osis/{domain}/rpc - DB Inspector:
/api/hero_osis/{domain}/inspector
How It Works
HeroOsis is built on a schema-first architecture. All types, storage, RPC handlers, and documentation are auto-generated from .oschema files in specs/schemas/.
specs/schemas/{domain}/*.oschema → build.rs → Generated Code
↓
┌────────────────────┼────────────────────┐
↓ ↓ ↓
src/{domain}/ sdk/rust/src/ docs/schemas/
- types_generated.rs - client code - API docs
- rpc_generated.rs
- osis_server.rs
The herolib-osis crate handles:
- OSchema parsing - Schema language for defining types
- Code generation - Rust structs, builders, CRUD methods
- Storage - Filesystem-based with SmartID identifiers
- Full-text search - Tantivy-powered indexing
- RPC server - JSON-RPC endpoints per domain
Example Schema
# specs/schemas/business/company.oschema
Company = {
sid: sid # SmartID (auto-generated)
name: str [rootobject] # Marks as storable type, indexed
description?: str [index] # Optional, full-text indexed
website?: str
country?: str
active: bool
tags: [str]
}
Running cargo build generates:
Companystruct with all fieldsOsisBusinesshandler with CRUD methods- RPC endpoint at
/api/hero_osis/business/rpc - SDK client code
Domains
Domains are logical groupings of related types. Each domain compiles independently via feature flags.
| Domain | Description |
|---|---|
calendar |
Events, planning, scheduling |
files |
Documents, folders, sharing |
finance |
Money, payments, transactions |
communication |
Messages, channels, notifications |
identity |
Profiles, sessions, contacts |
projects |
Tasks, issues, requirements |
code |
Source code, changes, releases |
business |
CRM, deals, contracts |
network |
Network nodes, marketplace |
settings |
User preferences |
Environment Variables
| Variable | Default | Description |
|---|---|---|
HERO_OSIS_BIND |
127.0.0.1:3377 |
Server bind address |
HERO_OSIS_DATA_DIR |
~/hero/var/hero_osis/data |
Data directory |
HERO_OSIS_SEED_DIR |
- | Seed directory for auto-seeding |
Seeding Data
make seed # Seed from ./data/mock
Seed files are TOML with a _type field:
_type = "Company"
name = "ACME Corporation"
country = "US"
active = true
Important: For types with nested objects (like Theme), all top-level fields must come BEFORE [section] headers. See Seeding Documentation for details and common pitfalls.
RPC Usage
curl -X POST http://127.0.0.1:3377/api/hero_osis/business/rpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"company.list","params":{}}'
Methods: {type}.new, {type}.get, {type}.set, {type}.delete, {type}.list, {type}.find
Adding a New Domain
- Create schemas in
specs/schemas/{domain}/*.oschema - Add feature flag to
Cargo.toml - Register domain in
build.rs - Add handler in
src/bin/server.rs - Run
cargo build
Resources
- OSIS Documentation - Full OSIS reference
- OSchema Specification - Schema language details
- Seeding Documentation - Mock data seeding guide and TOML pitfalls
- SDK Documentation - Rust client library
License
Apache-2.0