How hyphae/apis-web works
Project type and purpose
• apis-web is a Java‐based backend service (no UI) that exposes HTTP APIs to supply power-interchange and hardware status data.
• It uses Vert.x for a non-blocking HTTP server and Hazelcast for clustering.
• It connects to multiple apis-main nodes (Grid Master + members) to gather DC/DC converter, battery RSoC, and power-interchange info.
• It also includes “emulator” modules for generating test deals and errors.
File structure to derive components
• src/main/java/jp/co/sony/csl/dcoes/apis/tools/web/ApiServer.java
→ The Vert.x HTTP server entry point
• src/main/java/.../api_handler/DealGeneration, ErrorGeneration, LogConfiguration
→ Core business‐logic handlers for specific endpoints
• src/main/java/.../web/BudoEmulator.java & EmulatorEmulator.java
→ Modules that simulate/generate test data
• src/main/resources + exe/
→ Configuration files (config.json, cluster.xml) and start/stop scripts
• pom.xml & assembly scripts
→ Build/distribution pipeline (Maven assembly to bundle exe/)
README for architectural clues
• Describes a cluster formed by Vert.x + Hazelcast to talk to multiple apis-main nodes
• Caller is a “Web service (visualization, etc.)” that hits apis-web’s HTTP endpoints
• Configurable via JSON/XML in the exe folder
Main components
a. External Client(s)
– Web UI / Visualization Service / CLI
b. apis-web API Server (Vert.x)
– Vert.x Event Loop & HTTP Router
– Loads config.json & cluster.xml at startup
c. API Handlers (DealGeneration, ErrorGeneration, LogConfiguration)
d. Emulator Modules (BudoEmulator, EmulatorEmulator)
e. Cluster Manager (Hazelcast instance)
f. External apis-main Node Cluster
– Grid Master + worker nodes on Ethernet
g. Build & Deployment
– Maven / Groovy scripts, assembly plugin, exe folder with start.sh / stop.sh
Relationships and data flow
• Client → HTTP request → ApiServer
• ApiServer → routes to appropriate API Handler or Emulator
• Handler → invokes Cluster Manager APIs to fetch data from apis-main nodes
• Cluster Manager ↔ Hazelcast network calls ↔ apis-main Node Cluster
• Handler responses → ApiServer → back to Client
• Emulators can bypass real nodes and generate synthetic data for debug
• Configuration files feed both ApiServer and Cluster Manager on startup
Highlighted architectural patterns
• Reactive, non-blocking HTTP layer (Vert.x)
• Peer-to-peer clustering (Hazelcast) for service discovery & data distribution
• Modular handler pattern for each API endpoint
• Externalized configuration for easy re-deployment
• Assembly/distribution via Maven assembly plugin and shell scripts
Final checklist
• [ ] All main components included and labeled
• [ ] Configuration sources and build/deploy scripts shown
• [ ] Call out protocols (HTTP, Hazelcast messaging) explicitly