2025-05-02 14:58:33 +00:00
# Project Simplification Plan
2025-05-01 11:48:04 +00:00
2025-05-02 14:58:33 +00:00
This document outlines a roadmap to simplify and refactor the SmartProxy & NetworkProxy codebase for better maintainability, reduced duplication, and clearer configuration.
2025-05-02 11:19:14 +00:00
2025-05-02 14:58:33 +00:00
## 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
2025-05-02 11:19:14 +00:00
2025-05-02 14:58:33 +00:00
## 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
- [ ] Unify configuration options:
- [x] 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
2025-05-02 11:19:14 +00:00
2025-05-02 14:58:33 +00:00
Once these steps are complete, the project will be cleaner, easier to understand, and simpler to extend.