DayInReview / day-in-review

Full Day In Review application
http://dayinreview.org
Apache License 2.0
2 stars 0 forks source link

MERN Stack Structure #25

Closed JimothyGreene closed 3 years ago

JimothyGreene commented 3 years ago

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 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:

  1. Renames the frontend backend to client server
  2. 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).
  3. 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.

Closes #24