Skip to content

Project structure and conventions

BN Developer edited this page Jan 25, 2022 · 8 revisions

This is a ruleset that defines guides of a project structure management. Why does it exist? There are several reasons for that:

  1. It is easier for teammates to help if you follow the common structure
  2. It helps us to perform a code review and ensure the highest quality of your code
  3. It implements the leading and proven software engineering practices

The philosophy

There are several generic, vague rules that put other things in structure. All other rules and minor things would be easy to understand if you remember those.

Follow the SOLID approach

Create single-responsibility, open to extension, closed for modification, replaceable components with specific interfaces that depend on abstractions. That's what the SOLID principle does. Ignore this approach right after you master it.

Re-use reliable things as much as possible

Do not write code if you can. Take something that is written, re-use, override. 99% of challenges were solved by others previously.

Understand what have you copied

If you copy something, read the documentation and understand how it works. No need to dive into details, but you need to understand the purpose and the outcomes of everything that's copied.

Keep structures flat

Do not create structures if you can. Do not create a folder if there are only 1-2 files in it.

Follow one logic

If you follow logic, follow it everywhere. If the logic doesn't work, come up with another one that covers all cases or states that there is no logic behind it.

Project Structure in detail

projectname
├── (.files)           – config files you don't need to touch
├── node_modules       – installed modules, no need to touch
├── packages           – folder for all independent apps
│   ├── cms            – content management app folder
│   └── website        – front-end app folder
├── .env               – main environment file
├── .env.dist          – main environment template
├── package.json       – project configurations and global scripts
├── README.md          – project readme
├── LICENSE            – license details
├── (*.lock files)     – autogenerated files
└── (*.yaml files)     – deployment and configs

Clone this wiki locally