Hero - the sovereign everything app
Find a file
2026-02-04 00:44:05 +00:00
.cargo chore: update local dev config example and adjust heroforge dependency 2026-01-30 21:12:50 -05:00
.forgejo/workflows ci: use rustfmt directly on all .rs files 2026-02-03 19:23:57 -05:00
_archive/mock fix: resolve compilation errors in examples and SDK 2026-01-23 16:53:14 +01:00
data/mock fix: add remaining required fields to mock data 2026-01-26 15:05:16 +01:00
docs fix: resolve build errors for network domain 2026-02-03 18:57:33 -05:00
examples/rust style: apply cargo fmt to all generated and example code 2026-02-03 19:08:31 -05:00
scripts refactor: reorganize project structure and improve Makefile 2026-01-26 09:05:51 +01:00
sdk fix: resolve build errors for network domain 2026-02-03 18:57:33 -05:00
specs refactor(network): sort TOSORT schemas into network domain 2026-02-03 19:33:52 -05:00
src refactor(network): sort TOSORT schemas into network domain 2026-02-03 19:33:52 -05:00
static icons 2026-01-26 10:12:25 +01:00
tests chore: rename herozero-server -> hero_zero (binary, package, CI) 2026-01-29 18:59:35 -05:00
.DS_Store fix make dev and regenerate sdk with fixes 2026-01-26 10:54:23 +01:00
.env.example fix: resolve compilation errors in examples and SDK 2026-01-23 16:53:14 +01:00
.gitignore refactor: switch herolib path deps to git URL dependencies 2026-01-30 11:23:30 -05:00
build.rs chore: rename herozero-server -> hero_zero (binary, package, CI) 2026-01-29 18:59:35 -05:00
Cargo.toml fix: resolve build errors for network domain 2026-02-03 18:57:33 -05:00
LICENSE Initial commit 2026-01-09 21:39:18 +00:00
Makefile chore: rename herozero-server -> hero_zero (binary, package, CI) 2026-01-29 18:59:35 -05:00
README.md refactor: reorganize project structure and improve Makefile 2026-01-26 09:05:51 +01:00
README_FAVICON.md icons 2026-01-26 10:12:25 +01:00

HeroZero

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/herozero/{domain}/rpc
  • DB Inspector: /api/herozero/{domain}/inspector

How It Works

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

  • Company struct with all fields
  • OsisBusiness handler with CRUD methods
  • RPC endpoint at /api/herozero/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

Project Structure

hero0/
├── specs/schemas/     # Schema definitions (.oschema files)
├── src/{domain}/      # Generated types and handlers
├── sdk/rust/          # Generated Rust SDK
├── data/mock/         # Seed data (TOML files)
├── data/              # Runtime data (gitignored)
└── tests/             # E2E tests

Environment Variables

Variable Default Description
HEROZERO_BIND 127.0.0.1:3377 Server bind address
HEROZERO_DATA_DIR ~/hero/var/hero0/data Data directory
HEROZERO_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

RPC Usage

curl -X POST http://127.0.0.1:3377/api/herozero/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

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

Resources

License

Apache-2.0