# Project Simplification Plan This document outlines a roadmap to simplify and refactor the SmartProxy & NetworkProxy codebase for better maintainability, reduced duplication, and clearer configuration. ## Goals - Eliminate duplicate code and shared types - Unify certificate management flow across components - Simplify configuration schemas and option handling - Centralize plugin imports and module interfaces - Strengthen type safety and linting - Improve test coverage and CI integration ## Plan - [x] Extract all shared interfaces and types (e.g., certificate, proxy, domain configs) into a common `ts/common` module - [x] Consolidate ACME/Port80Handler logic: - [x] Merge standalone Port80Handler into a single certificate service - [x] Remove duplicate ACME setup in SmartProxy and NetworkProxy - [x] Unify configuration options: - [x] Merge `INetworkProxyOptions.acme`, `IPort80HandlerOptions`, and `port80HandlerConfig` into one schema - [x] Deprecate old option names and provide clear upgrade path - [ ] Centralize plugin imports in `ts/plugins.ts` and update all modules to use it - [x] Remove legacy or unused code paths (e.g., old HTTP/2 fallback logic if obsolete) - [ ] Enhance and expand test coverage: - Add unit tests for certificate issuance, renewal, and error handling - Add integration tests for HTTP challenge routing and request forwarding - [ ] Update main README.md with architecture overview and configuration guide - [ ] Review and prune external dependencies no longer needed Once these steps are complete, the project will be cleaner, easier to understand, and simpler to extend.