How yukihiradeve/webservercontroller works
The Minecraft Server Manager is a full-stack project with a clear separation between a Node.js API backend and a React-based frontend. The backend, which handles server management tasks through dedicated routes and shell scripts, interacts with external processes and dependencies (Java, Python, and the Debian environment) to manage Minecraft servers. The frontend, on the other hand, provides the user interface and integrates Three.js for 3D visualization of the Minecraft maps.
Main Components
• Frontend: A React application (with Tailwind CSS and Three.js integration) that includes UI components (e.g., MinecraftControl, MinecraftModelLoader, ServerList, etc.) and pages (e.g., ServerPanel).
• Backend: A Node.js Express application with middleware (e.g., authenticate), routes (e.g., minecraft.js, system-stats.js), and an API layer exposing endpoints to manage operations such as /create, /shutdown, /export, /modify, etc.
• Server Scripts: A collection of shell scripts (e.g., createServer.sh, startServer.sh, shutdownServer.sh, exportMap.sh, etc.) used to perform the actual server management tasks.
• External / Third-party Tools: Components such as the Python script (SpawnCoordinate.py) and the jar file (jMc2Obj) used in exporting 3D models.
• System/Environment Dependencies: The project requires Debian or macOS, Node.js, Java, and Python.
Relationships and Interactions
• The Frontend calls the Backend API endpoints to trigger operations (e.g., creating, modifying, exporting, or shutting down a server).
• The Backend processes HTTP requests and, based on routes, invokes corresponding shell scripts and other external executables. For instance, a request to export server data might trigger the exportMap.sh script which, in turn, may use jMc2Obj for converting Minecraft data.
• Middleware (e.g., for authentication) intercepts requests in the backend to ensure security.
• The output from these scripts and tools is then relayed back through the API to the frontend or stored/logged as needed.
Architectural Patterns
• Separation of Concerns: The clear division between frontend and backend, where each handles a distinct part of functionality.
• API-Driven Design: The backend exposes RESTful endpoints that encapsulate the business logic and interact with system-level operations.
• Modular Design: With scripts for different functionalities and a modular React component structure, the project is built to be extensible and maintainable.
Relevant Technologies
• Frontend: React, Three.js, Tailwind CSS.
• Backend: Node.js, Express (assumed from the file structure), and middleware for API protection.
• Scripts: Shell scripting for UNIX systems.
• External Tools: Python for specific tasks (SpawnCoordinate.py) and Java (jMc2Obj) for 3D export.
Elements
• Labels for external dependencies: “Java (jMc2Obj), Python (SpawnCoordinate.py)” and note how these integrate into the backend’s export system.