Split web crate into layered modules (api/services/jobs/view) #4

Merged
schaefera merged 1 commit from worktree-srp-refactor-web into main 2026-09-03 11:17:16 +00:00
Collaborator

Summary

Refactors crates/web toward Single Responsibility Principle, aggregating related pieces into directories the way a layered/hexagonal Spring Boot app separates controllers, services, and configuration:

  • api/ — controllers: the #[server] endpoints (articles.rs, feeds.rs) plus the wire-contract DTO (dto.rs)
  • server/services/ — business logic: articles.rs, feeds.rs, reading_events.rs
  • server/jobs/ — background scheduling, renamed from pipeline.rs: scheduler wiring (mod.rs), LLM scoring pass (scoring.rs), affinity decay (affinity_decay.rs)
  • server/config.rs — LLM connection settings (previously inlined)
  • server/mod.rs — infra bootstrap only: tracing init, DB connection, background-job startup
  • app/ — view layer: root App, SubscribeForm, ArticleRow, one component per file

No behavior changes — this is a pure reorganization. The old server.rs, app.rs, and server/pipeline.rs grab-bag files are replaced by the above.

Test plan

  • cargo build -p feedsignal-web --features server
  • cargo clippy -p feedsignal-web --features server --all-targets -- -D warnings
  • cargo check/clippy on the wasm32-unknown-unknown client target (--no-default-features --features web)
  • cargo fmt -p feedsignal-web -- --check

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoXS1ERDGC1P189RqmUxAF

## Summary Refactors `crates/web` toward Single Responsibility Principle, aggregating related pieces into directories the way a layered/hexagonal Spring Boot app separates controllers, services, and configuration: - `api/` — controllers: the `#[server]` endpoints (`articles.rs`, `feeds.rs`) plus the wire-contract DTO (`dto.rs`) - `server/services/` — business logic: `articles.rs`, `feeds.rs`, `reading_events.rs` - `server/jobs/` — background scheduling, renamed from `pipeline.rs`: scheduler wiring (`mod.rs`), LLM scoring pass (`scoring.rs`), affinity decay (`affinity_decay.rs`) - `server/config.rs` — LLM connection settings (previously inlined) - `server/mod.rs` — infra bootstrap only: tracing init, DB connection, background-job startup - `app/` — view layer: root `App`, `SubscribeForm`, `ArticleRow`, one component per file No behavior changes — this is a pure reorganization. The old `server.rs`, `app.rs`, and `server/pipeline.rs` grab-bag files are replaced by the above. ## Test plan - [x] `cargo build -p feedsignal-web --features server` - [x] `cargo clippy -p feedsignal-web --features server --all-targets -- -D warnings` - [x] `cargo check`/`clippy` on the `wasm32-unknown-unknown` client target (`--no-default-features --features web`) - [x] `cargo fmt -p feedsignal-web -- --check` 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LoXS1ERDGC1P189RqmUxAF
claude-bot added 1 commit 2026-09-03 10:03:53 +00:00
Split web crate into layered modules (api/services/jobs/view)
All checks were successful
CI / check (pull_request) Successful in 8m13s
CI / test (pull_request) Successful in 2m36s
CI / audit (pull_request) Successful in 11s
44b9724645
Separates controllers (api/, the #[server] endpoints) from business
services (server/services/), background scheduling (server/jobs/,
renamed from pipeline.rs), infra bootstrap/config (server/mod.rs,
server/config.rs), and view components (app/), each one file per
responsibility instead of the previous server.rs/app.rs/pipeline.rs
grab-bags.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoXS1ERDGC1P189RqmUxAF
schaefera merged commit 9f65ff33b2 into main 2026-09-03 11:17:16 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: schaefera/feedsignal#4
No description provided.