✅ 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
Pobiega22h ago
Grouping things by what they are instead of what they relate to tends to get messy I personally much prefer $vsa
packetphysicist
packetphysicist22h 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
Pobiega22h ago
ye
packetphysicist
packetphysicist22h ago
Alright, is that kind of the same as the VSA?
Pobiega
Pobiega22h ago
ye
packetphysicist
packetphysicist22h 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
Pobiega22h ago
could be, sure
packetphysicist
packetphysicist22h ago
What would you suggest?
Pobiega
Pobiega22h ago
well idk what your middleware does 😄 but if it deals with auth or security, that seems fine
packetphysicist
packetphysicist22h 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
Pobiega22h ago
could do that, but if its just a single item in the folder, you can just keep it at top level
canton7
canton722h 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
packetphysicist22h ago
:peepoNoted: Alright, thank you everyone. $close
MODiX
MODiX22h 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