No description
  • Rust 99.1%
  • JavaScript 0.5%
  • HTML 0.2%
Find a file
Timur Gordon 0ac1ac0404
Some checks failed
Build and Test / build (push) Failing after 5s
Build and Test / build (pull_request) Failing after 5s
Merge development_home27: HeroRpcServer/HeroUiServer migration
2026-03-18 10:48:43 +01:00
.forgejo/workflows refactor: rename crates to follow hero best practices 2026-03-04 07:42:31 +02:00
crates Merge development_home27: HeroRpcServer/HeroUiServer migration 2026-03-18 10:48:43 +01:00
data feat: add default web-browser device seed for auth login 2026-03-17 23:44:43 -04:00
docs feat: raw JSON-RPC transport, correct binary naming, dual-bind HTTP 2026-02-24 11:54:41 +01:00
examples Phase 2f: Update seed data themes + dashboard CSS for Bootstrap 5.3 2026-03-06 20:04:53 -05:00
schemas feat: add Video and VideoPlaylist to media domain 2026-03-16 00:08:17 -04:00
scripts feat: add stable SIDs to all mock seed files for idempotent seeding 2026-02-11 21:14:53 -05:00
sdk feat: add Video and VideoPlaylist to media domain 2026-03-16 00:08:17 -04:00
src feat: restructure hero_osis to 5-crate workspace 2026-02-23 20:12:05 +01:00
static feat: socket-per-context, hero_osis_ui crate, restructure plan 2026-02-23 18:55:08 +01:00
tests fix: correct e2e test URLs — context is 'root' not 'hero_osis' 2026-02-11 21:50:52 -05:00
.gitignore feat: change default context from hero_osis to root 2026-02-05 09:24:08 +01:00
buildenv.sh refactor: rename crates to follow hero best practices 2026-03-04 07:42:31 +02:00
Cargo.lock Merge development_home27: HeroRpcServer/HeroUiServer migration 2026-03-18 10:48:43 +01:00
Cargo.toml chore: bump rust-version to 1.93 per hero_ecosystem standard 2026-03-04 13:42:58 -05:00
Dockerfile fix: healthcheck uses /api instead of / (root returns 404) 2026-02-09 10:26:50 -05:00
Dockerfile.build Session 9: fix 5 TODOs + AI assistant enhancements 2026-03-17 12:48:00 -04:00
LICENSE Initial commit: Hero Osis OpenRPC Server 2026-02-04 20:23:30 +01:00
Makefile feat: add seed data and fix Cargo deps for hero_osis 2026-03-06 01:18:48 -05:00
README.md refactor: rename crates to follow hero best practices 2026-03-04 07:42:31 +02:00

HeroOsis

A human-centric backend server entirely generated from schema definitions using OSIS (Object Storage with SmartID).

Quick Start

make install  # Build and install to ~/hero/bin
make run      # Start server + UI via zinit
make dev      # Run server with debug logging (no zinit)
make help     # Show all available commands

Architecture

crates/
  hero_osis/          — Core types and domain handlers (library)
  hero_osis_server/   — JSON-RPC server over Unix sockets (binary)
  hero_osis_sdk/      — SDK client library (library)
  hero_osis_ui/       — Admin panel + /rpc proxy (binary)
  hero_osis_examples/ — Example programs and integration tests

Sockets

All services bind exclusively to Unix domain sockets:

Service Socket
Server ~/hero/var/sockets/{context}/hero_osis_server.sock
UI ~/hero/var/sockets/hero_osis_ui.sock

No service opens a TCP port. Access via hero_proxy for HTTP.

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 schemas/.

schemas/{domain}/*.oschema  →  build.rs  →  Generated Code
                                    ↓
               ┌────────────────────┼────────────────────┐
               ↓                    ↓                    ↓
       crates/hero_osis/     crates/hero_osis_sdk/  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

# 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:

  • Company struct with all fields
  • OsisBusiness handler with CRUD methods
  • JSON-RPC methods for the domain
  • 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
base Base types and utilities
ledger Ledger, KVS, DNS, groups
media Photos, songs, media management
ai AI agents, bots, chat services
flow Workflow DAGs for agent intelligence
job Distributed job execution

Environment Variables

Variable Default Description
HERO_OSIS_DATA_DIR ~/hero/var/hero_osis/data Data directory
HERO_OSIS_SEED_DIR - Seed directory for auto-seeding
HERO_CONTEXTS root Contexts to register (comma-separated)

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.

Adding a New Domain

  1. Create schemas in schemas/{domain}/*.oschema
  2. Add feature flag to Cargo.toml
  3. Register domain in build.rs
  4. Add handler in server main.rs
  5. Run cargo build

Resources

License

Apache-2.0