ReactJS Flux Application directory structure -


my team working on large application being written in reactjs using facebook's flux architecture. still in infancy right going grow big soon. have more 50 small component views, plenty of actions, stores , action-creators.

currently, our directory structure looks -

app |___ module_1 |    |___ components |    |    |___ component1.react.js |    |    |___ component2.react.js |    |___ module1actioncreators.js |    |___ module1constants.js |    |___ module1store.js | |___ module_2      |___ ... (same structure above) 

one of problems approach module_x folders become increasingly large in number app grows.

does have share how structured app? in our experience, facebook's example apps (todo , chat) have architecture suited small apps once stores, components , actions grow in number, becomes harder manage.

thanks in advance.

the usual directory structure more this:

 js ├── appbootstrap.js ├── appconstants.js ├── appdispatcher.js ├── actions │   ├── appactions.js │   ├── friendactions.js │   └── photoactions.js ├── components │   ├── approot.react.js │   ├── friends │   │   ├── friend.react.js │   │   ├── friendlist.react.js │   │   └── friendsection.react.js // querying-view, aka controller-view │   └── photos │       ├── photo.react.js │       ├── photocategorycard.react.js │       ├── photocategorycardtitle.react.js │       ├── photogrid.react.js │       └── photosection.react.js // querying-view ├── stores │   ├── friendstore.js │   ├── photostore.js │   └── __tests__ │       ├── friendstore-test.js │       └── photostore-test.js └── utils     ├── appwebapiutils.js     ├── fooutils.js     └── __tests__         ├── appwebapiutils-test.js         └── fooutils-test.js 

the css directory looks mirror of components directory, 1 css file per component. folks these days prefer of styling inline on component, however.

don't overthink -- there not 1:1 between stores , querying-view or "section", there in example.

and need right app. not dogma. data flow stuff, inversion of control , decoupling of stores -- these more important ideas how organize files.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -