We have a directory structure that currently forces us to run the frontend/backend separately and keep track of both processes. The structure also uses the frontend and backend naming structure, while most other projects use the client and server naming structure. The process for installing new packages was also a little tedious.
Solution
This PR does a few main things:
Renames the frontendbackend to clientserver
Adds a root npm project to hold a few scripts. The most important 2 scripts being npm run dev (which runs both the client and server concurrently with one command) and npm install (which installs the necessary packages for all 3 npm projects).
Changes the API url to both run on port 5000 (just what I saw a lot of other people use) and use the /api prefix to the URLs
Testing
This was tested by loading the website and ensuring that the Todo widget still functioned properly. This means that the frontend is still able to properly communicate with the backend with the new changes.
Notes
I also tried to split up the dependencies and devDependencies when installing the packages. Whenever we install packages that are only used for development, we should use the -D flag to specify it's only for development.
Problem
We have a directory structure that currently forces us to run the frontend/backend separately and keep track of both processes. The structure also uses the
frontend
andbackend
naming structure, while most other projects use theclient
andserver
naming structure. The process for installing new packages was also a little tedious.Solution
This PR does a few main things:
frontend
backend
toclient
server
npm run dev
(which runs both the client and server concurrently with one command) andnpm install
(which installs the necessary packages for all 3 npm projects)./api
prefix to the URLsTesting
This was tested by loading the website and ensuring that the Todo widget still functioned properly. This means that the frontend is still able to properly communicate with the backend with the new changes.
Notes
I also tried to split up the dependencies and devDependencies when installing the packages. Whenever we install packages that are only used for development, we should use the
-D
flag to specify it's only for development.Closes #24