rush-sync-server 0.3.2

Modern asynchronous TUI application with i18n and modular command system
Documentation

Rush Sync Server

Rust Build License Crates.io

NOTE: Version 0.2.2 on crates.io has a critical bug in language file loading (*.json not embedded correctly). Please use version 0.3.2+ for a stable release!

Rush Sync Server is a professional web server orchestration platform written in Rust. The project features a robust terminal UI with internationalization, theming, command system, and NEW in v0.3.2: Full web server management with Actix-Web integration.


Project Vision

Rush Sync Server development phases:

  • Phase 0 โœ…: Terminal UI foundation with command system
  • Phase 1 โœ… NEW: Dynamic Actix-Web server management
  • Phase 2: Dev/Prod modes with hot-reloading
  • Phase 3: Redis integration & secure communication
  • Phase 4: Centralized logging & automation

What's New in v0.3.2

๐ŸŒ Complete Web Server Management System

The new version introduces professional Actix-Web server orchestration:

  • ๐Ÿš€ Dynamic Server Creation - Create unlimited web servers with custom names and ports
  • โšก Instant Start/Stop Control - Full lifecycle management of running servers
  • ๐ŸŽฏ Smart Port Management - Automatic port allocation from 8080+ range
  • ๐Ÿ“Š Real-time Server Status - Track running/stopped/failed server states
  • ๐Ÿงน Intelligent Cleanup - Remove stopped or failed servers from registry
  • ๐Ÿ” Comprehensive Server Listing - Chronological overview with status indicators

๐Ÿ›  New Server Management Commands

create                    # Create server with auto-generated name and port
create myserver           # Create server with custom name
create 8090              # Create server on specific port
create myserver 8090     # Create server with custom name and port

list                     # Show all servers with status
start <server>           # Start server by name, ID, or index number
stop <server>            # Stop running server gracefully
cleanup                  # Remove stopped servers from registry
cleanup failed           # Remove only failed servers
cleanup all              # Remove both stopped and failed servers

๐ŸŽฏ Advanced Server Features

  • Professional Web Interface - Each server provides HTML status page with server info
  • REST API Endpoints - /status, /api/info, /api/metrics, /health for monitoring
  • Graceful Shutdown - 5-second timeout with force-stop fallback
  • Server Identification - Unique UUID-based IDs with short display format
  • Chronological Indexing - Access servers by creation order (1, 2, 3...)
  • Concurrent Operation - Multiple servers running simultaneously
  • Memory Efficient - Single worker per server, optimized for embedded use

๐Ÿ”ง Enhanced Core System (from v0.3.1)

  • Central System Command Architecture - All confirmations use unified, type-safe processing
  • Anti-Flicker Color Engine - Pre-compiled display text to color mappings for zero-delay rendering
  • Enhanced Startup Experience - Professional startup message with color-coded categories
  • Streamlined Command Architecture - Multiple command files optimized for maintainability
  • Type-Safe Confirmations - No more string-based confirmation states

๐Ÿš€ Installation & Usage

๐Ÿ“ฆ As Binary - Version 0.3.2+

# Install from crates.io
cargo install rush-sync-server

# Run the application (terminal UI + server management)
rush-sync

๐Ÿ“š As Library - Version 0.3.2+

Add to your Cargo.toml:

[dependencies]
rush-sync-server = "0.3.2"
tokio = { version = "1.36", features = ["full"] }

Quick Start Examples:

use rush_sync_server::*;

#[tokio::main]
async fn main() -> Result<()> {
    // Run with default configuration (includes server management)
    run().await?;
    Ok(())
}
use rush_sync_server::*;

#[tokio::main]
async fn main() -> Result<()> {
    // Custom configuration with optimized performance
    let mut config = load_config().await?;
    config.poll_rate = std::time::Duration::from_millis(8); // 125 FPS
    config.typewriter_delay = std::time::Duration::from_millis(1); // Ultra-fast

    // Run with enhanced server management
    run_with_config(config).await?;
    Ok(())
}

๐Ÿ›  From Source

git clone https://github.com/LEVOGNE/rush.sync.server
cd rush.sync.server
cargo build --release
cargo run --release

