smartproxy/readme.plan.md

1.6 KiB

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

  • Extract all shared interfaces and types (e.g., certificate, proxy, domain configs) into a common ts/common module
  • Consolidate ACME/Port80Handler logic:
    • Merge standalone Port80Handler into a single certificate service
    • Remove duplicate ACME setup in SmartProxy and NetworkProxy
  • Unify configuration options:
    • Merge INetworkProxyOptions.acme, IPort80HandlerOptions, and port80HandlerConfig into one schema
    • Deprecate old option names and provide clear upgrade path
  • Centralize plugin imports in ts/plugins.ts and update all modules to use it
  • 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.