T
T
tushev2017-07-11 07:50:09
Composer
tushev, 2017-07-11 07:50:09

How to build a web project?

I want to learn how to correctly assemble large web projects that consist of a large number of components and include PHP, JS, CSS ... I would like to use package managers, for PHP - Composer, for JS / CSS - Bower. I would like to do automatic compilation of LESS / SASS to CSS, assembly, etc. Phing - perhaps it would also be nice to use.
I read a lot of theoretical articles and literature about how it should be right in the modern world. Unfortunately articles are usually either fully focused on PHP or fully JS/CSS, but in my projects both are important. To see how this is done in practice, I went to look at the device of popular projects on GitHub (mainly CMS, online stores, etc.). I was surprised to find that in practice, the maximum that is used in these projects is Composer. At the same time, the entire project is located in the web-root, and JS and PHP are mixed there. But textbooks teach that PHP should be outside the public_html directory !
Please tell me some projects in which all this is done "correctly". Or in practice, no one does projects "correctly" and these are only theoretical recommendations far from real life? Or am I misunderstanding something.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin Kitmanov, 2017-07-11
@k12th

Oh, grunt and bower ( While Bower is maintained, we recommend yarn and webpack for new front-end projects! ) are no longer used. gulp still lives somewhere, but far from everywhere. Front-end packages are installed by npm, the assembly is webpack.
Integration with a backend assembly usually comes down to running npm run buildin the right directory (any builder can run an arbitrary external command).
PS Yes, webpack hurts, but now it's much easier to find a ready-made config and minimally finish it for yourself. Yeoman also helps.

K
Kirill Babak, 2017-07-12
@iIIuminate

Look for the Laravel + Vue.js lessons, literally the beginning of creating a project, you will see there, only there will be src instead of public_html. Npm, webpack are also present.

M
Mixa, 2017-07-12
@Mixa

Even I did not understand about php outside of public_html. I think he meant the interpreter, not the executable files. In the web project itself, you set the logic and structure yourself, and everything is mixed up (although usually separate folders are created for css and js files), and this does not cause any problems. It seems to me that you are too bothered, while not practicing enough)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question