โœ… Current Features (Phase 1 Complete)

๐ŸŒ Web Server Management (NEW in v0.3.2)

  • Dynamic Actix-Web Server Creation - Unlimited servers with UUID-based identification
  • Smart Port Allocation - Automatic port finding from 8080-8180 range
  • Custom Server Configuration - Name and port customization support
  • Professional Web Interface - HTML status pages with server information and API endpoints
  • Real-time Server Monitoring - Status tracking (Running/Stopped/Failed)
  • Graceful Lifecycle Management - Clean startup and shutdown processes
  • Concurrent Server Operation - Multiple servers running simultaneously
  • Registry-based Management - Persistent server information storage

๐Ÿ—๏ธ Core Foundation (Phase 0 Complete)

  • Interactive Terminal UI with asynchronous event loop (Tokio)
  • Central System Commands with type-safe confirmation processing
  • Advanced Error Handling with graceful recovery
  • Zero Warnings Codebase (cargo clippy clean)
  • Memory-Safe Operations with proper resource management

๐Ÿ“Š Logging & Persistence

  • Color-coded Logging with levels (ERROR, WARN, INFO, DEBUG, TRACE)
  • Runtime Log-level Switching with persistent config save
  • ๐Ÿ“ Message Logging to .rss/rush.logs with timestamps
  • ๐Ÿ“š Command History in .rss/rush.history with file persistence
  • Auto-scroll & Message History with smart viewport management

๐ŸŽจ Advanced UI System

  • ๐Ÿ–ฑ๏ธ Intelligent Dual-Cursor System - Text rendering + real terminal cursor
  • ๐ŸŽฏ Multi-Platform Terminal Detection (macOS Terminal, iTerm2, VSCode, tmux)
  • ๐ŸŒˆ Dynamic Terminal Cursor Colors with real-time color changes
  • Anti-Flicker Color System - Zero-delay color processing with pre-compiled mappings
  • Live Theme Switching without restart (TOML-based)
  • Typewriter Effect with configurable speed and cursor
  • Unicode Support (grapheme-based text handling)
  • ๐ŸŽฏ Advanced Viewport with smooth scrolling and position preservation
  • ๐Ÿ“ฑ Responsive Layout System with panic-safe dimension handling

โŒจ๏ธ Input & Navigation

  • Full Keyboard Support - Shift + symbols, umlauts, Unicode & emoji
  • Platform Shortcuts - Cmd (macOS) / Ctrl (Win/Linux) navigation
  • Input History Navigation with arrow keys and persistent storage
  • ๐Ÿ“‹ Enhanced Copy/Paste Integration with text cleaning and validation
  • ๐Ÿ›ก๏ธ Smart Input Validation with length limits and sanitization
  • ๐Ÿ’พ State Backup/Restore - Complete input state preservation
  • Central Confirmation System - Unified, type-safe confirmation processing

๐ŸŒ Internationalization

  • Runtime Language Switching (German/English)
  • Centralized Color Categories with consistent i18n support
  • Localized Error Messages and help texts
  • Professional Startup Messages with language adaptation
  • Extensible Translation System for future languages

โš™๏ธ Configuration & Themes

  • Smart Config Validation with auto-correction
  • TOML-based Theme System with live updates
  • Internal Restart without process termination
  • Persistent Settings with automatic backup
  • Enhanced Error Recovery with comprehensive fallback handling

๐Ÿ’ป Available Commands

๐ŸŒ Server Management Commands (NEW)

Command Description Examples
create Create new web server create, create myserver, create 8090
list Show all servers list
start Start server start 1, start myserver, start abc123
stop Stop server stop 1, stop myserver, stop abc123
cleanup Remove inactive servers cleanup, cleanup failed, cleanup all

๐Ÿ“‹ Core System Commands

Command Description Examples
version / ver Show application version version
lang / language Switch language (EN/DE) lang de, lang en
theme Change themes live theme dark, theme light
clear / cls Clear all messages clear
exit / q Exit with confirmation exit
restart Internal restart restart, restart --force
history -c Clear input history history -c
log-level Change log level log-level debug

