The framework: Next.js.
Next.js supports SPA, SSG and SSR. With this feature, the dashboard ui can be deployed in
- Standalone machine serving only dashboard UI with a backend. (e.g. Dashboard for cloud product)
- Meta service node. (e.g. Static HTML files integrated in meta service without any other dependencies like node.js)
dashboard/
--.next/ (generated by nextjs)
--node_modules/ (development dependencies)
--out/ (generated static files)
--components/ (React Component)
--lib/ (useful functions and classes)
--pages/ (web pages)
--public/ (static resources)
--styles/ (static css files)
--test/ (test cases)
TODO: Find a suitable testing framework
Start the RisingWave database, and create tables by removing drop tables from tpch_snapshot.slt
./risedev d
sqllogictest -p 4566 -d dev './e2e_test/streaming/tpch_snapshot.slt'
Install Dependencies.
npm i
The website will be served at port 3000. It requests data from the mock server at port 32333.
npm run dev
You should also run:
./mock/fetch.sh # dump current data from RisingWave meta node to be used by mock server
node mock-server.js
To start a mock API server when developing.
To replace the built static files in RisingWave with your newest code, run the following scripts in the root directory.
./risedev export-dashboard
The dashboard will be served by meta node at port 5691.
Running npm i
will generate the proto files under proto/gen
automatically. In case there are modifications to the protos, you can regenerate them using the command npm run gen-proto.
Build static files for standalone deployment without node.js. The built files are generated at ./out
.
Check more details at Static HTML Export.
npm run build-static
The built files are generated at ./out
.