A comprehensive network diagnostic toolkit built with Go, featuring a beautiful terminal user interface powered by the Bubble Tea framework.
go install github.com/nettracex/nettracex-tui@latestDownload pre-built binaries from Releases.
git clone https://github.com/nettracex/nettracex-tui.git
cd nettracex-tui
go build -o nettracex .For detailed installation instructions, see INSTALLATION.md.
nettracex-tui/
├── internal/
│ ├── domain/ # Core domain interfaces and types
│ │ ├── interfaces.go # Core business logic interfaces
│ │ ├── types.go # Domain types and value objects
│ │ ├── parameters.go # Parameter implementations
│ │ ├── result.go # Result implementations
│ │ └── *_test.go # Comprehensive unit tests
│ └── config/ # Configuration management
│ ├── config.go # Configuration manager implementation
│ └── config_test.go# Configuration tests
├── go.mod # Go module definition
├── main.go # Application entry point
├── Makefile # Build and development commands
└── README.md # Project documentation
The project follows clean architecture principles with clear separation of concerns:
- Domain Layer: Core business logic interfaces and types
- Application Layer: Use cases and application services (to be implemented)
- Infrastructure Layer: Network clients and external integrations (to be implemented)
- Presentation Layer: TUI components and user interface (to be implemented)
- Single Responsibility: Each interface and type has a single, well-defined purpose
- Open/Closed: Plugin architecture allows extension without modification
- Liskov Substitution: All implementations can be substituted for their interfaces
- Interface Segregation: Small, focused interfaces for different concerns
- Dependency Inversion: High-level modules depend on abstractions
Defines the contract for all network diagnostic tools (ping, traceroute, DNS, WHOIS, SSL).
Abstracts network operations for testing and flexibility.
Represents diagnostic operation results with formatting and export capabilities.
Handles application configuration with validation.
The application uses a hierarchical configuration system:
- Default values
- Configuration file (
~/.config/nettracex/nettracex.yaml) - Environment variables (prefixed with
NETTRACEX_)
- Network: Timeout, DNS servers, retry settings
- UI: Theme, key bindings, animation settings
- Plugins: Enabled/disabled plugins and settings
- Export: Default format and output settings
- Logging: Log level, format, and output settings
- Go 1.21 or later
- Make (for Unix/Linux/macOS) or PowerShell (for Windows)
# Clone the repository
git clone <repository-url>
cd nettracex-tui
# Download dependencies
make deps
# Run tests
make test
# Build the application
make build
# Run the application
make run# Clone the repository
git clone <repository-url>
cd nettracex-tui
# Download dependencies
go mod download
go mod tidy
# Run tests
go test ./...
# Build the application
go build -o bin/nettracex-tui.exe ./cmd/nettracex-tui
# Run the application
./bin/nettracex-tui.exe
# Format code
go fmt ./...
# Vet code for issues
go vet ./...
# Run tests with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# Clean build artifacts
Remove-Item -Recurse -Force bin/ -ErrorAction SilentlyContinuemake build- Build the applicationmake test- Run all testsmake test-coverage- Run tests with coverage reportmake run- Run the applicationmake fmt- Format codemake vet- Vet code for issuesmake lint- Lint code (requires golangci-lint)make clean- Clean build artifactsmake build-all- Cross-platform builds
go build -o bin/nettracex-tui.exe ./cmd/nettracex-tui- Build the applicationgo test ./...- Run all testsgo test -coverprofile=coverage.out ./...- Run tests with coveragego fmt ./...- Format codego vet ./...- Vet code for issuesRemove-Item -Recurse -Force bin/- Clean build artifacts
The project includes comprehensive unit tests for all core components:
# Run all tests
go test ./...
# Run tests with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# Run specific test packages
go test ./internal/domain
go test ./internal/tui
go test ./internal/tools/whois# Run all tests
go test ./...
# Run tests with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# Run specific test packages
go test ./internal/domain
go test ./internal/tui
go test ./internal/tools/whois
# Run tests with verbose output
go test -v ./...
# Run tests multiple times to check for flaky tests
go test -count=3 ./...- PowerShell: Use PowerShell instead of Command Prompt for better Go development experience
- Path Separators: Go handles path separators automatically, but use forward slashes in Go code
- Build Output: Windows executables have
.exeextension automatically added - Environment Variables: Use
$env:VARIABLE_NAMEsyntax in PowerShell for environment variables - Make Alternative: If you prefer Make on Windows, install it via Chocolatey:
choco install make
- Install the Go extension
- Install Go tools when prompted, or run:
Ctrl+Shift+P→ "Go: Install/Update Tools" - Configure settings in
.vscode/settings.json:
{
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.formatTool": "goimports",
"go.lintTool": "golangci-lint",
"go.testFlags": ["-v"],
"go.coverOnSave": true
}- Install the Go plugin
- Configure Go SDK path in Settings → Languages & Frameworks → Go
- Enable Go modules support
- Configure code style and inspections
# Install useful Go tools
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/go-delve/delve/cmd/dlv@latest# Full development cycle
go mod tidy # Update dependencies
go fmt ./... # Format all code
go vet ./... # Check for issues
go test ./... # Run all tests
go build -o bin/nettracex-tui.exe ./cmd/nettracex-tui # Build application
# Testing specific components
go test ./internal/tui -v # Test TUI components
go test ./internal/tools/whois -v # Test WHOIS tool
go test ./internal/domain -v # Test domain layer
# Development with file watching (requires external tool)
# Install: go install github.com/cosmtrek/air@latest
air # Auto-rebuild on file changes
# Debugging
dlv debug ./cmd/nettracex-tui # Debug with Delve# Set Go environment variables (if needed)
$env:GOOS = "windows"
$env:GOARCH = "amd64"
$env:CGO_ENABLED = "0"
# Check Go environment
go env
# Update Go modules
go get -u ./...
go mod tidy✅ Task 1: Project Foundation and Core Interfaces (COMPLETED)
- Go module setup with proper dependencies
- Core domain interfaces following SOLID principles
- Configuration system with validation
- Comprehensive unit tests for all interfaces and types
- Core Interfaces: DiagnosticTool, NetworkClient, Result, Parameters, and supporting interfaces
- Domain Types: NetworkHost, PingResult, TraceHop, DNSResult, WHOISResult, SSLResult, and configuration types
- Parameter System: Type-safe parameter handling for all diagnostic operations
- Result System: Flexible result formatting and export (JSON, CSV, Text)
- Configuration Management: Hierarchical configuration with validation
- Comprehensive Testing: 100% test coverage for all implemented components
The foundation is now ready for implementing the remaining tasks:
- Network client infrastructure with mocking
- Individual diagnostic tool implementations
- Bubble Tea TUI framework setup
- Plugin registry and management system
This project is licensed under the MIT License.