Summary
I am proposing the development of a feature within Wappler that enables us to manage multiple localhost domains across different operating systems (MacOS, Windows, and Linux). This would automate the manual configuration of the hosts file and could potentially introduce a reverse proxy setup for localhost domains for port forwarding and certificates , hence making the management of multiple projects smoother and more efficient.
Basic example
A user interface within Wappler where developers can easily manage their localhost domains. Users should be able to add, list, and remove local domains for their projects.
# Add a new domain
Wappler > Localhost Manager > Add Domain > website1.local /path/to/project
# List all domains
Wappler > Localhost Manager > List Domains
# Remove a domain
Wappler > Localhost Manager > Remove Domain > website1.local
Motivation
Currently, all projects are running on the same local domain and port which creates several issues with browser cookies, cache, DNS, and potentially more. It also causes confusion with password managers and other browser plugins. While you can change this manually automating the process of domain configuration within Wappler would significantly reduce these problems, enhance user experience, and increase efficiency.
Detailed design
This feature could be implemented as a new module within Wapplerās interface. It would leverage OS-level commands to modify the hosts file, and potentially introduce a reverse proxy setup to handle different localhost domains. This would ensure compatibility across different operating systems.
Main alternatives
1. Centralized Localhost Manager
A dedicated interface for managing all localhost domains. This manager would allow users to add, remove, and list domains for each project from a single location.
2. Per-Project Localhost Configuration
Wappler would provide the option to manage localhost domains within the settings of each individual project.
Requirement List
Must Have
- An interface within Wappler that allows users to manage localhost domains.
- Capability to add, list, and remove domains for individual projects.
- Cross-platform compatibility for MacOS, Windows, and Linux.
- Automation of the manual configuration of the hosts file.
Should Have
- The ability to introduce a reverse proxy setup for managing localhost domains to not only handle the local domain but the port in order to avoid given admin privileges for ports below 1024
- Seamless integration with existing local server configurations.
- Comprehensive documentation and tutorials to guide users on how to utilize the new feature.
Could Have
- A centralized localhost manager for a consolidated view and management of all localhost domains across all projects.
- A per-project localhost configuration option for granular control over domain settings.
- A hybrid approach combining both centralized and per-project configurations.
Drawbacks
The main challenge would be ensuring seamless operation across different operating systems. Additionally, this feature might increase the complexity of Wapplerās interface and potentially introduce new bugs. However, the productivity gains for users would outweigh these potential drawbacks.
Other Alternatives
- Refactor Local Server Management : Consider a refactoring of the current local server management. Introducing a section in the resource manager to handle them could streamline the process.
- Central Server Control : A new section where you can control servers for all your projects in a centralised way might be useful to be able to start local servers for different projects.
- Command Line Interface (CLI) Tool : A CLI tool could provide advanced users with more flexibility and automation options.
- External Localhost Manager Integration : Wappler could provide integration with an external localhost manager tool.
Adoption strategy
If the team implements this proposal, they would need to provide detailed documentation and tutorials to help users understand and leverage this new feature effectively. This would probably need to be set as an experimental feature for some time.
Unresolved questions
- How to ensure seamless operation across different operating systems?
- Should we introduce a reverse proxy setup for localhost domains?
- How to design the user interface to provide the best user experience?
- How would this feature interact with the existing local server configurations?
- Would a centralised management system for all local servers be beneficial for the users?