bestofjs-webui
is a Single-Page-Application made with React, Redux for the state management, and React-Router.
It can be hosted on any static hosting server.
We use GitHub pages for the production version to take advantage of js.org
domain.
Data comes from a JSON file, hosted on Firebase.com, built every day by a CI server.
https://bestofjs-api-dev.firebaseapp.com/projects.json
When the application starts, we make a GET request to this URL and we dispatch an action 'FETCH_PROJECTS_SUCCESS' when we get data.
Data is processed by a reducer, the entities
branch of the state is created.
As much as possible, we try to make the state the "single source of truth".
Every time we need something that can be computed from the state, we use selectors
(see Reselect) library but we don't update the state.
To inspect the state and to see how actions update the state, Redux DevTools chrome extension is recommended.
{
"entities": {
"projects": {
"angular": {},
"react": {}
},
"tags": {
"framework": {},
"test": {}
}
},
"auth": {
"username": "michaelrambeau",
"name": "Michael Rambeau",
"user_id": "github|123456",
"myProjects": []
},
"ui": {
}
}