This repository uses a Linear Design System Pipeline and Universal Business Logic strategy.
Dependencies flow strictly downward. Higher layers orchestrate; lower layers provide primitives.

| Layer | Tag | Description | Allowed Dependencies |
|---|---|---|---|
| Entrypoints | layer:entrypoints |
Apps or Servers. The final "runners". | workflows, components, data, logic, shared |
| Workflows | layer:workflows |
Stateful user journeys & sub-routing. | components, ui-composites, logic, test-ui |
| Components | layer:components |
The Merge Point. UI + Data. | ui-composites, data, logic, test-ui |
| UI-Composites | layer:ui-composites |
Purely visual complex units (Cards). | ui-primitives, tokens, test-ui |
| UI-Primitives | layer:ui-primitives |
Atomic visual units (Buttons). | tokens, shared, test-ui |
| Data | layer:data |
GQL Clients, Hooks, Repositories. | logic, shared, test-logic |
| Logic | layer:logic |
Universal Schema Types & TS Generics. | shared, test-logic |
| Tokens | layer:tokens |
Design Tokens, Themes, Styling. | shared |
| Shared | layer:shared |
Base Utilities & Core Constants. | None (Foundation) |
- Entrypoint:
apps/my-new-app(layer:entrypoints). - Dependency: Should depend on a
Workflow(the main route) andTokens(the theme). - Responsibility: Provide the
<ThemeProvider />and<ApolloProvider />.
- Entrypoint:
apps/api-gateway(layer:entrypoints). - Dependency: Depends on
layer:logic(Schema Types) andlayer:data(Resolvers/DB). - Safety: If you accidentally import a
Button, Nx will block the build.
- Scenario: I have a new "Card" design for a client project.
- Tag:
layer:ui-composites. - Constraint: It can see
ui-primitives(Buttons) but cannot see GraphQL hooks. Use props for data!
- Scenario: I need a
UserHeaderthat fetches a profile picture via GraphQL. - Tag:
layer:components. - Merge: Imports
ui-composites(the layout) anddata(the hook). This is the only place they meet.
- Logic/Math Testing: Put in
layer:test-logic. Node-safe. - UI/Harness Testing: Put in
layer:test-ui. Can seeui-primitivesto provide helpers likeclickButton().
platform:browser: Code withwindow,document, or DOM-specific CSS.platform:node: Code withfs,path, or server-side resolvers.platform:shared: Pure TS (Shared by both).
Rule: platform:node libraries can never import platform:browser libraries.
