A module which represents part of a Reaat app could export an array of routes and a reducer.
export {default as routes} from './routes'
export {default as reducer} from './store/reducer'
The top level application can take these exports and collect them together into the root routes def and the root reducer.
source
├── app
│ ├── components
│ │ ├── SimpleDonut
│ │ │ ├── __tests__
│ │ │ │ └── SimpleDonut-test.js
│ │ │ └── index.js
│ │ └── View
│ │ └── index.js
│ ├── lib
│ │ ├── getEnv
│ │ │ └── index.js
│ │ └── resolveAsset
│ │ └── index.js
│ ├── modules
│ │ ├── beneficiaries
│ │ │ ├── store
│ │ │ │ ├── __tests__
│ │ │ │ │ └── factories.js
│ │ │ │ ├── helpers
│ │ │ │ │ └── index.js
│ │ │ │ └── reducer
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ ├── campaigns
│ │ │ ├── store
│ │ │ │ ├── __tests__
│ │ │ │ │ └── factories.js
│ │ │ │ ├── helpers
│ │ │ │ │ └── index.js
│ │ │ │ └── reducer
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ ├── donations
│ │ │ ├── store
│ │ │ │ ├── __tests__
│ │ │ │ │ └── factories.js
│ │ │ │ ├── helpers
│ │ │ │ │ └── index.js
│ │ │ │ └── reducer
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ ├── errors
│ │ │ └── index.js
│ │ ├── fundraiserCampaigns
│ │ │ ├── components
│ │ │ │ ├── FundraiserSummary
│ │ │ │ │ ├── __tests__
│ │ │ │ │ │ └── FundraiserSummary-test.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── FundraisingProgress
│ │ │ │ │ ├── __tests__
│ │ │ │ │ │ └── FundraisingProgress-test.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── Summary
│ │ │ │ │ └── index.js
│ │ │ │ └── __tests__
│ │ │ │ └── helpers.js
│ │ │ ├── routes
│ │ │ │ ├── Show
│ │ │ │ │ ├── __tests__
│ │ │ │ │ │ └── Show-test.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── __tests__
│ │ │ │ │ └── helpers.js
│ │ │ │ └── index.js
│ │ │ ├── store
│ │ │ │ ├── __tests__
│ │ │ │ │ └── factories.js
│ │ │ │ ├── actions
│ │ │ │ │ ├── __tests__
│ │ │ │ │ │ └── fetchFundraiserCampaign-test.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── helpers
│ │ │ │ │ └── index.js
│ │ │ │ ├── reducer
│ │ │ │ │ ├── list
│ │ │ │ │ │ └── index.js
│ │ │ │ │ ├── show
│ │ │ │ │ │ └── index.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── constants.js
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ └── fundraisers
│ │ ├── store
│ │ │ ├── __tests__
│ │ │ │ └── factories.js
│ │ │ ├── helpers
│ │ │ │ └── index.js
│ │ │ ├── reducer
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ └── index.js
│ ├── routes
│ │ └── index.js
│ ├── store
│ │ ├── reducer
│ │ │ └── index.js
│ │ ├── constants.js
│ │ └── index.js
│ ├── index.js
│ └── stats.js
├── client
│ ├── index.js
│ └── stats.js
├── config
│ ├── clientEnvRequirements.js
│ └── index.js
└── server
├── components
│ └── Document.js
├── lib
│ └── renderDocument.js
├── index.js
└── stats.js
As per Ben, I really like what this communicates.
Also think that
handlers
is kinda awkward although understand what you're trying to get at. Better asroute-handlers
at least. But it gets confusing when sitting next to anotherroutes
folder