No description
  • Rust 71.2%
  • HTML 11.9%
  • Shell 6.4%
  • JavaScript 6.3%
  • TypeScript 3.1%
  • Other 1.1%
Find a file
despiegk 37c440850b
Some checks failed
Test / test (pull_request) Failing after 3s
Test / integration (pull_request) Has been skipped
Test / test (push) Failing after 2s
Test / integration (push) Has been skipped
Build Linux / build-linux (linux-amd64, x86_64-unknown-linux-gnu) (push) Failing after 5m45s
feat: implement UI RPC proxy pattern — JS calls /rpc directly for all operations
Templates now load data client-side via rpc() JS helper instead of server-side Rust handlers.
SDK gains a public call() method for raw JSON-RPC forwarding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 10:24:54 +03:00
.cargo fix: unblock demos, CI correctness, Makefile cleanup 2026-02-06 12:51:17 -05:00
.claude chore: Implement Phase 1 & 3 of OpenRPC refactoring - API spec and client library 2026-01-25 10:32:56 +01:00
.forgejo/workflows refactor: enforce hero crates best practices — SDK Unix socket, dark UI with tabs 2026-02-21 16:27:27 +03:00
_beta started removing heroredis 2026-02-06 23:01:38 +04:00
crates feat: implement UI RPC proxy pattern — JS calls /rpc directly for all operations 2026-02-22 10:24:54 +03:00
deploy/single-vm fix: empty HEROBOOKS_PASSWORD treated as auth enabled 2026-02-10 00:22:43 -05:00
docs fix: rename reserved schema params and regenerate OSIS code 2026-02-19 16:00:43 +01:00
examples fix: align build system with skills, add three-tier CI, fix clippy/fmt 2026-02-18 20:20:24 -05:00
scripts refactor: enforce hero crates best practices — SDK Unix socket, dark UI with tabs 2026-02-21 16:27:27 +03:00
sdk/js Phase 2: Generate webservice server code from oschema 2026-02-09 18:55:51 -05:00
specs fix: rename reserved schema params and regenerate OSIS code 2026-02-19 16:00:43 +01:00
src refactor: enforce hero crates best practices — SDK Unix socket, dark UI with tabs 2026-02-21 16:27:27 +03:00
templates refactor: enforce hero crates best practices — SDK Unix socket, dark UI with tabs 2026-02-21 16:27:27 +03:00
tests/e2e fix: update E2E tests for unified library tree book names 2026-02-13 13:00:35 -05:00
tosort standardize: switch git dep branches to development 2026-02-11 19:45:22 -05:00
.env.example Remove .env loading, adopt source workflow per env_secrets skill 2026-02-07 15:03:11 -05:00
.gitignore feat: internal PDF viewer with consistent UI (#40) 2026-02-13 08:48:52 -05:00
BRANCHING.md docs: add branching strategy for API migration 2026-02-09 18:33:18 -05:00
build.rs refactor: enforce hero crates best practices — SDK Unix socket, dark UI with tabs 2026-02-21 16:27:27 +03:00
build.sh refactor: reorganize ports to 33xx (backend) / 88xx (frontend) scheme 2026-02-01 11:23:01 -05:00
buildenv.sh refactor: enforce hero crates best practices — SDK Unix socket, dark UI with tabs 2026-02-21 16:27:27 +03:00
Cargo.lock Update Rust toolchain to 1.93 and bump dependency versions 2026-02-22 06:17:41 +03:00
Cargo.toml refactor: enforce hero crates best practices — SDK Unix socket, dark UI with tabs 2026-02-21 16:27:27 +03:00
CLAUDE.md feat: unify books_dir into library tree (#46) 2026-02-13 11:43:51 -05:00
DEPENDENCY_ANALYSIS.md feat: add Unix socket HTTP client support infrastructure 2026-02-19 17:06:12 +03:00
DEPENDENCY_FIX_PLAN.md feat: add Unix socket HTTP client support infrastructure 2026-02-19 17:06:12 +03:00
DUAL_SOCKET_SETUP.md feat: add Unix socket HTTP client support infrastructure 2026-02-19 17:06:12 +03:00
install.sh refactor: Rename project from Atlas to Hero Books 2026-01-26 09:27:29 +01:00
LICENSE Initial commit: AtlasServer Rust implementation 2026-01-19 09:05:23 +01:00
Makefile refactor: enforce hero crates best practices — SDK Unix socket, dark UI with tabs 2026-02-21 16:27:27 +03:00
publish.sh Initial commit: AtlasServer Rust implementation 2026-01-19 09:05:23 +01:00
README.md refactor: enforce hero crates best practices — SDK Unix socket, dark UI with tabs 2026-02-21 16:27:27 +03:00
run.sh refactor: reorganize ports to 33xx (backend) / 88xx (frontend) scheme 2026-02-01 11:23:01 -05:00
run_slides.sh Initial commit: AtlasServer Rust implementation 2026-01-19 09:05:23 +01:00
rust-toolchain.toml Update Rust toolchain to 1.93 and bump dependency versions 2026-02-22 06:17:41 +03:00
test_dual_socket.sh feat: add Unix socket HTTP client support infrastructure 2026-02-19 17:06:12 +03:00
TODO.md fix: unblock demos, CI correctness, Makefile cleanup 2026-02-06 12:51:17 -05:00
VISION.md Add VISION.md: Phase 2+ roadmap (oschema, Dioxus, MCP, skills) 2026-02-07 20:31:18 -05:00
WEBSITE.md Initial commit: AtlasServer Rust implementation 2026-01-19 09:05:23 +01:00

Hero Books - Document Management System

A Rust-based document collection management system with CLI, library, and web interfaces for processing markdown-based documentation with support for cross-collection references, link validation, AI processing, vector search, and export to self-contained directories.

# Source your environment variables
source ~/.config/env.sh   # or wherever you keep your secrets

# Build, sync 3 libraries from Forge repos, and run
make run

# Or run the offline demo (7 local example books)
#make demo

# See all available commands
make help

Architecture

Workspace Layout

hero_books/
├── Cargo.toml                       # workspace root
├── Makefile                         # root build automation
├── buildenv.sh                      # project configuration
├── scripts/build_lib.sh             # shared build functions
├── src/                             # root library + server binary
├── templates/                       # Askama HTML templates (dark theme)
├── crates/
│   ├── hero_books_sdk/              # library: types + async Unix socket client
│   ├── hero_books_server/           # binary: OpenRPC daemon (Unix socket only)
│   ├── hero_books_ui/               # binary: Axum+HTML admin panel (uses SDK)
│   └── hero_books_rhai/             # library: Rhai scripting bindings (uses SDK)

Dependency Graph

hero_books_sdk  (no internal deps)
     ↑         ↑          ↑          ↑
     |         |          |          |
  server     CLI        rhai        UI

Ports and Sockets

Component Transport Address
Server (OpenRPC + HTTP) TCP 127.0.0.1:8883
Server (OpenRPC) Unix socket ~/hero/var/sockets/hero_books_server.sock
UI (Admin panel) TCP 127.0.0.1:8884
UI (Admin panel) Unix socket ~/hero/var/sockets/hero_books_ui.sock
Hero Embedder (dependency) Unix socket ~/hero/var/sockets/hero_embedder.sock

Binaries

Binary Source Purpose
hero_books src/main.rs Server daemon (OpenRPC + web UI)
hero_books_server crates/hero_books_server/ OpenRPC daemon (clean crate)
hero_books_ui crates/hero_books_ui/ Axum+HTML admin panel (uses SDK)
hero_books_client src/bin/books.rs CLI client (uses SDK via Unix socket)

Features

  • Collection scanning: Automatically discover collections marked with .collection files
  • Cross-collection references: Link between pages in different collections using collection:page syntax
  • Include directives: Embed content from other pages with !!include collection:page
  • Link validation: Detect broken links to pages, images, and files
  • AI processing: Q&A extraction, semantic search, ontology classification
  • Vector search: Embeddings-powered semantic search via hero_embedder
  • Export: Generate self-contained directories with all dependencies
  • Access control: Group-based ACL via .group files
  • Admin dashboard: Web-based admin panel with settings, logs, and import management
  • PDF generation: Convert books to PDF via Chrome
  • MCP support: Model Context Protocol for AI tool integration

Installation

Install from Binaries

Download the pre-built binary from the Forge package registry:

mkdir -p ~/hero/bin
curl -fsSL -o ~/hero/bin/hero_books \
  "https://forge.ourworld.tf/api/packages/lhumina_code/generic/hero_books/dev/hero_books-linux-amd64"
chmod +x ~/hero/bin/hero_books

Build from Source

git clone https://forge.ourworld.tf/lhumina_code/hero_books
cd hero_books
make build

Install to ~/hero/bin/:

make install

Run Different Documentation Sets

make run              # 3 libraries from Forge repos (36 books, needs network on first run)
make demo             # Local example books (7 books, offline, fast)
make stop             # Stop all services

Environment Variables

This project follows the env_secrets convention. Source your env file before running.

source ~/.config/env.sh
make run

Variables used by Hero Books

Variable Required Purpose
GROQ_API_KEY Yes Groq API for Q&A extraction and AI summary
OPENROUTER_API_KEY Yes OpenRouter API for LLM fallback
SAMBANOVA_API_KEY No SambaNova API for additional LLM provider
GIT_TOKEN No Personal access token for cloning private repos
HEROBOOKS_PASSWORD No HTTP Basic Auth password (username: hero)
HERO_EMBEDDER_URL No Override embedder endpoint (default: Unix socket)
HERO_SECRET No JWT shared secret for hero_auth integration
HERO_AUTH_URL No Hero Auth server URL for admin login

CLI Usage

The hero_books_client CLI talks to a running server via OpenRPC.

# Start server
make run

# List all collections
hero_books_client list

# Scan for collections
hero_books_client scan --path /path/to/docs

# Process for Q&A and embeddings
hero_books_client process my-collection

# Check server health
hero_books_client health

# View OpenRPC schema
hero_books_client discover

# Import from git
hero_books_client import --git-url https://forge.ourworld.tf/mycelium/docs --namespace mycelium

Development

make build        # Build release binaries
make check        # Fast code check
make test         # Run unit tests
make test-all     # Full test suite (fmt, clippy, test, build, smoke, e2e)
make lint         # Run clippy
make fmt          # Format code
make rundev       # Run in debug mode with hot reload
make demo         # Run with local example books

License

Apache-2.0