๐ŸŒ Server Management Examples

Creating Servers

# Auto-generated name and port
create
# Result: Server created: 'rush-sync-server-001' (ID: abc12345) on Port 8080

# Custom name with auto port
create myapi
# Result: Server created: 'myapi' (ID: def67890) on Port 8081

# Custom port with auto name
create 9000
# Result: Server created: 'rush-sync-server-002' (ID: ghi13579) on Port 9000

# Custom name and port
create myapi 9000
# Result: Custom Server created: 'myapi' (ID: jkl24680) on Port 9000

Server Control

# Start by index (chronological order)
start 1
# Result: Server 'myapi' successfully started on http://127.0.0.1:9000

# Start by name
start myapi
# Result: Server 'myapi' successfully started on http://127.0.0.1:9000

# Start by ID prefix
start abc123
# Result: Server 'rush-sync-server-001' successfully started on http://127.0.0.1:8080

# List all servers
list
# Result:
# Server List:
#   1. myapi - def67890 (Port: 9000) [Running]
#   2. rush-sync-server-001 - abc12345 (Port: 8080) [Stopped]
#   3. testserver - ghi13579 (Port: 8082) [Failed]

# Stop server
stop myapi
# Result: Server 'myapi' stopped

# Cleanup inactive servers
cleanup
# Result: 1 stopped server removed

cleanup failed
# Result: 1 failed server removed

cleanup all
# Result: 2 stopped servers removed
# 1 failed server removed

Web Interface Access

Each created server provides a professional web interface:

http://127.0.0.1:8080/          # Welcome page with server info
http://127.0.0.1:8080/status    # JSON status information
http://127.0.0.1:8080/api/info  # Complete API information
http://127.0.0.1:8080/api/metrics # Server metrics
http://127.0.0.1:8080/health    # Health check endpoint

Enhanced Confirmation System

All system commands use the centralized confirmation processor:

exit                    # Shows: [CONFIRM] Do you really want to exit? (y/n)
y                       # โœ… Exits immediately - no display bugs
n                       # โœ… Shows: "Operation cancelled"

restart                 # Shows: [CONFIRM] Really restart? (y/n)
y                       # โœ… Restarts immediately and cleanly

history -c              # Shows: [CONFIRM] Clear command history? (y/n)
y                       # โœ… History cleared with proper confirmation

โŒจ๏ธ Enhanced Keyboard Shortcuts

๐Ÿ”ค Text Navigation

Key Function
โ† / โ†’ Move cursor in text
Home / End Jump to start/end
Cmd/Ctrl + A Jump to start
Cmd/Ctrl + E Jump to end

โœ๏ธ Text Editing

Key Function
Backspace Delete previous char
Delete Delete next char
Cmd/Ctrl + U Clear entire line
Cmd/Ctrl + C Copy current input
Cmd/Ctrl + V Paste from clipboard
Cmd/Ctrl + X Cut current input

๐Ÿ“š History & Navigation

Key Function
โ†‘ / โ†“ Navigate input history
Shift + โ†‘ / โ†“ Scroll messages
Page Up / Down Page scroll

โš™๏ธ Configuration System

๐Ÿ“ File Locations

  • Config: .rss/rush.toml (auto-created)
  • History: .rss/rush.history (persistent command history)
  • Logs: .rss/rush.logs (timestamped message log)

๐Ÿ›  Configuration File

[general]
max_messages = 1000         # Message buffer size
typewriter_delay = 5        # Typewriter effect speed (0 = disabled)
input_max_length = 100      # Maximum input length
max_history = 30            # Command history entries
poll_rate = 16              # UI refresh rate (16ms = 62.5 FPS)
log_level = "info"          # Log level (error/warn/info/debug/trace)
current_theme = "dark"      # Active theme name

[language]
current = "en"              # Language (en/de)

# Server Management Configuration (NEW)
[server]
port_range_start = 8080     # Starting port for auto-allocation
port_range_end = 8180       # Maximum port for auto-allocation
max_concurrent = 10         # Maximum simultaneous servers
shutdown_timeout = 5        # Graceful shutdown timeout (seconds)

