Okay, let's design the feature set and user interactions for this local Minecraft server management web application.
Product Name: MineHost Local (or similar)
Core Goal: Provide a user-friendly graphical interface (via a web browser) to create, manage, configure, and monitor Minecraft servers running directly on the user's local Windows or Linux machine.
Target Audience: Individuals or small groups wanting to run personal Minecraft servers without delving into complex command-line operations or manual file management.
Architecture Overview:
- Backend Service: A lightweight background application (written in something like Go, Node.js, Python, or even Java) that runs on the user's machine (Windows or Linux). This service performs all the actual server management tasks:
- File system operations (creating folders, reading/writing configs, managing mods).
- Process management (starting/stopping Java server processes).
- Network operations (downloading server JARs, mods).
- Provides a local API (e.g., REST or WebSocket) for the frontend.
- Handles OS-specific differences.
- Frontend Web App: A single-page application (SPA) built with a modern framework (React, Vue, Angular) served by the backend service. The user interacts with this via their web browser, navigating to a local address (e.g.,
http://localhost:8080).
Detailed Feature Specification:
I. Installation and Setup:
- Feature: Easy installation for Windows and Linux.
- Windows: Provide an installer package (
.msi or .exe) that sets up the backend service, potentially as a background service or a user-run application. Includes necessary dependencies (or prompts for them, like a specific Java version if not bundling). Adds firewall rules if necessary for the web UI port.
- Linux: Provide common package formats (
.deb, .rpm) and/or a simple script/archive (.tar.gz) with setup instructions. Handle service registration (systemd/init.d) or running as a user process.
- Feature: Initial Configuration Wizard (First Run).
- Interaction: Upon first launch (accessing the web UI), guide the user through basic setup.
- Steps:
- Welcome screen.
- Java Runtime Detection/Selection: Automatically detect installed compatible Java runtimes. Allow the user to select one or manually specify the path to the
java executable if detection fails. Warn about incompatible Java versions for certain Minecraft versions.
- Default Server Storage Path: Suggest a default location to store all server data (e.g.,
Documents/MineHostLocalServers/ or /home/user/minehost_local_servers/). Allow the user to change this.
- (Optional) Port for Web UI: Allow changing the default port for the web interface itself if the default (e.g., 8080) conflicts.
- Feature: Tool Updates.
- Interaction: Notify the user within the web UI when a new version of MineHost Local is available. Provide a button to initiate the update process (handled by the backend service).
II. Server Dashboard / Overview:
- Feature: List all managed servers.
- Interaction: The main screen displays a card or list item for each created server.
- Information Displayed per Server:
- Server Name
- Server Type (Vanilla, Forge, Fabric, NeoForge) & Minecraft Version
- Current Status (Running, Stopped, Starting, Stopping, Error) with visual indicator (e.g., green/red dot).
- Port Number
- Quick Actions: Start/Stop buttons.
- Player Count (Current/Max) if running and queryable.
- Feature: Create New Server Button.
- Interaction: A prominent button ("+ Create Server", "Add New Server") that initiates the server creation workflow.
III. Server Creation Workflow:
- Feature: Guided Server Creation Wizard.
- Interaction: A multi-step process presented in modals or separate pages.
- Steps:
- Server Type & Version:
- Select Server Type: Dropdowns/Buttons for Vanilla, Forge, Fabric, NeoForge.
- Select Minecraft Version: Dynamically populated dropdown based on the selected type, listing available stable versions. The backend needs logic to fetch version manifests (e.g., from Mojang, Forge, Fabric APIs).
- (Forge/Fabric/NeoForge): Select Loader Version: Dropdown for the specific mod loader version (usually latest stable recommended).
- Basic Configuration:
- Server Name: User-defined name for easy identification in the UI.
- Server Port: Input field for the Minecraft server port (default 25565). Basic validation for port range and conflicts with other managed servers.
- (Optional Advanced) Server Directory: Show the calculated path based on the default storage path and server name. Allow overriding if needed.
- EULA Acceptance:
- Display a link to the Minecraft EULA.
- Require the user to check a box "I accept the Minecraft EULA". This will automatically create/update the
eula.txt file later.
- Download & Setup:
- Show progress indicators (Downloading server JAR, Downloading mod loader installer, Running installer, Creating folders, Generating initial configs).
- The backend handles:
- Downloading the appropriate Vanilla JAR or Modloader installer.
- Running the installer (if Forge/Fabric/NeoForge) to generate the final server JAR and libraries.
- Creating the server directory structure (
mods, config, world, etc.).
- Creating a default
server.properties.
- Creating
eula.txt with eula=true.
- Completion: Confirmation message. Option to "Go to Server Dashboard" or "Manage Server Now".
IV. Server Management (Individual Server View):
- Feature: Dedicated page/view for each server.
- Interaction: Clicking on a server card/item in the dashboard navigates here.
- Feature: Server Status & Controls.
- Display: Prominent display of Server Name, Type, Version, Status.
- Controls: Large, clear buttons for "Start", "Stop", "Restart". Buttons are disabled/enabled based on the current server state.
- Status Updates: Real-time updates on the status (e.g., "Starting...", "Running", "Stopping...").
- Feature: Live Console View.
- Display: A scrollable text area showing the real-time standard output/error from the
java server process.
- Interaction:
- Input field below the console to send commands directly to the server's standard input (e.g.,
op <player>, save-all, stop).
- Option to automatically scroll.
- Option to clear the console view (client-side).
- (Advanced) Option to enable/configure RCON for command execution as an alternative.
- Feature: Player List.
- Display: If the server is running, display a list of currently connected players. (Requires querying the server - potentially via RCON or a query protocol if enabled in
server.properties).
- Feature: Resource Usage Monitoring (Optional but highly useful).
- Display: Show basic real-time resource usage of the server process:
- RAM Usage (e.g., 1.5 GB / 4 GB allocated)
- CPU Usage (%)
- Interaction: Maybe simple graphs showing usage over the last few minutes. (Backend needs to monitor the specific Java process).
V. Server Configuration:
- Feature:
server.properties Editor.
- Interaction:
- Form-Based View (Default): Display common
server.properties options (e.g., motd, gamemode, difficulty, max-players, pvp, view-distance, port, online-mode) as user-friendly form fields (text inputs, dropdowns, toggles) with labels and tooltips explaining each setting.
- Raw Text View (Advanced): Provide a button to switch to a raw text editor view of the entire
server.properties file for advanced users or less common settings.
- Saving: A "Save Changes" button. The backend validates (basic syntax if possible) and overwrites the file. Warn the user that a server restart is usually required for changes to take effect.
- Feature: Java Settings Configuration.
- Interaction: Allow configuration of Java startup parameters:
- Maximum RAM Allocation (
-Xmx): Slider or input field (e.g., "4 GB").
- Initial RAM Allocation (
-Xms): Slider or input field.
- (Advanced) Custom JVM Arguments: A text area for adding other flags (e.g., garbage collection tuning).
- Saving: Saves these settings, which the backend uses when constructing the
java command line.
VI. Mod/Plugin Management (Context-Dependent):
- (Applies to Forge, Fabric, NeoForge)
- Feature: Mod List View.
- Display: A list/table of
.jar files currently in the server's mods folder.
- Information per Mod: Filename, potentially inferred Mod Name/Version if parsable or from metadata (e.g.,
fabric.mod.json, mods.toml). Status (Enabled/Disabled - see below).
- Feature: Add Mods.
- Interaction:
- Upload: Button to allow uploading
.jar files directly from the user's computer. Backend places them in the mods folder.
- (Advanced/Optional) Browse Online Repositories: Integrate with CurseForge and/or Modrinth APIs. Allow searching for mods compatible with the server's type and version directly within the UI. Provide a "Download & Install" button. Handle dependency resolution (basic level: warn about missing dependencies if listed in metadata).
- Feature: Remove Mods.
- Interaction: Button next to each mod in the list to delete the
.jar file. Confirmation prompt required.
- Feature: Enable/Disable Mods.
- Interaction: Toggle switch or button next to each mod.
- Backend Implementation: Either rename the mod file (e.g., append
.disabled) or move it to a separate mods-disabled subfolder. Renaming is often simpler.
- Note: Vanilla servers do not use mods in this way. This section should be hidden or clearly marked as unavailable for Vanilla server types. Datapack management could be a separate, simpler feature if desired later.
VII. World Management:
- Feature: Manage Multiple Worlds (if applicable via mods/plugins, otherwise primary world).
- Display: List world folders detected (usually
world, potentially others).
- Feature: Basic World Actions.
- Interaction: Buttons for:
- Backup World: Create a timestamped
.zip archive of the selected world folder(s). Store backups in a designated backups folder within the server directory. List existing backups.
- Restore Backup: Allow selecting an existing backup
.zip file to restore. Requires server to be stopped. Warn about overwriting the current world.
- (Optional) Delete World: Allow deleting a world folder. Requires server stop and strong confirmation.
- (Optional) Upload World: Allow uploading a world folder (as a
.zip) to replace the current one. Requires server stop.
VIII. Backend Considerations:
- Cross-Platform Compatibility: Ensure file paths, process execution, and permissions handling work reliably on both Windows and Linux.
- Error Handling & Logging: Robust error handling for file operations, downloads, process management. Log backend actions and errors to a file for troubleshooting. Surface user-friendly errors to the frontend.
- Security:
- Run the web server bound only to
localhost by default to prevent external access.
- Be mindful of potential command injection if user input is used directly in shell commands (use safe APIs for process execution and file system access).
- No sensitive operations should be possible without user interaction in the UI.
- Resource Management: The backend service itself should be lightweight and consume minimal resources when idle.
IX. User Experience (UX) / User Interface (UI):
- Consistency: Maintain a consistent layout, button style, and terminology throughout the application.
- Feedback: Provide clear visual feedback for actions (loading indicators, success/error messages).
- Clarity: Use clear language. Avoid overly technical jargon where possible, but provide details in tooltips or help sections.
- Responsiveness: While primarily for desktop use, a reasonably responsive design is good practice.
- Accessibility: Use semantic HTML, provide ARIA attributes, ensure keyboard navigation is possible.
This detailed specification provides a solid foundation for building the MineHost Local application. Development would likely proceed by tackling core features first (installation, server creation, start/stop, console) and then layering on configuration, mod management, and world management.