elvis-hf/optimization
0
1---2title: Optimization3emoji: 🚀4colorFrom: purple5colorTo: indigo6sdk: static7app_file: dist/index.html8pinned: false9---10 11# Developer's Guide for React frontend12 13## Prerequisites14 15Install **Node.js** if not done yet. The following commands should run if you have it installed.16 17```bash18node -v19npm -v20```21 22## Local Development 23 24First go to the react frontend folder:25```bash26cd frontends/react27```28 29Run the following commands to install required packages when you run the code the first time or after you make changes to `package.json`.30```bash31npm install32```33 34Now you should be able to start the local development server:35```bash36npm run dev37```38Open the link printed out on the terminal. The webpage automatically reloads when files are edited. 39 40## Deploy to Hugging Face41 42### Build the production version:43 44```bash45npm run build46```47 48This generates the production build inside the `dist/` directory.49 50### Commit and push:51 52```bash53git add <files>54git commit55git push56```57 58⚠️ Make sure the `dist/` directory is included when adding to git. 59⚠️ Even if you only changed the backend, you must still run `npm run build` when deploying or it will not update.60 