Django-React-Heroku-Test

Test deployment - Django with React on Heroku.

MIT License

Stars
0

Django-React-Heroku-Test

This implements the "Electoral" voting application, which when finished will use Django and Postgres for the backend, and React with Typescript for the frontend.

Live demo running here: https://rcf-electoral.herokuapp.com/

Done:

  1. Set up Django app
  2. Set up React app
  3. Get data from Django in React with Axios
  4. Set up Postgres database in Django
  5. Create test model and ensure database works
  6. Convert React app to Typescript
  7. Add react-router
  8. POST data to backend from frontend, on prod & dev.

ToDo:

  1. Add Google OAuth for gapps-domain authentication

Development

Before development, add a .env file with the following contents:

DATABASE_URL=postgres:// (insert heroku postgres URL)

To develop, run in separate terminal windows:

# Window 0
python manage.py runserver

# Window 1
cd electoral-frontend
yarn start

Resources

  1. Primary
    tutorial
  2. Axios with React
  3. Django docs- returning JSON
  4. Authentication with
    Google
Related Projects