Gut the monolith: remove ~6,050 lines from web.rs
Intent: Strip all handler functions, view-mapping logic, live-streaming infrastructure, API endpoints, auth helpers, chat handlers, webhook processing, and admin handlers out of the single `web.rs` file, replacing them with `include!()` directives that textually re-insert the code from new submodule files at compile time.
Affected files: crates/pika-git/src/web.rs
@@ -786,6076 +786,25 @@ pub async fn serve(
-async fn feed_handler(State(state): State<Arc<AppState>>) -> impl IntoResponse {
+include!("web/views.rs");
+include!("web/pages.rs");
+include!("web/live.rs");
+include!("web/api.rs");
+include!("web/auth.rs");
+include!("web/chat.rs");
+include!("web/webhook.rs");
+include!("web/admin.rs");
+async fn shutdown_signal() {
+#[cfg(test)]
+mod tests;
The original web.rs contained everything: page handlers, view mappers, SSE streams, REST endpoints, auth, chat, webhooks, and admin routes—all in a single file exceeding 6,800 lines.
After this change, web.rs retains only:
- Imports and type/struct definitions (~785 lines)
- The
serve()function that builds the Axum router - Eight
include!()calls that textually embed the extracted submodules - The
shutdown_signal()helper - The
#[cfg(test)] mod tests;declaration
Using include!() rather than proper mod declarations is a deliberate choice: it keeps every extracted function inside the web module's flat namespace, so no item needs pub visibility changes and no call-site needs updating. This makes the split a pure file-organization refactor with zero semantic impact.