Glossary
Module
Structural unit of the project
A module usually means a specific file or directory (an abstraction in the context of a structure)
- authorization module
- page module
- the module of the component in the feature
- action module in the entity model
- etc.
Layer
Each of the directories located at the topmost level of the application.
This level defines the scope of responsibility of modules, as well as the level of danger of changes
โโโ src/
โโโ app/ # Initializing application logic
โโโ processes/ # (Optional) Application processes running over pages
โโโ pages/ # Application pages
โโโ widgets/ # Independent and self-contained blocks for pages
โโโ features/ # (Optional) Processing of user scenarios
โโโ entities/ # (Optional) Business entities that domain logic operates with
โโโ shared/ # Reused modules, non business specific
Slice
Each of the elements located at the top level of the layers
This level is poorly regulated is a methodology, but a lot depends on the specific project, stack and team
โโโ app/
| # Does not have specific slices,
| # Because it contains meta-logic on the project and its initialization
โโโ processes/
| # Slices implementing processes on pages
| โโโ payment
| โโโ auth
| โโโ quick-tour
| โโโ ...
โโโ pages/
| # Slices implementing application pages
| # At the same time, due to the specifics of routing, they can be invested in each other
| โโโ profile
| โโโ sign-up
| โโโ feed
| โโโ ...
โโโ widgets/
| # Slices implementing independent page blocks
| โโโ header
| โโโ feed
| โโโ ...
โโโ features/
| # Slices implementing user scenarios on pages
| โโโ auth-by-phone
| โโโ inline-post
| โโโ ...
โโโ entities/
| # Slices of business entities for implementing a more complex BL
| โโโ viewer
| โโโ posts
| โโโ i18n
| โโโ ...
โโโ shared/
| # Does not have specific slices
| # is rather a set of commonly used segments, without binding to the BL
Segment
Each of the modules located at the top level of each slice
This level determines the purpose of modules in the code and implementation, according to classical design models
{layer}/
โโโ {slice}/
| โโโ ui/ # UI-logic (components, ui-widgets, ...)
| โโโ model/ # Business logic (store, actions, effects, reducers, ...)
| โโโ lib/ # Infrastructure logic (utils/helpers)
| โโโ config/ # Application configuration (env-vars, ...)
| โโโ api/ # Logic of API requests (api instances, requests, ...)
note
Since not every layer explicitly uses slices (app, shared)
- Segments can be arranged according to their own rules
shared/{api, config}
- Or not to use
app/{providers, styles}
at all
See also
Was this page helpful?
Your feedback helps us improve the docs