Skip to content

docs: update architecture docs for DI migration (#656)#673

Merged
grunch merged 1 commit intomainfrom
docs/update-di-architecture
Mar 18, 2026
Merged

docs: update architecture docs for DI migration (#656)#673
grunch merged 1 commit intomainfrom
docs/update-di-architecture

Conversation

@mostronatorcoder
Copy link
Contributor

Context

After completing the DI migration (PRs A-F in #656), the documentation needed updates to reflect the new architecture.

Changes

ARCHITECTURE.md

  • New section: Dependency Injection (AppContext)
    • Documents AppContext fields and accessors
    • Shows construction pattern
    • Includes TestContextBuilder usage for testing
  • Updated startup sequence diagram to show AppContext construction
  • Updated module description to mention src/app/context.rs
  • Changed run(keys, client, ln)run(ctx, ln) in diagram

STARTUP_AND_CONFIG.md

  • Updated startup steps 8-10:
    • Step 8: Build AppContext with all dependencies
    • Step 9: start_scheduler(ctx) now receives AppContext
    • Step 10: run(ctx, ln_client) receives AppContext

DEV_FEE.md

  • Updated code example to show new scheduler pattern:
    • job_process_dev_fee_payment(ctx: AppContext)
    • ctx.pool() instead of get_db_pool()

Diff Stats

  • 3 files changed
  • +51 / -7 lines

Related

Closes

This PR completes the documentation updates for the DI migration. After this, #656 can be closed as complete.

## Context

After completing the DI migration (PRs A-F in #656), the documentation
needed updates to reflect the new architecture.

## Changes

### ARCHITECTURE.md
- Added new section: **Dependency Injection (AppContext)**
  - Documents AppContext fields and accessors
  - Shows construction pattern and testing usage
- Updated startup sequence diagram to show AppContext construction
- Updated module description to mention `src/app/context.rs`
- Changed `run(keys, client, ln)` to `run(ctx, ln)` in diagram

### STARTUP_AND_CONFIG.md
- Updated startup steps 8-10:
  - Step 8: Build AppContext with all dependencies
  - Step 9: `start_scheduler(ctx)` now receives AppContext
  - Step 10: `run(ctx, ln_client)` receives AppContext

### DEV_FEE.md
- Updated code example to show new scheduler pattern:
  - `job_process_dev_fee_payment(ctx: AppContext)`
  - `ctx.pool()` instead of `get_db_pool()`

## Related

- Parent cleanup issue: #656
- DI migration PRs: #663, #665, #666, #667, #670, #672
Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grunch grunch merged commit 78c1af2 into main Mar 18, 2026
7 checks passed
@grunch grunch deleted the docs/update-di-architecture branch March 18, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant