SMTP-EDC Wails UI Conversion Plan
Executive Summary
This document outlines the technical plan for converting SMTP-EDC from a CLI-only tool to a cross-platform desktop application using the Wails framework. The conversion will maintain all existing functionality while providing an intuitive graphical user interface.
Current State Analysis
Existing Architecture
- Core Engine: Go-based SMTP client with comprehensive features
- Interface: Command-line only
- Dependencies: Pure Go with minimal external dependencies
- Platforms: Cross-platform (Windows, macOS, Linux)
Key Components
- Authentication System (
internal/auth/
)
- PLAIN, LOGIN, CRAM-MD5, OAuth2 support
- Rate limiting and security features
- Message Handling (
internal/message/
)
- Template system
- Attachment support
- MIME handling
- Validation
- SMTP Client (
internal/client/
)
- Protocol implementation
- TLS/STARTTLS support
- Debug/verbose modes
- Configuration (
internal/config/
)
- YAML-based configuration
- Command-line argument parsing
- Security (
internal/security/
)
- Credential management
- TLS configuration
- Logging
Wails Conversion Strategy
Phase 1: Foundation Setup (Week 1)
- Initialize Wails Project
- Create new Wails v2 project structure
- Choose frontend framework (React with TypeScript recommended)
- Set up build configuration
- Restructure Existing Code
- Move existing Go code to Wails app structure
- Create Wails context-aware service layer
- Implement Wails bindings for core functionality
- Define API Contract
- Create service interfaces for Wails bindings
- Define data structures for frontend communication
- Implement error handling patterns
Phase 2: Core UI Development (Weeks 2-3)
- Main Application Shell
- Navigation structure
- Theme implementation (using specified colors)
- Responsive layout system
- Connection Configuration Panel
- Server settings (host, port, security)
- Authentication configuration
- Connection testing capabilities
- Message Composition Interface
- Rich text editor for email body
- Template selection and management
- Attachment handling with drag-and-drop
Phase 3: Advanced Features (Week 4)
- Testing and Debug Interface
- Real-time SMTP transaction display
- Log viewer with filtering
- Connection diagnostic tools
- Configuration Management
- Settings panels
- Profile management
- Import/export functionality
- Results and Analytics
- Test result visualization
- Performance metrics
- History tracking
Phase 4: Polish and Integration (Week 5)
- User Experience Refinements
- Keyboard shortcuts
- Context menus
- Status indicators
- Error Handling and Validation
- Form validation
- Error message system
- Recovery mechanisms
- Documentation and Help
- In-app help system
- Tooltips and guidance
- Tutorial flow
Technical Architecture
Frontend Architecture
frontend/
├── src/
│ ├── components/
│ │ ├── Connection/
│ │ ├── Message/
│ │ ├── Testing/
│ │ └── Settings/
│ ├── services/
│ │ ├── api.ts # Wails bindings
│ │ ├── validation.ts # Client-side validation
│ │ └── storage.ts # Local storage management
│ ├── types/
│ │ ├── smtp.ts # Type definitions
│ │ └── ui.ts # UI-specific types
│ └── styles/
│ ├── theme.css # Color scheme implementation
│ └── components.css # Component styles
Backend Integration
app/
├── app.go # Main Wails application
├── services/
│ ├── smtp_service.go # SMTP operations wrapper
│ ├── config_service.go # Configuration management
│ ├── template_service.go # Template operations
│ └── auth_service.go # Authentication handling
└── models/
├── smtp_models.go # Data transfer objects
└── ui_models.go # UI-specific models
Design System
Color Palette
- Primary: #FFFFFF (backgrounds, main text)
- Secondary: #253238 (navigation, headers, borders)
- Accent: #FF7C1A (buttons, highlights, active states)
Typography
- Headers: Inter/System UI, weights 600-700
- Body: Inter/System UI, weights 400-500
- Code: JetBrains Mono/Monaco for logs and debugging
Component Library
- Forms and Inputs
- Text inputs with validation
- Dropdowns and selects
- Toggle switches
- File upload areas
- Data Display
- Tables with sorting/filtering
- Code blocks with syntax highlighting
- Progress indicators
- Status badges
- Navigation
- Sidebar navigation
- Tab components
- Breadcrumbs
- Context menus
Development Workflow
Setup Phase
- Install Wails v2
- Create new project with React/TypeScript template
- Set up development environment
- Configure build scripts
Migration Strategy
- Service Layer First: Create Wails-compatible service wrappers
- Core Features: Implement basic SMTP testing functionality
- Advanced Features: Add debugging, templates, etc.
- Polish: UI/UX improvements and testing
Quality Assurance
- Unit Testing: Go backend services
- Integration Testing: Wails binding functionality
- E2E Testing: Full application workflows
- Cross-Platform Testing: Windows, macOS, Linux
Key Challenges and Solutions
Challenge 1: CLI to GUI Paradigm Shift
Solution: Maintain CLI functionality as a backend service, expose through Wails bindings
Challenge 2: Real-time SMTP Transaction Display
Solution: Implement WebSocket-like communication through Wails events
Challenge 3: File Management (Templates, Attachments)
Solution: Use Wails file system APIs with secure file handling
Challenge 4: Configuration Migration
Solution: Automatic detection and migration of existing YAML configs
Success Metrics
Functional Requirements
User Experience Requirements
Technical Requirements
Timeline
Total Duration: 5 weeks
- Week 1: Foundation and architecture setup
- Week 2: Core UI components and basic functionality
- Week 3: Advanced features and testing interface
- Week 4: Configuration management and polish
- Week 5: Testing, documentation, and release preparation
Risk Mitigation
Technical Risks
- Wails Learning Curve: Allocate extra time for framework familiarization
- Performance Issues: Profile early and often
- Cross-Platform Compatibility: Test on all platforms throughout development
Project Risks
- Scope Creep: Maintain strict feature parity with CLI version initially
- Timeline Pressure: Prioritize core functionality over nice-to-have features
- User Adoption: Maintain CLI version alongside GUI for gradual migration
Next Steps
- Immediate Actions
- Set up Wails development environment
- Create project structure
- Design mockups for key screens
- Week 1 Deliverables
- Working Wails application shell
- Basic SMTP service integration
- Initial UI components
- Validation Points
- End of Week 1: Technical architecture validation
- End of Week 3: Feature completeness review
- End of Week 5: User acceptance testing
This plan provides a structured approach to converting SMTP-EDC to a modern desktop application while maintaining its robust functionality and adding significant user experience improvements.