Skip to main content

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

[01/12] logo-mini