gradio/frontend
Abubakar Abid ed1b2a3477
Merge pull request #417 from gradio-app/dependabot/npm_and_yarn/frontend/url-parse-1.5.3
Bump url-parse from 1.5.1 to 1.5.3 in /frontend
2021-12-16 09:37:44 -06:00
..
public webcam video support 2021-11-24 19:23:42 +00:00
src fix video recorder for iphone 2021-12-01 02:59:35 +00:00
.dockerignore Website: WIP (#328) 2021-12-13 22:02:19 -08:00
.eslintignore add linting 2021-08-06 21:04:28 +00:00
.gitignore react changes 2021-04-08 07:43:19 -07:00
craco.config.js Fixed video component's flagging method (#322) 2021-10-28 17:29:04 -07:00
package-lock.json Merge pull request #417 from gradio-app/dependabot/npm_and_yarn/frontend/url-parse-1.5.3 2021-12-16 09:37:44 -06:00
package.json remove plotly for chartjs 2021-11-22 20:29:32 +00:00
README.md Update frontend readme 2021-10-07 13:43:09 -07:00
tailwind.config.js Add dark theme for huggingface (#273) 2021-09-27 14:07:17 -07:00

Gradio Frontend

This directory contains a React App that renders the frontend of the gradio framework.

Development Setup

To make changes to the gradio frontend, you will need to have the following installed

  • npm / node
  • python3
  • gradio

Once node is installed, make sure to run npm install in this directory to install the node packages.

Because this is only the frontend of the library, you must first launch a Gradio interface running on port 7860, which will be used as a backend. You can use any of the demo projects in the gradio/demo folder to serve this backend role, but make sure that the port is set to 7860. Then you launch the development frontend by running npm run start. Once this is run, the frontend development will launch on port 3000. It will connect with port 7860 to load the initial configuration and make API calls on submit.

As a Create-React-App, any changes you make in the code will automatically reflect in the development frontend.

Committing Changes

In production, the frontend is compiled and stored in the gradio/gradio/frontend directory. (This readme is in gradio/frontend, a different directory outside the python package). To compile, run npm run build. At the end of the process, you should see the message "Compiled successfully" - there may be an warning or error thrown about not being able to find bundle.css which you can ignore. To include the compiled js into your local python version of gradio, run python3 setup.py install and then launch a gradio interface. Your changes should be visible on port 7860.