How idena-network/idena-rpc works
1. This repository is a single-page React frontend bootstrapped with Create React App. There is no application backend in the repo; the browser app is the main runtime, and any server-side behavior is limited to static file hosting.
2. The app entry path is standard CRA: public/index.html → src/index.js → src/App.jsx. From there, the top-level app assembles the UI from a small set of reusable components under src/Components.
3. The visible UI appears to be centered around RPC/API interaction for a blockchain-style platform. The component names and schema files suggest the app lets users pick an API, construct requests, send them, and inspect the response.
4. The main UI subsystem is split into:
- Header.jsx for the page-level shell/navigation,
- Board.jsx for the primary workspace or selector area,
- RpcRequest.jsx for composing and submitting a request,
- Output.jsx for displaying returned data or errors,
- Contracts.jsx for contract-specific interactions or views.
5. The src/schemas directory is the clearest architectural boundary in the repo. It contains API/domain definitions for:
- accountApi.js
- bcnApi.js
- contractApi.js
- dnaApi.js
- flipApi.js
- ipfsApi.js
- netApi.js
plus shared schema aggregators such as apis.js and contracts.js.
This strongly implies the UI is data-driven: the form/request components likely consume these schema objects to render supported endpoints and parameters.
6. src/globals.js and src/utils.js are the shared support layer. They likely hold cross-cutting constants, request helpers, formatting logic, or shared state used by multiple components and schema modules. In an architecture diagram, these sit underneath the component layer and above the domain schema definitions.
7. The key data flow is:
- user selects an API/contract/function in the UI,
- RpcRequest builds a request from schema metadata,
- the app sends the request to an external RPC/API endpoint,
- the response is normalized and rendered in Output,
- Board/Contracts provide the surrounding navigation or selection context.
This is a client-driven request/response flow, not a server-mediated one.
8. Because the project includes nginx.conf and a Dockerfile, the production deployment is almost certainly a static SPA container: the React build is served by Nginx inside Docker. That means the architectural boundary between “app runtime” and “hosting runtime” is clean: the browser executes React, while Nginx only serves compiled assets and SPA fallback routing.
9. GitHub Actions (.github/workflows/main.yml) provides CI around the frontend build/test pipeline. The visible scripts in package.json and the CRA defaults imply the workflow likely runs install, test, and build checks before deployment or image publishing.
10. src/App.test.js indicates at least basic component-level testing exists, but there is no sign of a separate backend test suite, API mock service, or integration harness in the repo tree. Testing is therefore focused on the React layer.
11. The repo is organized as a presentation-plus-schema frontend rather than a state-management-heavy application. There is no visible Redux/store directory, no router directory, and no data-fetching service layer beyond the request-oriented components and schema files. That suggests a relatively compact app where UI, request composition, and endpoint definitions are the main concerns.
12. For an architecture diagram, the important boxes are:
- Browser SPA entry point,
- top-level React app/component tree,
- schema-driven RPC/request builder,
- output/result viewer,
- external RPC/API endpoints,
- static hosting container via Nginx/Docker,
- CI pipeline in GitHub Actions.
The primary boundary is between the frontend and the external API services it calls directly.
Main entry points: apis.js APIs · App.jsx App · RpcRequest.jsx RPC Request · Board.jsx Board
Components 23
Browser SPA
React app runtime in the browser
- Index HTML · CRA host document loaded by the browser
public/index.html
React UI
Top-level app and reusable components
- Entry · Mounts the React application
src/index.js - App · Assembles the page and top-level UI flow
src/App.jsx - Header · Page-level navigation and framing
src/Components/Header.jsx - Board · Primary selection and workspace area
src/Components/Board.jsx - RPC Request · Builds and submits API/RPC calls
src/Components/RpcRequest.jsx - Output · Renders responses and errors
src/Components/Output.jsx - Contracts · Contract-specific interactions and views
src/Components/Contracts.js - Globals · Cross-cutting constants and shared helpers
src/globals.js - Utils · Common formatting and request support logic
src/utils.js
Schemas
API and contract schema definitions
- APIs · Aggregates available API schema definitions
src/schemas/apis.js - Contracts Schema · Aggregates contract schema definitions
src/schemas/contracts.js - Account API · Account-related RPC/API schema
src/schemas/accountApi.js - BCN API · Blockchain/network API schema
src/schemas/bcnApi.js - Contract API · Contract interaction schema
src/schemas/contractApi.js - DNA API · DNA-related RPC/API schema
src/schemas/dnaApi.js - Flip API · Flip game or app API schema
src/schemas/flipApi.js - IPFS API · IPFS-related API schema
src/schemas/ipfsApi.js - Net API · Network and connectivity API schema
src/schemas/netApi.js
Delivery
Static hosting and CI pipeline
- Nginx · Serves the built SPA and handles fallback routing
nginx.conf - Docker · Builds the static SPA image
Dockerfile - CI Workflow · Runs frontend checks and build in GitHub Actions
.github/workflows/main.yml
External APIs
Remote RPC/API services called by the app
- RPC/API · External blockchain-style endpoints called by the app
Connections 28
- Index HTML → Entry: loads · Browser loads the React entrypoint
- Entry → App: mounts · Bootstraps the root app component
- App → Header: renders · App composes the page shell
- App → Board: renders · App composes the main workspace
- App → RPC Request: renders · App includes request composer UI
- App → Output: renders · App includes result viewer UI
- App → Contracts: renders · App includes contract-specific UI
- Board → RPC Request: drives · Selection context feeds request composition
- Board → Contracts: routes · Workspace can switch into contract views
- RPC Request → APIs: reads · Request builder consumes API metadata
- RPC Request → Contracts Schema: reads · Request builder consumes contract metadata
- Contracts → Contracts Schema: reads · Contract views are schema-driven
- APIs → Account API: includes · Aggregated API definitions
- APIs → BCN API: includes · Aggregated API definitions
- APIs → Contract API: includes · Aggregated API definitions
- APIs → DNA API: includes · Aggregated API definitions
- APIs → Flip API: includes · Aggregated API definitions
- APIs → IPFS API: includes · Aggregated API definitions
- APIs → Net API: includes · Aggregated API definitions
- RPC Request → Utils: uses · Shared helpers support request construction
- Output → Utils: uses · Shared helpers support formatting and normalization
- App → Globals: uses · App uses shared runtime constants
- RPC Request → RPC/API: calls · Sends direct requests to remote endpoints
- Output → RPC/API: shows · Displays responses from remote endpoints
- Docker → Nginx: packages · Container image serves static assets through Nginx
- Nginx → Index HTML: hosts · Static hosting serves the built SPA
- CI Workflow → Docker: builds · CI validates or publishes the frontend container
- CI Workflow → App: checks · CI runs frontend build/test checks