# Built-in themes with advanced cursor configuration
[theme.dark]
output_bg = "Black"
output_text = "White"
output_cursor = "PIPE"           # PIPE, BLOCK, UNDERSCORE
output_cursor_color = "White"    # Terminal cursor color for typewriter
input_bg = "White"
input_text = "Black"
input_cursor_prefix = "/// "     # Prompt text
input_cursor = "PIPE"            # Input cursor type
input_cursor_color = "Black"     # Input cursor color (real terminal cursor)

[theme.light]
output_bg = "White"
output_text = "Black"
output_cursor = "PIPE"
output_cursor_color = "Black"
input_bg = "Black"
input_text = "White"
input_cursor_prefix = "/// "
input_cursor = "PIPE"
input_cursor_color = "White"

# Additional themes: green, blue, yellow available

๐Ÿ”ง Advanced Features

๐ŸŒ Server Architecture Details

  • Actix-Web Integration - Professional-grade web server framework
  • Single Worker Design - Optimized for embedded server management
  • UUID-based Identification - Unique server IDs with collision avoidance
  • Graceful Shutdown Protocol - 5-second timeout with force-stop fallback
  • Memory Efficient Operation - Minimal resource footprint per server
  • Concurrent Server Support - Run multiple servers simultaneously
  • Professional Web Interface - HTML status pages with comprehensive server information

๐Ÿ›ก๏ธ Terminal Compatibility

  • macOS Terminal.app - Optimized sequences with RGB color support
  • iTerm2 - Native color support with multiple sequence types
  • VSCode Terminal - Standard compatibility with fallback handling
  • tmux Sessions - Proper tmux-wrapped escape sequence handling
  • Generic Terminals - Universal fallback support with error recovery

๐Ÿ–ฑ๏ธ Advanced Cursor System

# Real-time cursor changes in terminal
theme blue    # Terminal cursor becomes blue
theme yellow  # Terminal cursor becomes yellow
theme green   # Terminal cursor becomes green

# Cursor debugging
theme debug dark    # Shows detailed cursor configuration

Central Command Processing

// Example: Type-safe, compiler-verified, zero race conditions
enum SystemAction {
    Exit,
    Restart,
    ClearHistory,
}

match confirmed_action {
    SystemAction::Exit => exit_application(),      # โšก Immediate
    SystemAction::Restart => restart_system(),    # โšก Clean
    SystemAction::ClearHistory => clear_data(),   # โšก Instant
}

๐Ÿ—บ Development Roadmap

Phase 2: Dev/Prod & Versioning

  • Dev mode with hot-reloading for server content
  • Production mode with TLS/HTTPS support
  • Automatic versioning (v1, v2, ...) for server instances
  • File watcher integration with notify crate
  • SCSS compilation for web assets

Phase 3: Communication & Security

  • Redis Pub/Sub integration for inter-server communication
  • TLS/HTTPS with rustls for secure connections
  • Session caching and management
  • Advanced authentication and authorization
  • Server-to-server communication protocols

Phase 4: Logging & Automation

  • Centralized logging dashboard for all servers
  • Automated deployment and setup scripts
  • WebSocket support for real-time communication
  • Comprehensive integration test suite
  • Performance monitoring and metrics collection

Future Considerations

  • Load balancing between multiple server instances
  • Docker containerization support
  • Kubernetes deployment configurations
  • Web-based management dashboard
  • Plugin system for server extensions

๐Ÿงช Testing & Quality Assurance

โœ… Code Quality Checks

# Zero warnings guarantee
cargo clippy --all-targets --all-features
cargo check --all-targets
cargo test --all-features

# Server management tests
cargo test server_lifecycle
cargo test port_allocation
cargo test concurrent_servers

๐Ÿ›ก๏ธ Security Testing

# Input sanitization tests
cargo test escape_sequence_filtering
cargo test server_name_validation
cargo test port_validation

# Server security tests
cargo test graceful_shutdown
cargo test resource_cleanup
cargo test concurrent_access

๐Ÿ“Š Version History

v0.3.2 (Current) - Complete Server Management

