diff --git a/web/README.md b/web/README.md index e531acb..9fa74c5 100644 --- a/web/README.md +++ b/web/README.md @@ -1,125 +1,6 @@ -# minecraftLegionWebClient +# This folder is front end -This project was part of [minecraftLegion](https://github.com/sefirosweb/minecraftLegion). - -This is a frontend to manage the bot. This frontend needs to connect to the backend: [minecraftLegionWebServer](https://github.com/sefirosweb/minecraftLegionWebServer). - -## Install with docker - -1. You need to have installed [docker](https://docs.docker.com/desktop/windows/wsl/), you can go to official docker site and follow the installation guide for you OS -2. Create docker network if you have all services in same computer and if you not have already created - -``` -docker network create minecraftLegionNetwork -``` - -3. Clone the repository - -``` -git clone https://github.com/sefirosweb/minecraftLegionWebClient.git -cd minecraftLegionWebClient -``` - -4. Install dependencies - -``` - docker run --rm -v $PWD:/home/app -w /home/app -u node node:16.13-bullseye npm install -``` - -5. Build & prepare the web - -``` -docker run --rm -v $PWD:/home/app -w /home/app -u node node:16.13-bullseye npm run build -``` - -6. Start the web server (nginx with react build files) - -``` -docker-compose up -d -``` - -The frontend is ready to listen in port 80 \ -Open url http://localhost/ - - -You can change the port of web server, modify docker-compose.yml 80 to any you want - -Set "Web Socket Server Password" password of "server" \ -Set "Web Socket Server URL" the "server" ip \ -Set "Web Socket Server Port" the port of "server" - -Set "Master" your name in minecraft, it is used for "follow" your orders in game - -Set "Server Bots (Used for connect to Bots Viewers)" it is used for see the inventory / view what does the bot - -Now you must have connected to the server - -![image](https://raw.githubusercontent.com/sefirosweb/minecraftLegionWebClient/master/docs/conection.png) - -## Next usages - -For start again only you need to start docker and start the node: - -``` -docker run --rm -it --name minecraftLegionWebClient -p 3000:3000 --network minecraftLegionNetwork -v $PWD:/home/app -w /home/app -u node node:16.13-bullseye /bin/bash -``` - -``` -npm start -``` - -## Manual update - -You need to "pull" the new code and install the new dependencies - -``` -git pull -``` - -Start docker: - -``` -docker run --rm -it --name minecraftLegionWebClient -p 3000:3000 --network minecraftLegionNetwork -v $PWD:/home/app -w /home/app -u node node:16.13-bullseye /bin/bash -``` - -Install new dependencies: - -``` -npm install -``` - -Start bot - -``` -npm start -``` - -# Easy method without building - -1. You need to have installed [docker](https://docs.docker.com/desktop/windows/wsl/), you can go to official docker site and follow the installation guide for you OS -2. Create docker network if you have all services in same computer and if you not have already created - -``` -docker network create minecraftLegionNetwork -``` - -3. Clone the repository -``` -git clone https://github.com/sefirosweb/minecraftLegionWebClient.git -cd minecraftLegionWebClient -``` - -4. Change of branch already builded -``` -git fetch -git checkout gh-pages -git pull -``` -5. Start docker -``` -docker-compose up -d -``` -or: -``` -docker run --rm --name minecraftLegionWebClient -p 80:3000 --network minecraftLegionNetwork -v $PWD:/usr/share/nginx/html -v $PWD/default.conf:/etc/nginx/conf.d/default.conf nginx -``` \ No newline at end of file +## Develop: +- Install Node.js +- install dependencies: `npm install` +- Run development server: `npm run dev` \ No newline at end of file diff --git a/web/package-lock.json b/web/package-lock.json index 635e69d..471c005 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -13,9 +13,9 @@ "base-types": "file:../base-types/base-types-1.0.0.tgz", "bootstrap": "^5.3.3", "minecraft-assets": "^1.12.2", - "minecraft-data": "^3.63.0", + "minecraft-data": "^3.64.0", "react": "^18.2.0", - "react-bootstrap": "^2.10.1", + "react-bootstrap": "^2.10.2", "react-dom": "^18.2.0", "react-router": "^6.22.3", "react-router-dom": "^6.22.3", @@ -26,7 +26,7 @@ "devDependencies": { "@tanstack/react-query": "^5.28.4", "@types/lodash": "^4.17.0", - "@types/react": "^18.2.66", + "@types/react": "^18.2.67", "@types/react-dom": "^18.2.22", "@vitejs/plugin-react-swc": "^3.6.0", "lodash": "^4.17.21", @@ -459,9 +459,9 @@ } }, "node_modules/@restart/ui": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.6.7.tgz", - "integrity": "sha512-rrbADq+7/UIooPjnxOUOwuhBlAdWuf2X2DbVU/ygHSpxwZSo+C4gx/fRx0u1eR9bxOcH2mo/uX8/KZyw+CQxug==", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.6.8.tgz", + "integrity": "sha512-6ndCv3oZ7r9vuP1Ok9KH55TM1/UkdBnP/fSraW0DFDMbPMzWKhVKeFAIEUCRCSdzayjZDcFYK6xbMlipN9dmMA==", "dependencies": { "@babel/runtime": "^7.21.0", "@popperjs/core": "^2.11.6", @@ -922,9 +922,9 @@ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/react": { - "version": "18.2.66", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.66.tgz", - "integrity": "sha512-OYTmMI4UigXeFMF/j4uv0lBBEbongSgptPrHBxqME44h9+yNov+oL6Z3ocJKo0WyXR84sQUNeyIp9MRfckvZpg==", + "version": "18.2.67", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.67.tgz", + "integrity": "sha512-vkIE2vTIMHQ/xL0rgmuoECBCkZFZeHr49HeWSc24AptMbNRo7pwSBvj73rlJJs9fGKj0koS+V7kQB1jHS0uCgw==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -1563,9 +1563,9 @@ "integrity": "sha512-/eMxh3LNjCXOnU6KnQMjBM8dRnoJNpWIg7mD2m2RthraYiQK2FNzPWIKxWm2j3Ufcf5nzFXupgABledE86r4fQ==" }, "node_modules/minecraft-data": { - "version": "3.63.0", - "resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.63.0.tgz", - "integrity": "sha512-VIWHe+Ejvwp+uNSCG1Grq7/dcEHQIBOt7+ZpP9pP5naj4pbrEkPTlqKR/oEYdxi/fsXlH9IRVP0PRx4ib/vjmg==" + "version": "3.64.0", + "resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.64.0.tgz", + "integrity": "sha512-KhbwB4JfJWK4gWHCOzjxCKKtOG7eb9R/GPT1TEm7zKuj70MdCN0VUQiw6to5FVRhUaWj053NS6iG3RMrdzSOkg==" }, "node_modules/ms": { "version": "2.1.2", @@ -1726,13 +1726,13 @@ } }, "node_modules/react-bootstrap": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.10.1.tgz", - "integrity": "sha512-J3OpRZIvCTQK+Tg/jOkRUvpYLHMdGeU9KqFUBQrV0d/Qr/3nsINpiOJyZMWnM5SJ3ctZdhPA6eCIKpEJR3Ellg==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.10.2.tgz", + "integrity": "sha512-UvB7mRqQjivdZNxJNEA2yOQRB7L9N43nBnKc33K47+cH90/ujmnMwatTCwQLu83gLhrzAl8fsa6Lqig/KLghaA==", "dependencies": { "@babel/runtime": "^7.22.5", "@restart/hooks": "^0.4.9", - "@restart/ui": "^1.6.6", + "@restart/ui": "^1.6.8", "@types/react-transition-group": "^4.4.6", "classnames": "^2.3.2", "dom-helpers": "^5.2.1", diff --git a/web/package.json b/web/package.json index 4e6934e..d8b919e 100644 --- a/web/package.json +++ b/web/package.json @@ -32,9 +32,9 @@ "base-types": "file:../base-types/base-types-1.0.0.tgz", "bootstrap": "^5.3.3", "minecraft-assets": "^1.12.2", - "minecraft-data": "^3.63.0", + "minecraft-data": "^3.64.0", "react": "^18.2.0", - "react-bootstrap": "^2.10.1", + "react-bootstrap": "^2.10.2", "react-dom": "^18.2.0", "react-router": "^6.22.3", "react-router-dom": "^6.22.3", @@ -45,7 +45,7 @@ "devDependencies": { "@tanstack/react-query": "^5.28.4", "@types/lodash": "^4.17.0", - "@types/react": "^18.2.66", + "@types/react": "^18.2.67", "@types/react-dom": "^18.2.22", "@vitejs/plugin-react-swc": "^3.6.0", "lodash": "^4.17.21",