Frontend development setup
December 21, 2024 ยท View on GitHub
To work with the frontend, switch the current folder to frontend
cd frontend
Building the frontend
1. Install NPM dependencies
Use npm to install dependencies:
npm install
2. Build the frontend
For building the frontend, run:
npm run build
3. Copy the compiled frontend files
Copy the contents of the frontend/build directory to the backend directory (src/dstack/_internal/server/statics):
cp -r build/ ../src/dstack/_internal/server/statics/
4. Run the dstack server
Now, if you've installed dstack in editable mode, you can simply run dstack server
and the frontend will be working.
dstack server
Developing the frontend
For frontend development, run a webpack dev server:
npm run start
The webpack dev server expects the API to be running on http://127.0.0.1:8000. So ensure to run the API on port 8000:
dstack server --port 8000