-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server Side File Reorganization #397
Conversation
[diff-counting] Significant lines: 3291. This diff might be too big! Developer leads are invited to review the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this is a lot! Thanks for the hard work. The 3 a.m. code grind is real. I think with the backend, I am still familiarizing myself with how it is set up but will try my best to comment and give some feedback.
Regarding basic formatting and structure, I wrote a little write-up on the notion here: my notes on phase 1
I have not truly looked into much, but I am wondering why we utilize the register
function as opposed to something simpler. Is there a certain reason for this? I feel it abstracts too much away in a function with not much room for customizability.
…ell-dti/course-reviews-react-2.0 into michelle/restructure-server
…s-react-2.0 into michelle/restructure-server
I think there is a lot of code which is really overwhelming, especially since I'm so new to everything, and I think you've made really good progress restructuring the code to be easier to understand. |
Summary
This pull request is the beginning of a movement to make CU Reviews a more readable, easier to understand code base by structuring and organizing files in more approachable formats.
Within the
/server
file path, it's divided into adb
folder and anendpoints
folder.DB Folder
The
db
folder contains all relevant files in terms of server side database schemas as well as the testing file for initializing the database (should be deprecated in the future).Endpoints Folder
The
endpoints
folder contains all files for relevant endpoints. For example, within theadmin
folder, there are files that are relevant for theadmin
page such as various actions and charts (this needs to be heavily refactored for future use). At its core, each subfolder within theendpoints
folder describes the relevant routes for some backend functionality. For example, theprofile
subfolder contains all relevant routes that are needed for the profile feature and thereview
subfolder contains all relevant routes that are needed for reviews (i.e leaving a review, finding a review helpful, etc). The core files are theroutes.ts
,types.ts
, andfunctions.ts
files.The
functions.ts
files contain all necessary helper functions that may be utilized in theroutes.ts
file. The purpose of this is to abstract away the functions and modularize this for easier readability and accessibility. Thetypes.ts
files contain all necessary interfaces, constants, and types created for the relevantroutes.ts
file. Again, making it easier to find exactly where to add necessary types. Theroutes.ts
files should contain the core functionality of the API endpoint where thefunctions.ts
andtypes.ts
files are used as support.Tests Folder
All test suites and the creation of the Jest test server is located in the
/test
folder for ease of access in adding new tests to relevant testing files.Utils Folder
The
utils
folder contains some global helper functions (will be rearranged and deprecated).Progress
routes.ts
,functions.ts
, andutils.ts
filesutils.ts
file into appropriate filesadmin
folderAdminActions.ts
andAdminChart.ts
AdminActions.ts
andAdminChart.ts
auth
foldergetVerificationTicket
function tofunctions.ts
profile
folderreview
foldersearch
folderTest Plan
Tested locally ensuring functionality remains the same and unit tests pass.
Notes
For future changes and notes:
Breaking Changes