๐ŸŒ Major Server Management Features:

  • Complete Actix-Web Integration - Professional web server creation and management
  • Dynamic Server Lifecycle - Create, start, stop, and cleanup web servers
  • Smart Port Management - Automatic port allocation with conflict avoidance
  • Professional Web Interface - HTML status pages with comprehensive server information
  • REST API Endpoints - /status, /api/info, /api/metrics, /health for monitoring
  • Concurrent Server Support - Run multiple servers simultaneously with efficient resource usage

๐Ÿ›  New Server Commands:

  • create - Server creation with custom names and ports
  • list - Comprehensive server listing with status indicators
  • start/stop - Full server lifecycle control
  • cleanup - Intelligent removal of inactive servers

๐Ÿ”ง Enhanced Architecture:

  • Server Registry System - Persistent server information storage
  • UUID-based Identification - Unique server IDs with short display format
  • Chronological Indexing - Access servers by creation order
  • Graceful Shutdown Protocol - Clean server termination with timeout handling

v0.3.1 - Central Command Architecture

  • Central Confirmation System - Type-safe confirmation processing
  • Anti-Flicker Color System - Pre-compiled color mappings with O(1) lookup performance
  • Professional Startup Experience - Enhanced startup messages with color coding
  • Type-Safe Operations - Eliminated string-based states with robust enum architecture

v0.3.0 - Code Optimization & Performance

  • 17.6% Code Reduction - From 289,700 to 238,817 characters
  • Complete Code Cleanup - Removed redundant structures and debug code
  • Performance Optimizations - Streamlined rendering and input processing

๐Ÿ† Code Quality Metrics

Rush Sync Server v0.3.2 maintains exceptional standards:

  • โœ… Zero Clippy Warnings (all lints passing)
  • โœ… Zero Cargo Check Errors (clean compilation)
  • โœ… Memory Safe (Rust guarantees + manual verification)
  • โœ… Thread Safe (proper async/sync boundaries)
  • โœ… Comprehensive Error Handling (Result types throughout)
  • โœ… Clean Architecture (modular design patterns)
  • โœ… Extensive Testing (unit + integration tests)
  • โœ… Documentation Coverage (all public APIs documented)
  • โœ… Central Command Architecture (type-safe system operations)
  • โœ… Anti-Flicker Performance (O(1) color processing)
  • โœ… Race-Condition Free (centralized state management)
  • โœ… Professional Server Management (Actix-Web integration)
  • โœ… Cross-Platform Compatibility (tested on macOS, Linux, Windows)

๐Ÿ“œ License

Dual-Licensing Model

  1. Community License (GPLv3) โ€” Free for private and non-commercial use
  2. Commercial License โ€” Required for commercial applications

For commercial licensing inquiries: ๐Ÿ“ง l.ersen@icloud.com


๐Ÿค Contributing

๐ŸŽฏ Areas Looking for Contributors:

Phase 2 Development:

  • Hot-reloading system for development mode
  • TLS/HTTPS integration with rustls
  • File watcher integration with notify
  • SCSS compilation for web assets

Server Management Enhancements:

  • Load balancing between server instances
  • Advanced monitoring and metrics collection
  • WebSocket support for real-time communication
  • Docker integration and containerization

Core Improvements:

  • Additional language translations (Spanish, French, Japanese)
  • Advanced theme design and UX improvements
  • Performance optimizations and benchmarking
  • Cross-platform testing and compatibility

๐Ÿ“‹ Development Guidelines:

  1. Code Quality:

    • Ensure zero warnings with cargo clippy
    • Add comprehensive tests for new features
    • Maintain memory safety and thread safety
    • Include panic-safe error handling
    • Follow the central command architecture pattern
  2. Server Management:

    • Test all server lifecycle operations
    • Ensure proper resource cleanup
    • Validate port allocation logic
    • Test concurrent server scenarios
  3. Internationalization:

    • Add i18n support for all new user-facing text
    • Update both en.json and de.json files
    • Test language switching functionality
    • Use centralized color categories for consistent theming

๐Ÿ“ž Contact & Support


Rush Sync Server v0.3.2 - Professional web server orchestration with Actix-Web integration, dynamic server management, and comprehensive terminal UI.