LukeMurphey / textcritical_spa

A React-based SPA (single page application that serves as the frontend for TextCritical.net)
Apache License 2.0
1 stars 0 forks source link

TextCritical.net Single Page App (React)

A React-based SPA (single page application that serves as the frontend for TextCritical.net)

How do I run this?

Run yarn install to get the frontend ready to be executed.

You can run the front-end code using yarn start. However, this will not run the backend endpoints necessary for the app to run. To get a running version of the app, you will need to do one of the following:

Run TextCritical's Server locally

By default, webpack.dev.js is configured to assume that TextCritical is running locally. It can be run locally with Docker or run locally by running the Django app directly.

Use the Public Instance of TextCritical

Alternatively, the public instance of TextCritical can be used by modifying webpack.dev.js to use textcritical.net:

proxy: {
  '/api': {
    target: 'https://textcritical.net:443',
    secure: true,
    changeOrigin: true,
  },
  '/work_image': {
    target: 'https://textcritical.net:443',
    secure: true,
    changeOrigin: true,
  },
  'download/work': {
    target: 'https://textcritical.net:443',
    secure: true,
    changeOrigin: true,
  },
},

Steps Needed for the Development Environment

You will need to install nodeJS. Apt on Ubuntu will often give you an older version of nodeJS. You can install a later version by running the following:

sudo apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -

Once you do that, install some other things:

sudo apt install yarn npm