nickheyer / DiscoFlix

A simple media-requesting, Radarr/Sonarr-interfacing, movie and tv show-listing Chat Bot web-app for your media server.
45 stars 3 forks source link

Organize structure of /shared (now core/) and eliminate redundancy #30

Closed nickheyer closed 6 months ago

nickheyer commented 7 months ago

Currently, there exists a lot of excessively imported/exported dependencies for our CoreService.js class/file. There also is a very poorly designed structure for our files containing "modules" or methods (for CoreService).

We need to create some clear seperation and distinction for functionality and import-logistics within our file structure. A lot of this doesn't make sense at the moment. We should be looking to cut down on code reuse where it makes sense, as well as merging files/dirs where it makes sense.

Our current file/module structure for shared/ (now core/): ┣ 📂methods ┃ ┣ 📂discord ┃ ┃ ┣ 📜botController.js ┃ ┃ ┣ 📜botMethods.js ┃ ┃ ┗ 📜index.js ┃ ┣ 📂rendering ┃ ┃ ┣ 📜index.js ┃ ┃ ┣ 📜serverBarRendering.js ┃ ┃ ┗ 📜templateCompiler.js ┃ ┣ 📂server ┃ ┃ ┣ 📜index.js ┃ ┃ ┗ 📜processTerminator.js ┃ ┣ 📂websocket ┃ ┃ ┣ 📜connections.js ┃ ┃ ┗ 📜index.js ┃ ┗ 📜index.js ┣ 📂models ┃ ┣ 📜configuration.js ┃ ┣ 📜discordBot.js ┃ ┣ 📜discordServer.js ┃ ┣ 📜index.js ┃ ┣ 📜state.js ┃ ┗ 📜user.js ┣ 📂wsroutes ┃ ┣ 📜index.js ┃ ┗ 📜onConnect.js ┗ 📜CoreService.js