Make authentification guide simpler
See original GitHub issueHi, guys!
First of all, great project idea šIāve tried to come up with a valid idea on a usable data synchronization engine between backend and client, and all I got was sending data with timestamps back and forth, not so convenient. Glad someone wants to make this whole mess working once and for all.
Stumbled upon Andreyās request to try and launch logux following your starting guide and drop a line on problems one may encounter.
Iāve tried to carefully follow every step, but some results doesnāt match those in the doc.
reducers/index.js
If you implement it like it is in the doc, nothing will work on this step, because of an error:
Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.
Iāve changed the implementation to a simple counter reducer and this error was gone. Example purpose only, of course.
const reducer = (state = 0, action) => {
if(action.type === 'inc') return state + action.payload
else if(action.type === 'dec') return state - action.payload
else return state
}
export default reducer
Logux server sent error: Wrong credentials
Also doesnāt seem to work, I donāt even have anything in WS tab except the one with hot code reload stuff.
I had a thought, that I may be watching the wrong place, but Iāve even tried to throw an error in server.auth
method, but nothing happens at all; however if I open the healthcheck url everything seems to be fine. Can you please tell me what Iām doing wrong?
My opinions
The rest is only my opinion on the document itself, so you can ignore if you want š
- I think this guide should separate authorization implementation details and logux server stuff. I would even offer you to change authentication chapter to something like āPretend we only have a user with email test@example.com and password 123456ā. It would make the demo 10 times simpler. It would also mean that you can drop the DB stuff out of tutorial and, say, use node module variables as storage just for the sake of simplicity. Does it really matter how I retrieve data when all I want is to have a grasp on how the library works?
- Iām not sure about it, but seems to me on current stage of the project every single document anyone reads should sell the project idea, jump to the fancy stuff and avoid all the unnecessary instructions. From what I saw the tutorial was mostly a demonstration of different stuff loosely related to the topic. It would be awesome to have something like the README.md demonstration, but the one you can touch, run and see how it works in the wild with all the fancy stuff that you talk about (like conflict resolution, offline-first work and multi-tab/multi-device).
Anyway, good luck with the project. Will follow you and try to use in future š
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
It is more complicated.
Yeap, this part is much better in showing Logux benefits.
Thank for suggestions.
Fixed 66e8b7f
At what step did you find this error?
If it was still on
3-creating-redux.md
, how we can make this warning more clear and understandable?I am afraid of repeating MongoDB problem. They have very simple auth process by default. And now most of MongoDB databases are not protected at all.
Maybe we can add some
logux/auth
library to simplify examples, but I want to finish docs first and then move to create helpers (and updating docs using these helpers).I want to be more on Ruby on Rails way with everything is ready after initializing, rather than Node.js way when junior developers donāt know how to do basic things like adding DB correctly.
Yeap. Docs are just in the beginning.
I will create an example and more docs about Logux internals and best practices.
Right now we have selling
1-architecture
part and very production oriented2-starting
.You are right that
2-starting
are created very close to the real production code. But it was made by a purpose. I want to give a strict instruction on how to create a real project, not fancy but dangerous demo.However, I agree that we should be even more on Ruby on Rails way and provide good production ready server with fewer steps. I will do it after I will finish the first version of the docs.