A clean architecture PyQt GUI application for managing environment variables, env vars, and system environment configuration with comprehensive audit trails, context management, process investigation, and domain-driven design principles. Built with Python, Qt, PyQt6 for cross-platform desktop environment variable management, system administration tools, and development workflow optimization.
This application follows Domain-Driven Design (DDD), Clean Architecture, Hexagonal Architecture, and SOLID design principles for building maintainable, testable software systems:
βββββββββββββββββββββββββββββββββββββββ
β Presentation Layer β PyQt GUI
β (UI Components) β
βββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββ
β Application Layer β Use Cases
β (Business Logic) β
βββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββ
β Domain Layer β Core Business Rules
β (Entities, Value Objects, β
β Domain Services, Events) β
βββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββ
β Infrastructure Layer β External Systems
β (Repositories, Adapters) β
βββββββββββββββββββββββββββββββββββββββ
- Domain-Driven Design: Rich domain model with entities, value objects, and domain services
- Clean Architecture: Dependency inversion with ports and adapters
- SOLID Principles: Single responsibility, open/closed, Liskov substitution, interface segregation, dependency inversion
- Hexagonal Architecture: Isolated business logic with configurable adapters
- CQRS-Style Separation: Read and write operations handled differently where beneficial
- EnvironmentVariable: Represents a single environment variable with name, value, and scope
- EnvironmentContext: Collections of environment variables for specific purposes (development, production, testing)
- AuditEntry: Immutable audit trail entries for compliance and security auditing
- Process: Running system process with PID, name, and metadata
- ProcessEnvironment: Environment variables for a specific running process
- VariableName: Validated environment variable names with identifier rules
- VariableValue: Environment variable values with security masking for sensitive data
- VariableScope: Environment variable scope enumeration (system, user, process)
- ContextName: Validated context names for environment organization
- ProcessId: Process identifier validation and type safety
- ProcessName: Process executable name validation and sanitization
- Variable names must follow identifier naming conventions
- System variables cannot have empty values
- Variables are unique within their scope
- All changes are auditable
- β View environment variables by scope (system, user, process)
- β Create, read, update, delete (CRUD) operations for env vars
- β Edit existing environment variables with validation
- β Delete variables with confirmation dialogs
- β Real-time validation for environment variable names and values
- β Create named contexts for environment variable collections
- β Add/remove environment variables from contexts
- β Switch between different environment contexts (dev, prod, testing)
- β Investigate all running processes for environment variables
- β Process environment variable inspection and analysis
- β System process enumeration with psutil integration
- β Environment variable comparison across processes
- β Export process information to markdown format
- β Complete audit trail for all environment variable changes
- β User tracking and timestamps for compliance
- β Change history per environment variable
- β Audit logging for system administration and security
- β Clean, intuitive PyQt GUI interface
- β Table-based environment variable listing
- β Search and filtering capabilities for env vars
- β Detailed environment variable information display
- β Error handling and user feedback for desktop application
- GUI Framework: PyQt6, Qt6 for cross-platform desktop application development
- Architecture: Clean Architecture, Domain-Driven Design (DDD), Hexagonal Architecture, Ports & Adapters pattern
- Programming Language: Python 3.8+ with type hints and modern Python features
- Testing: pytest framework with comprehensive unit test coverage and TDD practices
- System Integration: psutil library for process inspection, environment variable management, and system administration
- Design Patterns: Repository pattern, Factory pattern, Strategy pattern, Observer pattern
- Development Tools: Git version control, virtual environments, linting, and CI/CD ready
src/
βββ domain/ # Domain layer
β βββ entities/ # Domain entities
β βββ value_objects/ # Value objects
β βββ services/ # Domain services
β βββ repositories/ # Repository interfaces
β βββ ports/ # Port interfaces
β βββ events/ # Domain events
β βββ dtos/ # Data transfer objects
βββ application/ # Application layer
β βββ services/ # Use case implementations
βββ infrastructure/ # Infrastructure layer
β βββ adapters/ # Port implementations
βββ presentation/ # Presentation layer (PyQt)
tests/ # Test suites
docs/ # Documentation
- Python 3.8+
- macOS, Windows, or Linux
# Clone or navigate to project directory
cd /path/to/EnvEditor
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python main.py- Domain First: Define domain concepts, entities, and business rules
- Ports & Adapters: Define interfaces in the domain layer
- Application Services: Implement use cases that orchestrate domain operations
- Infrastructure: Implement adapters that fulfill the port contracts
- Presentation: Update UI to use new application services
- Unit Tests: Domain logic, entities, value objects
- Integration Tests: Repository implementations, external adapters
- End-to-End Tests: Complete user workflows
- Type hints for all public interfaces
- Comprehensive docstrings
- Linting and formatting
- Pre-commit hooks for quality checks
The application uses environment-based configuration:
- Database connections
- External service endpoints
- Security settings
- UI preferences
Configuration is loaded from:
- Environment variables
- Configuration files
- Default values
- Sensitive values are masked in the UI
- Audit trails track all changes
- Permission checks for system-level operations
- Input validation at all boundaries
- No hardcoded secrets
- Persistent storage (SQLite/PostgreSQL)
- Real system environment variable integration
- Import/export functionality
- Context-based variable deployment
- Multi-user collaboration features
- Plugin system for custom validations
Environment Variables: env vars, environment management, system environment, user environment, process environment, environment configuration
Python Development: Python GUI, PyQt6, Qt application, desktop application, cross-platform development, Python tools
Software Architecture: Clean Architecture, Domain-Driven Design, DDD, Hexagonal Architecture, Ports and Adapters, SOLID principles, layered architecture
System Administration: process investigation, system monitoring, environment inspection, audit trails, compliance logging, security auditing
Development Tools: CRUD operations, data validation, search and filter, export functionality, markdown export, clipboard integration
- Unit Testing: Comprehensive test coverage with pytest
- Type Safety: Full type hints throughout codebase
- Code Quality: Linting, formatting, and pre-commit hooks
- Architecture Validation: Clean Architecture principles enforced
# Run all unit tests
python -m pytest tests/
# Run with coverage report
python -m pytest --cov=src tests/
# Run specific test module
python -m pytest tests/unit/test_domain.py- Follow the established architecture patterns
- Add tests for new functionality
- Update documentation
- Ensure all linting passes
- Follow commit message conventions
This project demonstrates clean architecture principles and is provided as educational material.