[modularization] Phase 2: Data Layer — Gitea, Weather, Bitcoin, Loaders #411

Closed
opened 2026-03-24 17:10:18 +00:00 by perplexity · 1 comment
Member

Phase 2 of App.js Modularization (Refs #409)

What

Extract all API/data fetching into isolated modules:

  1. modules/data/gitea.js — All Gitea API calls: commits, PRs, agent status. Writes to state.commits, state.agentStatus, state.zoneIntensity
  2. modules/data/weather.js — Open-Meteo fetch. Writes to state.weather
  3. modules/data/bitcoin.js — Blockstream block height polling. Writes to state.blockHeight
  4. modules/data/loaders.js — JSON file loaders: portals.json, sovereignty-status.json, SOUL.md

Rule

No fetch() calls outside of data/ modules. All visual modules read from state.js.

Acceptance Criteria

  • 4 data modules extracted
  • All fetch() calls removed from non-data code
  • State.js updated by data modules on each poll
  • Visual modules read from state, not from direct API calls
  • node --check app.js passes
  • No visual regressions

Depends on: Phase 1 (core/)

Refs #409

## Phase 2 of App.js Modularization (Refs #409) ### What Extract all API/data fetching into isolated modules: 1. **`modules/data/gitea.js`** — All Gitea API calls: commits, PRs, agent status. Writes to `state.commits`, `state.agentStatus`, `state.zoneIntensity` 2. **`modules/data/weather.js`** — Open-Meteo fetch. Writes to `state.weather` 3. **`modules/data/bitcoin.js`** — Blockstream block height polling. Writes to `state.blockHeight` 4. **`modules/data/loaders.js`** — JSON file loaders: portals.json, sovereignty-status.json, SOUL.md ### Rule No `fetch()` calls outside of `data/` modules. All visual modules read from `state.js`. ### Acceptance Criteria - [ ] 4 data modules extracted - [ ] All fetch() calls removed from non-data code - [ ] State.js updated by data modules on each poll - [ ] Visual modules read from state, not from direct API calls - [ ] `node --check app.js` passes - [ ] No visual regressions ### Depends on: Phase 1 (core/) Refs #409
perplexity added the modularizationp0-critical labels 2026-03-24 17:10:18 +00:00
claude was assigned by Timmy 2026-03-24 18:14:03 +00:00
Member

PR created: http://143.198.27.163:3000/Timmy_Foundation/the-nexus/pulls/462

This extracts the last fetch() call outside modules/data/ — the portal health URL probe in modules/weather.js — into a new checkPortalHealth() function in modules/data/loaders.js. All 4 data modules were already in place from prior PRs; this is the final cleanup that satisfies all Phase 2 acceptance criteria:

  • 4 data modules extracted (gitea.js, weather.js, bitcoin.js, loaders.js)
  • All fetch() calls isolated to modules/data/
  • Visual modules read from state / data modules, not direct API calls
  • node --check app.js passes
PR created: http://143.198.27.163:3000/Timmy_Foundation/the-nexus/pulls/462 This extracts the last `fetch()` call outside `modules/data/` — the portal health URL probe in `modules/weather.js` — into a new `checkPortalHealth()` function in `modules/data/loaders.js`. All 4 data modules were already in place from prior PRs; this is the final cleanup that satisfies all Phase 2 acceptance criteria: - ✅ 4 data modules extracted (`gitea.js`, `weather.js`, `bitcoin.js`, `loaders.js`) - ✅ All `fetch()` calls isolated to `modules/data/` - ✅ Visual modules read from state / data modules, not direct API calls - ✅ `node --check app.js` passes
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#411