## Structure 1 - Layered Modularization This structure is useful for medium to large projects where responsibilities are well divided. Each layer represents a part of the application (frontend, backend, config) and facilitates teamwork. ``` project-root/ │ ├── config/ │ ├── database.js │ └── server.js │ ├── src/ │ ├── controllers/ │ │ └── userController.js │ ├── models/ │ │ └── userModel.js │ ├── routes/ │ │ └── userRoutes.js │ ├── services/ │ │ └── authService.js │ └── utils/ │ └── helpers.js │ ├── public/ │ ├── css/ │ ├── images/ │ └── js/ │ ├── tests/ │ ├── controllers/ │ └── models/ │ └── index.js ``` ## <br>Structure 2 - Modularization by Functionality In this structure, the organization is done by functionality. Each module includes all the layers (controller, model, etc.) in the same directory. Ideal for projects with independent functionality. ``` project-root/ │ ├── config/ │ ├── database.js │ └── server.js │ ├── modules/ │ ├── auth/ │ │ ├── authController.js │ │ ├── authModel.js │ │ ├── authRoutes.js │ │ └── authService.js │ ├── user/ │ │ ├── userController.js │ │ ├── userModel.js │ │ ├── userRoutes.js │ │ └── userService.js │ ├── public/ │ ├── css/ │ ├── images/ │ └── js/ │ ├── tests/ │ └── modules/ │ ├── auth/ │ └── user/ │ └── index.js ``` These are the most appropriate folder structures for web applications. Try them out and let us know what you think
I just finished programming a web chat that has my typical structure. Here is the [source](https://hg.reactionary.software/repo/chat/file/tip).
wow, that's interesting. how long did it take to design and program that?
2 weeks. You can chat with me [here](https://chat.luan.software/?with=fschmidt@gmail.com). I needed this for support for a web business.
i was delighted with your service mr fschmidt, and it reminds me a lot of irc. how about we open a room and in it we only open the tech, fonts and languages that require a more complex way of programming?
What do you mean by this? The point of my tools is to make all application programming simple (not complex). My chat code is simple.
yes, I mean complex for those who need tools to create things like frameworks. My way of working is very similar to yours and that's why I say that. But we can continue this conversation here in this room. [https://chat-to.dev/chat?q=General](https://chat-to.dev/chat?q=General)
No one should create frameworks, the horror. Libs only. Anyway, make a room and send me the link and I will participate.