Skip to content

Instantly share code, notes, and snippets.

@artalar
Last active December 20, 2018 05:35
Show Gist options
  • Select an option

  • Save artalar/406e505e107a65f07180fa6274ef2437 to your computer and use it in GitHub Desktop.

Select an option

Save artalar/406e505e107a65f07180fa6274ef2437 to your computer and use it in GitHub Desktop.

Concept

  • layout
    • index.js
    • [ComponentName]
      • index.js
      • ComponentName.js
      • index.test.js
      • index.mdx
  • shared
    • [name].js
  • workflow
    • model
      • index.js
      • [name].js
    • process
      • index.js
      • [name].js
  • pages
    • [ModuleName]
      • index.js
      • [ModuleName].js
      • shared
        • [name].js
      • layout
      • workflow
      • modules
        • index.js
        • [ModuleName]
          • index.js
          • [ModuleName].js
          • layout
          • workflow
          • modules
            • index.js
            • [ModuleName]
              • index.js, [ModuleName].js, layout, workflow, modules...
            • ...
          • ...

Description

  • layout
    dumb pull-based components
    returns only valid DOM-node (can not be "container")
    haven't imports higher layout path, except shared
    each one can reuse the other
    • index.js
      reexports
    • [ComponentName]
      • index.js
        reexport
      • ComponentName.js
        source code of component
      • index.test.js
        tests
      • index.mdx
        description and examples
  • shared
    shared contants, pure utility functions
    smart components / containers / HOCs without side-effects
    for all project modules
    • [name].js
  • workflow
    business logic / user story specific code with side effects
    haven't imports higher workflow path, except shared
    • model
      • index.js
        reexport
      • [name].js
        source code of initial state, validators / types
    • process
      • index.js
        reexport
      • [name].js
        source code with business logic and side effects
  • pages
    pages is root modules
    • [ModuleName]
      the page is one of the root modules
      only root modules have shared folder
      other [recursively] inner modules have not shared folder
      • index.js
        reexport
      • [ModuleName].js
        source code of combine layouts with data (global state) from workflow
      • shared
        reexports from project shared
        only root modules have shared folder
        • [name].js
      • layout
        like projects layout, but can imports shared only from root module (not projects)
      • workflow
        like projects workflow, but can imports shared only from root module (not projects)
      • modules
        • index.js
          reexports
        • [ModuleName]
          • index.js
          • [ModuleName].js
          • layout
          • workflow
          • modules
            • index.js
            • [ModuleName]
              • index.js, [ModuleName].js, layout, workflow, modules...
            • ...
          • ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment