Help us shape the future of Go! Take the 2026 Go Developer Survey

examples

package module
v0.0.0-...-6f14910 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 1 Imported by: 1

README

GraphJin Example Demos

The fastest start needs no clone at all: graphjin serve --demo with no --path extracts the built-in saas-ops demo (SQLite, zero Docker) to ./graphjin-demo and boots it in seconds.

graphjin serve --demo

The directories here are the full set of demos. From a repo clone, point --demo at any of them with --path. Each is a self-contained vertical: one command boots its databases (Docker containers and in-process emulators), applies the schema DDL, seeds data, and starts the server:

graphjin serve --demo --path examples/<name>
# or: make demo DEMO_PATH=examples/<name>

Put a model provider key (OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_APIKEY) in ./.env and --demo switches to the authenticated agentic config. The dev and agentic configs both get the server-side agent, MCP, watches, and managed artifacts from their mode defaults.

Demo Domain Sources Port First boot
coffee-roastery Specialty coffee ops Postgres + BigQuery-emu + TypeScript CodeSQL + workflows 8080 ~1-2 min (postgres pull)
saas-ops — built-in (graphjin serve --demo) SaaS company ops SQLite (zero Docker) + workflows 8083 seconds
corrugated-plant Corrugated-box manufacturing MySQL + BigQuery-emu + Python CodeSQL + JWT roles + workflows 8081 ~2-4 min (mysql pull)
pcb-fab PCB design + fab Postgres + Snowflake-emu + MongoDB + file source + OpenAPI supplier API + TypeScript CodeSQL 8082 ~3-5 min (postgres+mongo pull)
webshop Minimal single-DB starter Postgres 8080 ~1 min

Smoke suites

Every demo ships an end-to-end smoke suite that exercises data queries, saved queries, workflows, watches (create/fire/inbox), the artifact store (including projection caps and locked kinds), structured agent refusals, role-gated control-plane access, and automatic server-first model routing with MCP client fallback:

examples/<name>/scripts/smoke.sh                # base checks
examples/<name>/scripts/smoke.sh --agent-eval   # + agent protocol evals (needs a model key)

The coffee-roastery demo also includes a lexical-versus-semantic catalog comparison. It starts both configurations, uses deterministic embeddings by default, and asserts synonym recall, real relationship paths, exact-match precedence, unrelated-query gating, and zero document embeddings on warm startup:

examples/coffee-roastery/scripts/semantic-smoke.sh
examples/coffee-roastery/scripts/semantic-smoke.sh --agent # deterministic REST agent + Ax/Goja coverage batch
examples/coffee-roastery/scripts/semantic-smoke.sh --live # real provider key required

Run everything in sequence with a summary table (Docker + ./.env required):

make smoke-all
# scripts/demo-smoke-all.sh --only <name> for a single demo

The suites share one harness, lib/smoke-common.sh: transport/assert helpers, dev-header and JWT auth modes, legacy stateful-MCP session helpers, and generic capability suites each demo composes with its own domain checks. Model-resolution checks verify that missing GraphJin-owned provider credentials fail closed with model_credentials_required.

Documentation

Overview

Package examples embeds the curated demo project that ships inside the graphjin binary. `graphjin serve --demo` without --path extracts DefaultDemoFS into ./graphjin-demo so a bare install boots a real, seeded example instead of an empty scaffold.

Index

Constants

View Source
const DefaultDemoRoot = "saas-ops"

DefaultDemoRoot is the directory within DefaultDemoFS that holds the default demo project.

Variables

View Source
var DefaultDemoFS embed.FS

DefaultDemoFS holds the zero-container saas-ops demo: SQLite source, schema DDL, seed script, saved queries, workflows, and configs.

The paths are listed rather than globbed with all:saas-ops, which also swept in demo/ and .graphjin/ — gitignored local runtime state that exists only if somebody ran the demo in their clone. Two builds of the same commit then differed by whether the maintainer had done that, which matters now that the binary's own hash is published as build identity. Extraction already skipped those directories, so nothing needed them; scripts/ is dropped for the same reason it is skipped there — it depends on the surrounding examples tree.

embed_test.go asserts both halves of this: that the excluded state is absent, and that everything the demo actually boots from is present.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
coffee-roastery
tools/embedding-fixture command
Command embedding-fixture serves deterministic OpenAI-compatible embeddings for the coffee-roastery semantic discovery smoke test.
Command embedding-fixture serves deterministic OpenAI-compatible embeddings for the coffee-roastery semantic discovery smoke test.
pcb-fab
mockapi module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL