We’ve all had experience when we either needed to share our code with someone else or go back and figure it out ourselves and realized that it was bit of a clumsy mess. This is part of the process of learning, but there are 5 things you can start doing today that can improve your project and code quality significantly with minimal invested effort.
Choosing a good structure for your project can determine how often you come back to improve it. When the structure makes sense and provides quick access to the portion of code you are interested in, you are much more likely to make improvements because you understand the structure without having to spend time re-learning the how it is structured.
In my opinion there is no one right answer for how this should be done. We all have different preferences, the most important thing is consistency throughout.
As an example, if you’re starting a project with ReactJs and you aren’t familiar with best practices then I would suggest Googling “Reactjs project structure examples”. You’ll find handfuls of examples on Github showing different ways to structure and organize projects. It’s worth taking a quick look and picking one that makes sense for your use case.
If you want to invent your own structure, great! Here are some tips:
src/
folder — all of the code you write should go in heresrc/
folder