Spaces:
Running
Running
metadata
title: Optimization
emoji: 🚀
colorFrom: purple
colorTo: indigo
sdk: static
app_file: dist/index.html
pinned: false
Developer's Guide for React frontend
Prerequisites
Install Node.js if not done yet. The following commands should run if you have it installed.
node -v
npm -v
Local Development
First go to the react frontend folder:
cd frontends/react
Run the following commands to install required packages when you run the code the first time or after you make changes to package.json.
npm install
Now you should be able to start the local development server:
npm run dev
Open the link printed out on the terminal. The webpage automatically reloads when files are edited.
Deploy to Hugging Face
Build the production version:
npm run build
This generates the production build inside the dist/ directory.
Commit and push:
git add <files>
git commit
git push
⚠️ Make sure the dist/ directory is included when adding to git.
⚠️ Even if you only changed the backend, you must still run npm run build when deploying or it will not update.