diff --git a/docs/docker-image-details.md b/docs/docker-image-details.md index c12bdd9b865..7b49212bc55 100644 --- a/docs/docker-image-details.md +++ b/docs/docker-image-details.md @@ -27,7 +27,7 @@ gravitino:0.3.0 - Docker image `datastrato/gravitino:0.3.0` - Gravitino Server - Expose ports: - - `8090` Gravitino web UI + - `8090` Gravitino Web UI - `9001` Iceberg REST service ## Playground Docker image diff --git a/web/README.md b/web/README.md index 6c02877fc6a..a78e70a6fd3 100644 --- a/web/README.md +++ b/web/README.md @@ -3,7 +3,7 @@ This software is licensed under the Apache License version 2. --> -# Gravitino Web +# Gravitino Web UI > **⚠️ Important** > @@ -11,9 +11,9 @@ --- -## Getting Started +## Getting started -### Preparation | Framework & Dependencies +### Preparation | framework & dependencies - [Node.js](https://nodejs.org)(v20.x+) & [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com/) - [React](https://react.dev/) @@ -24,7 +24,7 @@ > **TIP** > -> Yarn package manager is recommended +> You should use the Yarn package manager. > > **Requirements** > @@ -35,45 +35,49 @@ ### Development environment -- Run below command in console: +- Run the below command in the console to install the required dependencies. ```bash -# install dependencies yarn install ``` -- After installing the modules run your project with following command: +- After installing the modules start the development server with following command: ```bash -# start development server yarn server ``` -- Visit to check it in your browser. You can start editing the page such as `pages/index.js`. The page auto-updates as you edit the file. +- Visit to view the Gravitino Web UI in your browser. You can start editing the page such as `pages/index.js`. The page auto-updates as you edit the file. -### Development Scripts +:::caution important +The Gravitino Web UI only works in the latest version of the Chrome browser. You may encounter issues in other browsers. +::: + +### Development scripts + +This command runs ESLint to help you inspect the code. If errors occur, please make modifications based on the provided prompts. ```bash yarn lint -# This command runs ESLint to help you inspect the code. If errors are printed, please make modifications based on the provided prompts. ``` +This command runs Prettier to help you check your code styles. You can manually fix the code when errors are shown, or use `yarn format` to fix the code with Prettier CLI. + ```bash yarn prettier:check -# This command runs Prettier to help you check your code styles. you can manually to fix the code when errors are printed, or use `yarn format` to fix the code with Prettier CLI. ``` +This command automatically formats the code. + ```bash yarn format -# This command helps you automatically format the code. - ``` -## Self-hosting Deployment +## Self-hosting deployment -### Node.js Server +### Node.js server -Next.js can be deployed to any hosting provider that supports Node.js. Make sure your `package.json` has the `build` and `start` scripts: +You can deploy Next.js to any hosting provider that supports Node.js. Make sure your `package.json` has the `build` and `start` scripts: ```json { @@ -85,39 +89,32 @@ Next.js can be deployed to any hosting provider that supports Node.js. Make sure } ``` -`next build` builds the production application in the `.next` folder. After building, `next start` starts a Node.js server that supports hybrid pages, serving both statically generated and server-side rendered pages. +`yarn build` builds the production application in the `.next` folder. After building, `yarn start` starts a Node.js server that supports hybrid pages, serving both statically generated and server-side rendered pages. ```bash -# build production files yarn build - -# start the nodejs server yarn start ``` -### Static HTML Export +### Static HTML export -Command `next export` allows you to export your app to static HTML, which can be run standalone without the need of a Node.js server. +The command `next export` allows you to export your app to static HTML, which runs standalone without the need for a Node.js server. -`next export` will generate an `dist` directory, which can be served by any static hosting service. +`next export` will generate a `dist` directory, producing content for any static hosting service. -```bash -yarn dist -# then copy the files within the 'dist' directory to the root directory of the static server -``` +The command `yarn dist` copies the files within the 'dist' directory to the root directory of the static server. ## Docker -make sure you have installed the recent version of [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/install/#scenario-two-install-the-compose-plugin). ([Docker Desktop](https://www.docker.com/products/docker-desktop/) already includes Docker Engine, Docker CLI and Docker Compose) +Make sure you have installed the most recent version of [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/install/#scenario-two-install-the-compose-plugin). [Docker Desktop](https://www.docker.com/products/docker-desktop/) includes Docker Engine, Docker CLI, and Docker Compose. > **⚠️ Important** > -> All commands below are meant to be run in a `macOS` environment. If you are using a different system, you may encounter errors. Please modify the commands according to the system prompts. -> For example, if you are using `Windows`, replace `${PWD}` with `%cd%`, etc. +> All commands in this document run in a `macOS` environment. If you are using a different operating system, you may encounter errors. -Only use Docker to build static `HTML\CSS\JS` files directory +Only use Docker to build the static `HTML\CSS\JS` files directory. -Run below command in console: +Run the following commands in the console: ```bash # ensure you are in the `web` directory @@ -126,14 +123,14 @@ docker run -it -p 3000:3000 -v ${PWD}:/web -w /web --name gravitino-web node:20- docker run -p 3000:3000 -v ${PWD}:/web --name gravitino-web node:20-slim /bin/bash -c "yarn install && yarn dist" ``` -This command will run `yarn install` to install the dependencies specified in the `package.json` file and then run `yarn export` to export a static version of the application. -The exported files will be saved to the `dist` directory inside the container, which is mounted to the `dist` directory in the current directory of the host machine. -This means that the exported files will be accessible on the host machine after the command is executed. +This command runs `yarn install` to install the dependencies specified in the `package.json` file and then runs `yarn export` to export a static version of the application. +The exported files are saved to the `dist` directory inside the container, and mounted in the `dist` directory in the current directory of the host machine. +This means that the exported files are accessible on the host machine after running the command. -If you also want to start a server to view with demo, please change to the following code: +If you also want to start a server to view the demo, please use the following code: ```bash docker run -it --rm --name gravitino-web-docker -v ${PWD}:/web -p 3000:3000 -w /web node:20-slim /bin/bash -c "yarn install && yarn server" ``` -You can access the Gravitino WEB UI by typing in your browser. +You can access the Gravitino Web UI by typing in your browser.