As discussed in a few meetings, the size of files has ballooned over the projects lifespan. Quite a lot of js files (and the main css file) exceed 1000 lines. This is incredibly unwieldy to newcomers of the project and those without an intimate knowledge of the code base. This is especially an issue with what would be considered separate parts of code within the same file. (Main example of this is all of the projects routes are basically hidden in the middle of the main index.js file.
Is there a solution you'd like to recommend?
I will lay out a general plan of what code I will refactor into new files for a better structure that is more maintainable and welcoming to new contributors. These will be done in stages via PR's as to not just create one giant PR full of breaking changes for other contributors but this should not change the general running of the app whatsoever.
Plan
[ ] Separate routes out of src/index.js and into their own file/folder. Most likely either routes.js or src/routes/*.js for each route of group of related routes depending on the code.
[ ] Separate src/views/index.js into more readable chunks like markdown.js
[ ] Separate src/modles.js into a dir at src/models for easier editing of models
[ ] Optional: Maybe separate the main css file at src/assets/style.css (either multiple files covering different sections or looking into css preprocessors)
What's the problem you want solved?
As discussed in a few meetings, the size of files has ballooned over the projects lifespan. Quite a lot of js files (and the main css file) exceed 1000 lines. This is incredibly unwieldy to newcomers of the project and those without an intimate knowledge of the code base. This is especially an issue with what would be considered separate parts of code within the same file. (Main example of this is all of the projects routes are basically hidden in the middle of the main index.js file.
Is there a solution you'd like to recommend?
I will lay out a general plan of what code I will refactor into new files for a better structure that is more maintainable and welcoming to new contributors. These will be done in stages via PR's as to not just create one giant PR full of breaking changes for other contributors but this should not change the general running of the app whatsoever.
Plan