Mastering Folder Structure
One of the things that bothers me most when building web applications is the folder structure. I don’t struggle with the design or the code, but when it’s time to create a new file and place it in a logical location, I start questioning the life decisions that brought me to that exact moment.
It’s annoying to figure out the folder structure when starting a project.
Angular makes some decisions easier by following certain rules regarding file contents (components should go into *.component.ts, directives should go inside *.directive.ts, etc.). However, finding a place for these files still requires extra attention and decision-making.
When working with small projects, folder structure may be overlooked, as it might not be a significant issue in the long run, especially for projects with a small number of files. However, as the size of the project grows, the need for a proper file/folder structure arises, both for the developers' sanity and for the project's maintainability.
With all that being said, one of my primary goals with BuilderKit’s Starter project is to provide a flexible set of rules that can answer questions that often cause nightmares, such as “Where should I put this file?” or “Does this file really belong here?”.
After working with Angular for over a decade on various projects—such as admin themes/templates (I know, I know, don’t roll your eyes like that, I’m not here to promote them, I promise), building the foundations of a main application for a fintech company, and spending countless hours on a remote learning platform for universities, to name a few—I believe I have a good understanding of how to create a folder structure that works for all levels of applications, from basic blogs to enterprise-grade applications.
There is still a lot to do and a long way to go, but sharing the progress and having fun along the journey is another goal of mine with this project. People who work under NDAs or other companies' strict rules understand this. You build things, solve problems that others might never encounter, and accumulate an enormous amount of knowledge, yet you have nothing to show off or brag about when you go to that conference or meetup. So, here’s to building that portfolio and having fun out in the open.
Cheers!