Answer the question
In order to leave comments, you need to log in
What architecture of reactjs/redux application do you have?
Good afternoon!
I am writing a client-side application using reactjs and redux.
After several months of work on the project, questions arose about the architecture of the project, the organization of the redux.
There is the following structure:
├── src
│ ├── assets
│ ├── components
│ │ ├── App.jsx
│ │ ├── blocks
│ │ ├── common
│ │ ├── settings
│ │ │ ├── components
│ │ │ │ ├── accounts
│ │ │ │ ├── buttonDotted
│ │ │ │ ├── collections
│ │ │ │ ├── settingsFilter
│ │ │ │ └── stores
│ │ │ │ ├── components
│ │ │ │ │ └── store
│ │ │ │ ├── stores.css
│ │ │ │ └── stores.jsx
│ │ │ ├── settings.css
│ │ │ ├── settings.jsx
│ │ │ ├── settingsNavigation.jsx
│ │ │ └── settingsRouter.jsx
│ │ └── signup
│ ├── constants
│ ├── index.js
│ ├── store
│ │ ├── actions
│ │ ├── constants
│ │ ├── reducers
│ │ └── store.js
│ └── util
----signup
├── components
├── signup.css
├── signup.jsx
└── signupComponent.jsx
├── store
│ ├── actions
│ │ ├── signup
│ │ └── store
│ │ └── store.js
│ ├── constants
│ ├── reducers
│ │ ├── index.js
│ │ ├── signup
│ │ │ └── index.js
│ │ └── store
│ │ ├── connectToStore.js
│ │ ├── getStores.js
│ │ ├── store.js
│ │ └── syncStore.js
│ └── store.js
`${store}.FETCH`, `${store}.FETCH_SUCCESS`
Answer the question
In order to leave comments, you need to log in
There are two good approaches to codebase organization that are suitable for most projects: File Type First and Feature First:
Проект:
/common
/api
/components
/ducks
/entities
/sagas
/selectors
/utils
/features
/Feature1
/Feature2
/Feature3
/Feature4
...
/FeatureN
/Main
/pages
index.js
App.js
routes.js
rootReducer.js
rootSaga.js
store.js
/Auth
/pages
index.js
App.js
routes.js
rootReducer.js
rootSaga.js
store.js
...
/features
/Accounts
/components
index.js
accountsDucks.js
accountsSaga.js
accountsSelectors.js
accountsApi.js
Accounts.js
AccountsContainer.js
/actions
/common
/components
/core
/Feed
/Profile
...
/constraints
/containers
/entries
/locales
/pages
/reducers
/utils
...
src/
--utils/
--config/
--css/
--img/
--components/
----User/
------User.jsx
------UserContainer.js
---- --UserReducer.js
------UserActions.js
Refused to divide the components into smart and stupid. Any component may need direct access to data, and throwing noodles into props is a thankless task. In general, everything is simple for me: components in the Components folder, reducers in the Reducers folder, actions in Actions, constants in Constants, and everything else as intended.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question