First, there is no 100% sure way to standardize a project, what you have there are some pre-established standards by the community, which claims to be the best or the most accepted, until there appears some fault 'in this pattern' (whether security, usability, performance, etc.).
What I suggest, however, is to learn the fundamental points of the language itself that you have chosen to use as a working tool or by hobby same. Then learn some pattern of these already used, as for example the pattern MVC (Model-View-Controller), which, to me, is too complicated for a beginner to learn.
Look at this: even Mozilla Firefox, on its development site, says that there is no standard.
Facebook, through its React JS Framework, says the same thing.
If you take 100 projects from 100 different companies, you’ll see that, in a probability of almost 100 percent of them, the projects are different, and in some, they’re not in any of these pre-established standards.
Again, to conclude, Oboro saying that the most important thing is to learn the basics, that is, learn what your programming language does, its main features, etc., then, after you have at least a certain domain of it, choose a pattern of this. It could be up to MVC, but with the advent of functional programming, such as in React Js (front-end), it would be nice to learn both ways.
Also, see the difference between programming monolithic, which, in short, is to put everything in one place and programming based on services or in micro-services, that parts of your project are placed in different places. Currently, the latter is being widely accepted.
When you said: "the code gets a huge mess", you probably referred to the programming monolithic (even unknowingly), although in service-based programming, there is also mess.
The moment you really learn the basics of web programming, anything you put to learn, you’ll easily learn, even any pattern of this.
So, start with a basic structure (it can be monolithic), you can create it yourself; understand how you care about files, relative paths, absolute, for example:
the difference include, include_once, require, require_once
, etc., in php.
root:
- index.php (caso seja php)
- assets (onde irão os arquivos css, javascripts, fontes)
- class (pode colocar algumas classes php)
I personally wouldn’t advise using such a standard (MVC, etc.) in the beginning, because you will not absorb much, and may even hinder learning in the beginning.
REFERENCE:
- https://en.wikipedia.org/wiki/Model–view–controller
- https://developer.mozilla.org/en-US/docs/Web/JavaScript
- https://pt-br.reactjs.org/docs/getting-started.html
Ok, what exactly is the problem you want to solve? Organizing folders or blocking some files from being accessed directly?
– Woss
I would like a help on the organizing part.
– Bruno Attina
The answer to this will be based on opinion, as provided in [help] (if you have not seen it, I recommend to access it and do the [tour]). There are no rules about how you will organize your project. Only you, as responsible, can determine based on what makes your life easier.
– Woss
Really I am the one who decides, however, I would like a help, from someone more experienced who has hit this key and found some light that helped kk.
– Bruno Attina
Examples of organization, of your own projects or some of which you are based. My idea here is not to copy/imitate, but to analyze and create a "style" of their own from things that work and are really viable.
– Bruno Attina
If you want a direction, look for HTML Boilerplate and study everything, but everything, from it.
– Woss