Skip to content

Commit d29c77c

Browse files
hyperpolymathclaude
andcommitted
Database federation bridge: ArangoDB (game) + VerisimDB (levels)
Add 3 new Elixir modules to the sync server for database federation: - ArangoClient: HTTP client for ArangoDB (document CRUD, AQL, graph traversal) - VerisimClient: HTTP client for VerisimDB (hexad CRUD, text search, VQL) - DatabaseBridge: coordination GenServer with schema validation, health monitoring, and graceful degradation (starts even if DBs are offline) 8 new REST endpoints under /db/ (health, players, topology, query, levels, search). Req library added as sole new dependency. Design document with full 4-tier database comparison table and glossary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 28a068a commit d29c77c

File tree

10 files changed

+2147
-1
lines changed

10 files changed

+2147
-1
lines changed

idaptik-level-architect/docs/design/DESIGN-2026-02-27-database-tier-comparison.adoc

Lines changed: 429 additions & 0 deletions
Large diffs are not rendered by default.

idaptik-level-architect/idaptik-sync-server/config/config.exs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,20 @@ config :idaptik_sync_server, IDApixiTIK.SyncServerWeb.Endpoint,
1818

1919
# Jason as default JSON library for Phoenix
2020
config :phoenix, :json_library, Jason
21+
22+
# ---------------------------------------------------------------------------
23+
# Database Federation — ArangoDB (game data) + VerisimDB (level architect data)
24+
# Dev defaults — overridden by env vars in config/runtime.exs for production.
25+
# ---------------------------------------------------------------------------
26+
27+
# ArangoDB: Joshua's live game data (players, sessions, network topology graph)
28+
config :idaptik_sync_server, IDApixiTIK.SyncServer.ArangoClient,
29+
url: "http://localhost:8529",
30+
database: "idaptik",
31+
user: "root",
32+
password: ""
33+
34+
# VerisimDB: Level architect data (level hexads, version history, similarity search)
35+
config :idaptik_sync_server, IDApixiTIK.SyncServer.VerisimClient,
36+
url: "http://localhost:8080/api/v1",
37+
timeout: 30_000

idaptik-level-architect/idaptik-sync-server/config/runtime.exs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,17 @@ if config_env() == :prod do
3737
http: [port: port, ip: {0, 0, 0, 0}],
3838
url: [host: phx_host, port: port],
3939
secret_key_base: secret_key_base
40+
41+
# ── Database Federation ──────────────────────────────────────────────────
42+
# ArangoDB: Joshua's game data (network topology, players, sessions)
43+
config :idaptik_sync_server, IDApixiTIK.SyncServer.ArangoClient,
44+
url: System.get_env("ARANGO_URL", "http://localhost:8529"),
45+
database: System.get_env("ARANGO_DB", "idaptik"),
46+
user: System.get_env("ARANGO_USER", "root"),
47+
password: System.get_env("ARANGO_PASSWORD", "")
48+
49+
# VerisimDB: Level architect data (level hexads, version history, similarity)
50+
config :idaptik_sync_server, IDApixiTIK.SyncServer.VerisimClient,
51+
url: System.get_env("VERISIM_URL", "http://localhost:8080/api/v1"),
52+
timeout: 30_000
4053
end

idaptik-level-architect/idaptik-sync-server/lib/idaptik_sync_server/application.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ defmodule IDApixiTIK.SyncServer.Application do
1818
IDApixiTIK.SyncServer.GameStore,
1919
IDApixiTIK.SyncServer.GameSessionRegistry,
2020

21+
# Database federation bridge — ArangoDB (game) + VerisimDB (levels)
22+
# Must start after Cache (uses ETS) but before Endpoint (serves requests).
23+
# Starts in degraded mode if either database is unavailable.
24+
IDApixiTIK.SyncServer.DatabaseBridge,
25+
2126
# Phoenix Endpoint — serves WebSocket (channels) + REST API
2227
IDApixiTIK.SyncServerWeb.Endpoint
2328
]

0 commit comments

Comments
 (0)