This process will allow you to move a React project into the same workspace as a Django API.
The benefits of this include:
CORS will no longer be an issue as requests and responses will come from a shared base URL, both in your development and production environments
You will be able to see the terminal logs for your API while interacting with the React side of your project in development, making debugging significantly easier
You will be able to work on the development versions of both the API and the React project simultaneously
With the front and back end applications on the same domain, Cookies (containing the JSONWebToken) required for authentication will not be blocked from being set on browsers that currently have cross-site tracking protection enabled by default. This change will allow authentication and authorisation to run in these browsers without errors
When you have finished these steps, you will have a working development environment, built on the existing workspace for your DRF API, that includes a folder containing all of your React code. You will be able to run both sections of this project in separate terminals.
There are further steps for combining the two projects under one terminal for final deployment, these are in a separate document.
We will begin by getting all the files in the same place.