Skip to content

Latest commit

 

History

History
293 lines (231 loc) · 7.54 KB

File metadata and controls

293 lines (231 loc) · 7.54 KB

🏗️ System Architecture

Architecture Overview

EasyPostman
├── 🎨 UI Layer
│   ├── Workspace management
│   ├── Collections management
│   ├── Environments configuration
│   ├── History records
│   ├── Performance testing module
│   └── NetworkLog monitoring
├── 🔧 Business Layer
│   ├── HTTP request engine
│   ├── Workspace switching and isolation
│   ├── Git version control engine
│   ├── Environment variable resolver
│   ├── Script execution engine
│   ├── Data import/export module
│   └── Performance test executor
├── 💾 Data Layer
│   ├── Workspace storage management
│   ├── Local file storage
│   ├── Git repository management
│   ├── Configuration management
│   └── History management
└── 🌐 Network Layer
    ├── HTTP/HTTPS client
    ├── WebSocket client
    ├── SSE client
    └── Git remote communication

🛠️ Technology Stack

Core Technologies

  • Java 17: Modern LTS version for latest Java features

    • Records, Sealed Classes, Pattern Matching
    • Enhanced NullPointerException messages
    • Text Blocks for better string handling
  • JavaSwing: Native desktop GUI framework

    • Cross-platform compatibility (Windows, macOS, Linux)
    • Native look and feel
    • No browser overhead
  • jlink & jpackage: Official packaging tools

    • Create custom runtime images
    • Generate native installers (DMG, EXE, DEB)
    • Reduce distribution size

UI Libraries

  • FlatLaf: Modern Swing theme

    • Dark and light mode support
    • HiDPI/Retina display support
    • Native macOS styling
    • Customizable color schemes
  • RSyntaxTextArea: Syntax highlighting editor

    • Support for JSON, XML, JavaScript, HTML
    • Code folding
    • Auto-completion
    • Search and replace
  • jIconFont-Swing: Vector icon font support

    • FontAwesome integration
    • Scalable icons
    • Theme-aware coloring
  • SwingX: Extended Swing components

    • Enhanced tables and trees
    • Date pickers
    • Search panels
  • MigLayout: Powerful layout manager

    • Flexible and intuitive
    • Responsive design support
    • Cross-platform consistency

Network & Communication

  • OkHttp: High-performance HTTP client

    • HTTP/2 support
    • Connection pooling
    • Transparent GZIP compression
    • Response caching
    • Interceptor support
  • WebSocket Support: Real-time communication

    • Full-duplex communication
    • Message framing
    • Ping/pong heartbeat
  • SSE (Server-Sent Events): Server push support

    • Event stream parsing
    • Automatic reconnection
    • Event ID tracking

Script Engine

  • Nashorn (Java 11-14): Legacy JavaScript engine

    • ECMAScript 5.1 support
    • Java interoperability
  • GraalVM JavaScript (Java 17+): Modern JavaScript engine

    • ECMAScript 2021+ support
    • Better performance
    • Polyglot support

Data & Storage

  • JSON Processing:

    • Gson: JSON serialization/deserialization
    • Jackson: Alternative JSON processor
  • XML Processing:

    • Built-in Java XML APIs
    • XPath support
  • File Storage:

    • Local JSON files for collections
    • Environment variable files
    • Git repository integration

Version Control

  • JGit: Pure Java Git implementation
    • Clone, commit, push, pull operations
    • Branch management
    • Conflict detection
    • SSH and HTTPS authentication

Logging

  • SLF4J + Logback: Logging framework
    • Flexible configuration
    • Multiple appenders (console, file, rolling)
    • Performance optimization
    • Async logging support

📦 Build & Packaging

Build Tools

  • Maven: Project management and build automation
    • Dependency management
    • Plugin ecosystem
    • Multi-module support

Packaging Strategy

  1. Cross-platform JAR:

    mvn clean package
    
    • Produces easy-postman-{version}.jar
    • Requires Java 17+ runtime
    • Smallest distribution size
  2. Native Installers:

    • macOS DMG: jpackage with custom icon and background
    • Windows EXE: Inno Setup installer with shortcuts
    • Windows Portable ZIP: Extract and run, no installation
    • Linux DEB: Debian package with desktop integration
  3. Custom Runtime:

    • Use jlink to create minimal JRE
    • Include only required modules
    • Reduce distribution size by ~50%

Recommended Development JDK

💡 JetBrains Runtime (JBR) is recommended for best Swing performance:

  • Better font rendering on all platforms
  • Improved HiDPI support
  • Swing-specific bug fixes
  • Optimized garbage collection for desktop apps

Download: JetBrains Runtime Releases


🔧 Development Workflow

Project Structure

easy-postman/
├── src/main/java/          # Java source code
│   └── com/laker/postman/
│       ├── ui/             # UI components
│       ├── service/        # Business logic
│       ├── model/          # Data models
│       ├── network/        # Network layer
│       └── utils/          # Utilities
├── src/main/resources/     # Resources
│   ├── icons/              # Application icons
│   ├── themes/             # FlatLaf themes
│   ├── js-libs/            # JavaScript libraries
│   └── messages*.properties # i18n files
├── build/                  # Build scripts
│   ├── mac.sh             # macOS packaging
│   ├── win-exe.bat        # Windows installer
│   └── linux-deb.sh       # Linux DEB packaging
└── docs/                   # Documentation

Testing

  • Unit Tests: JUnit 5
  • Integration Tests: TestNG
  • UI Testing: Manual testing with different themes and resolutions

🚀 Performance Optimizations

UI Rendering

  • Lazy loading for large collections
  • Virtual scrolling for history
  • Debounced search and filter
  • Off-screen rendering for complex components

Network

  • Connection pooling with OkHttp
  • Request cancellation support
  • Streaming response handling
  • Gzip compression

Memory Management

  • Weak references for caches
  • Limited history retention
  • Response size limits
  • Garbage collection tuning

Startup Time

  • Lazy initialization of components
  • Parallel resource loading
  • Optimized dependency graph
  • AOT compilation with GraalVM (future)

🔒 Security Considerations

  • Local Storage: All data stored locally, no cloud sync
  • No Telemetry: No tracking or analytics
  • Certificate Validation: Proper SSL/TLS validation
  • Credential Storage: Secure storage for Git credentials
  • Script Sandbox: JavaScript execution in sandboxed environment
  • Input Validation: Prevent injection attacks

🌐 Cross-platform Compatibility

Windows

  • Native look and feel
  • File associations
  • Registry integration
  • Auto-update support

macOS

  • Native menu bar integration
  • Touch Bar support (future)
  • Sandbox-compatible
  • Notarization for security

Linux

  • Desktop file integration
  • System tray support
  • Multiple desktop environments (GNOME, KDE, XFCE)
  • AppImage support (future)

📈 Future Enhancements

  • 🚧 Plugin system for extensibility
  • 🚧 GraphQL support
  • 🚧 gRPC protocol support
  • 🚧 Mock server functionality
  • 🚧 API documentation generation
  • 🚧 Cloud workspace sync (optional)
  • 🚧 Mobile companion app