A web application that introduces a new algorithm for displaying UML diagrams using PlantUML. This application allows users to input PlantUML code via a web interface, render it as a PNG image using a Node.js backend, and display the resulting diagram.
- Node.js (v18 or higher recommended)
- Verify:
node -vandnpm -v
- Verify:
- Java 17 JRE or JDK for running PlantUML
- Verify:
java -version(should show version 17 or higher, e.g.,java version "17.0.9")
- Verify:
-
Move Project to a Path Without Spaces
- Ensure the project is in a directory without spaces in the path to avoid issues with PlantUML. For example:
- Correct:
C:\Users\Zord\plantuml-viewer - Incorrect:
C:\Users\Zord\Downloads\New folder (103)\plantuml-viewer-main
- Correct:
- Move the project if needed:
cd C:\Users\Zord\plantuml-viewer
- Ensure the project is in a directory without spaces in the path to avoid issues with PlantUML. For example:
-
Install Dependencies
npm install
-
Start the Server
-
Run the server:
node server.js
-
The server will run at
http://localhost:3000.
-
-
Access the Application
- Open a browser and navigate to
http://localhost:3000. - Enter PlantUML code (e.g., the sample below) in the text area and click "Render Diagram":
@startuml Alice -> Bob: Hello Bob --> Alice: Hi back! @enduml
- Open a browser and navigate to
-
Error:
ENOENT: no such file or directory, open 'temp.png'- Cause: PlantUML failed to generate
temp.png, likely due to:- Missing or incorrect
plantuml-gplv2-1.2025.3.jar. - Java not installed or not in PATH.
- Spaces in the project path (e.g.,
New folder (103)).
- Missing or incorrect
- Fix:
- Move the project to a path without spaces (e.g.,
C:\Users\Zord\plantuml-viewer). - Verify Java:
java -version. Install Java 17 if missing. - Verify JAR: Ensure
plantuml-gplv2-1.2025.3.jaris in the project directory. - Test PlantUML manually:
Check if
echo "@startuml\nAlice -> Bob: Hello\nBob --> Alice: Hi back!\n@enduml" > test.puml java -jar plantuml-gplv2-1.2025.3.jar -tpng test.puml -o .
test.pngis created. - Check server logs for errors (e.g.,
PlantUML execution error). - Ensure the project directory has write permissions:
- Right-click the folder > Properties > Security > Confirm your user has "Full control".
- Move the project to a path without spaces (e.g.,
- Cause: PlantUML failed to generate
-
Other Issues
- Java not recognized: Add Java to PATH (e.g.,
C:\Program Files\Java\jdk-17\bin). - Antivirus interference: Temporarily disable antivirus to test file creation.
- Logs: Check server logs in the terminal for detailed errors (e.g.,
PlantUML execution error). - X : m4ua If an error occurs, contact me.
- Java not recognized: Add Java to PATH (e.g.,
- The application requires
plantuml-gplv2-1.2025.3.jarto matchserver.js. If using a different version, update the JAR name inserver.js. - Avoid spaces and special characters in the project path to ensure PlantUML compatibility.