Just a little housekeeping to keep things well organised.
As the repository for the Django DRF code will now house the entire application, including the React project. We must remove the React git folder, .gitignore file and README from the frontend folder. If you want to copy any contents of your README file from the React project to your DRF README, you can do this now. Alternatively, you can access it from the original repository later to update your unified workspace documentation.
In the terminal window, change directory to the frontend folder with the following command
cd frontend
Enter the following command to remove the .git folder, .gitignore file and README.md from the frontend folder
rm -rf .git .gitignore README.md
Running this command from your workspace in the wrong working directory is dangerous. Check you are in the frontend directory by using the pwd
command.
Install the npm packages required for developing with React using the following command
npm install
This install will take some time, the terminal may appear to freeze for a few minutes. Once it does start to show activity you can ignore any deprecated warnings, these are extremely common and expected with npm installs.
Move back to the root directory of your project with the following command
cd ..
Ensure that your git commits are always made in the root folder, and not from the frontend folder when working in the terminal running the React server.
This would be a good point to commit your changes so far.
We need to make some changes to our React project for the development environment.