✅ Unclear file structure

+---.github | ---workflows ---API +---Controllers +---Data +---Filters +---Middleware +---Migrations +---Models +---obj +---Options +---Properties +---RESTFiles +---Services This is my current folder structure. It feels very unclear and way too messy. How can I clean this up? I was thinking about putting Filters, Middleware and Options in the same folder as they're related. I wasn't sure how to name the parent folder of that though. I have about 9 controllers, the same amount in services and a few more models.
15 Replies
Pobiega
Pobiega2mo ago
Grouping things by what they are instead of what they relate to tends to get messy I personally much prefer $vsa
packetphysicist
packetphysicistOP2mo ago
Should I try (I think it's called) domain-driven design? Where you put everything related to a theatreshow together. Instead of categorized by what they are, group by their goal kind of
Pobiega
Pobiega2mo ago
ye
packetphysicist
packetphysicistOP2mo ago
Alright, is that kind of the same as the VSA?
Pobiega
Pobiega2mo ago
ye
packetphysicist
packetphysicistOP2mo ago
I took a quick peek okok Thank you once again @Pobiega You the 🐐 Oh wait Where would Middleware etc go in this? Seeing as theyre not really related to any specific domain Would that be "Security" maybe?
Pobiega
Pobiega2mo ago
could be, sure
packetphysicist
packetphysicistOP2mo ago
What would you suggest?
Pobiega
Pobiega2mo ago
well idk what your middleware does 😄 but if it deals with auth or security, that seems fine
packetphysicist
packetphysicistOP2mo ago
I have a middleware that logs and a filter that checks for an API key on certain requests. And an option for the filter Ah I guess, a Logging directory and Authentication/Security one
Pobiega
Pobiega2mo ago
could do that, but if its just a single item in the folder, you can just keep it at top level
canton7
canton72mo ago
Really, there are no strictly right/wrong answers, and I often end up reorganising things for clarity as the project develops Just be consistent and predictable
packetphysicist
packetphysicistOP2mo ago
:peepoNoted: Alright, thank you everyone. $close
MODiX
MODiX2mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Want results from more Discord servers?
Add your server