Running from Source

Running from Source

Requirements

  • Go version 1.13
  • Tesseract binary
  • Imagemagick binary

Optional Installs

To work on/edit the frontend you need the following:

  • Node
  • yarn
  • parcel

Once you have the backend requirements, edit the serverConfig.toml with the bin paths to tesseract and imagemagick. In the root of the project run go get to download all the dependencies (ensure go.mod exists) and then start the server with go run main.go. This will run the backend server, which, by default, serve the “built” frontend (located in “public/built”).

However, if you want to run a “live” version of the frontend you need to enter the “public” folder, then run yarn install. This should install every package you need from yarn.lock.

Then you can run parcel run index.html and parcel will server up the source of the React App, which you can access on (by default) :1234. To connect your live frontend to the backend you need to edit frontend-config.js with the apiURL to your backend. If you make changes to the frontend and want to have the backend serve it, run parcel build index.html and then copy the files into the “built” directory (although delete frontend-config.*.js since that is dynamically generated by the backend).