-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Phong VΓ΅ edited this page Mar 21, 2026
·
1 revision
NetTool uses the Universe Architecture β a modular plugin system where each tool is a self-contained "civilization" that can be added without modifying existing code.
βββββββββββββββββββ config.json ββββββββββββββββββββ
β WPF UI β βββββββββββββββββββΊ β Go Engine β
β β β β
β ToolRegistry β βββββββββββββββββββ β Command β
β ITool modules β stdout JSON line β Dispatcher β
β Nested tabs β β (switch/case) β
βββββββββββββββββββ ββββββββββββββββββββ
public interface ITool
{
string Name { get; } // Display name
string Icon { get; } // Emoji icon
string Description { get; } // Short description
string Group { get; } // "Web", "Network", "Discovery"
int Order { get; } // Sort order within group
ToolViewModelBase ViewModel { get; }
FrameworkElement CreateView(); // Factory for UI panel
}Base class for all tool ViewModels:
-
OnStart()β called when user clicks Start -
OnEngineOutput(string line)β parse JSON from engine -
OnEngineExited(int exitCode)β cleanup -
RunEngine(string command, string configJson)β launch engine process -
AddLog(string message)β append to log panel
ToolRegistry.Register(new YourTool()); // 1 line to addCreate engine/cmd_yourtool.go:
func runYourTool(configPath string) {
// Read config, do work, emit JSON lines to stdout
}Add to engine/main.go switch:
case "yourtool":
runYourTool(configPath)Modules/YourTool/
βββ YourTool.cs β ITool implementation
βββ YourViewModel.cs β extends ToolViewModelBase
βββ YourPanel.xaml β UI layout
βββ YourPanel.xaml.cs β code-behind (minimal)
In ShellViewModel.cs:
ToolRegistry.Register(new YourTool());Done! Tab appears automatically in the correct group.
Engine β UI communication via JSON Lines on stdout:
{"key": "value", "latency_ms": 12.5}Engine writes diagnostic info to stderr (not parsed by UI).
| Group | Icon | Tools |
|---|---|---|
| Web | π | Load Test, HTTP Headers, SSL Checker, WebSocket |
| Network | π§ | Ping, Traceroute |
| Discovery | π | DNS, Port Scanner, IP Scanner, GeoIP, Whois |
Groups are rendered as nested tabs: outer left sidebar + inner top tabs.