Ask HN: Interested in an e-book on building web apps with Node.js and React?

42 points by hobonumber1 ↗ HN
Hey guys,

I just wanted to gauge interest levels in an e-book that goes through building a complete web application using React and NodeJS?

It would explain how to:

- Create a webserver with user authentication - Hook up and work with databases via an ORM. - Generate API endpoints - Connect API Endpoints with a front-end framework like React - Explain how React and Flux works with APIs - Tips and Best Practices on building out a CRUD application using this framework - Security - Maintenance - Best practices in Production

Questions: 1) Would you be interested? 2) Would you pay for it if it was good, and had sample chapters? 3) Where do you get this information now?

40 comments

[ 3.4 ms ] story [ 60.4 ms ] thread
I'd pay for it even if it was just empty repo => dumb site w/ user auth. Haven't found a good concise tutorial for that.
Seconded. I'm currently muddling through a universal Javaript React starter kit and wiuld love a comprehensive guide
Are you struggling just with setup?
No, I've created a fully functioning app. Just best practices for actually deploying in the wild
> I'd pay for it even if it was just empty repo => dumb site w/ user auth

Never understood what is so hard with user auth and why people need an example of a SPA with user auth. Your server is just a web API, so just use stateless authentication.

I think it's mostly because getting it wrong is a Pretty Big Deal, so people aren't sure if they can trust themselves and the scheme they came up with.
(comment deleted)
The tutorials/instructions I've see never address the reasons for the authors' decisions, and any alternative packages or approaches that might be considered by the reader. Informing should also be a goal rather than simply providing a recipe.

The reasons for these decisions would go a long way to addressing the concerns bitdeveloper has, too.

I'll be writing up my own experience building auth for askinline.com. I don't know how to keep you in the loop other than saying to follow me on Medium or Twitter.

It's a React + Redux front end with Hapi + Sequelize backend. It uses JWTs in local storage for authentication (that decision will take some defending since it most applications should store it in a cookie) and sometimes uses single uses JWTs for things like email verification. I'm planning to write up how we do Google Login, password based signup and login including email verification and initial load decisions tree for dashboard or login page.

"most applications should store it in a cookie"

Why do you think that most application should store JWT token in the cookie? Both approaches have their pros/cons.

User auth has definitely been the hard part for me as well on projects. I'd be interested.
Yes please, learning react and modern JS (coming from a simple jQuery background) has been hellish.
I would love to read this if you published it! I would pay for something that was really well written (gauged off of sample chapters). I would probably only pay around $5 for it.

Most importantly, if there was a way for you to host the ebook online and provide a way for someone to type code into your website and mess around with the source code. Think like Codecademy, with code on one side and the result on the other.

Just to add why I'm asking this:

I've just been building stuff out in Node/JS-land for a while and just want to give something back to the community. So I'm thinking about starting an e-book or a series of blog posts to educate people in things that I've learned. Learning people's use cases gives me a better understanding of how I can write things that genuinely solve pain points.

I would really appreciate it if people could PM me some type of contact info so I can keep in touch with anyone who is interested. My email is tilomitra[at]gmail[dot]com.

(comment deleted)
No thank you. This isn't of interest to me.
NodeJS is generally not an appropriate backend choice given the dynamic nature of the language. I would not be interested and would hope that it comes with warnings that such development stacks are usually only appropriate for small projects if at all.
I don't see why this is getting downvoted so heavily. OP asked a question and I gave an honest answer. Most people here understand that dynamic languages are a bad choice for big projects so I don't see why that would get downvoted either (even if I were wrong, I believe the rules state that downvoting isn't for things you disagree with, but things that add no value to the discussion).
Probably cognitive dissonance... if they've built a nodejs career they don't want to hear this kind of talk.
I suspect that the reason it is downvoted is because there is a strong claim that is not supported by examples, rationals, or reasons. In addition I suspect that the technical claim is contrary to some people's experience. I suspect that it's boldness and absent support are likely to correlate with poor internet behavior in other people's experience.

The guidelines do not advise people not to downvote for disagreement. The guidelines do ask people not complain about them.

Your comment is not a substantive addition to the discussion. It's generally understood that anyone on HN who doesn't take the time to click into this thread is likely to be either not in the target market or is otherwise unwilling to pay for an ebook on this topic. Chiming in on discussions anywhere simply to say "I'm not the target audience and here are some reasons that no one should be", is generally met with some social equivalent of downvotes.

When someone makes a thread along the lines of "Non-NodeJS devs, what keeps you from using NodeJS?", this comment will be a welcome addition. I'd suggest that even there, you add something substantive. That the language is dynamic is probably not a good starting place given that dynamic languages run like half of the internet. Start with threading, the event loop, callbacks or swallowed errors - all ripe targets.

While I wouldn't choose NodeJS either[1], your claim that dynamic languages are unsuitable for large systems doesn't stand up to casual scrutiny - Mozilla, Bitly, Industrial Light and Magic, Disqus, Quora, and so on all use Python to build large-scale, robust systems, some for well over a decade.

If you don't mind my asking, where did you come up with the idea that dynamic languages are unsuitable in this way?

[1] My reasons are many and varied, but largely come down to a matter of personal taste and bias due to long-ago experiences that soured me on JS.

What kind of framework would you recommend for any size of project.

Python/Django, Scala/Play, Ruby/Rails, GOlang/X, Dart/X,Elixir/Phoenix? ...

While I definitely wouldn't recommend it for a small project due to its verbosity, Java + the Spring ecosystem (or some other Java framework) probably powers a large percentage of the sites you visit regularly.
I don't want to sound snarky but I'm interested in ebook of writing web apps/pages in old ways. Send a request, receive a request without js. :))
Are you talking about server-rendered websites with NodeJS?
Yes.

Yes, after an introdutory free and useful by itself chapter/course.

Constantly looking for this kind of learning resource right now. I had a very good experience with this one: http://trysparkschool.com

In my personal case, as I'm learning to code from scratch, it is essential that the course do not assume too much about my previous knowledge. Check the Twitter course. It teaches me how to install everything from the most basic tools, like Terminal. It actually taught me what Terminal is.

I hope you do it, I very much need it. Get my email at the profile and please let me know if you do it. Good luck!

Not really.

A book is by definition 90+ pages long (probably a lot more). I will only want that much information if I'm completely new to the area.

I have never used Node.js nor React, but I did a fair amount of web design. A book will feel slow and repetitive.

Case in point: the last book I read was about Opencl. About a whole Chapter was dedicated to configuration parameters and C data types. I know that stuff has to be there in case the book is your only reference, but otherwise I can just check the Internet for that.

I know lots of people like technical books for pretty much the same reasons I don't, so keep that in mind too.

Yes--absolutely. There are a lot of video tutorials for React, but it feels that there's a lack of written guides at the moment. Not everyone learns best from videos, so having more choices to learn is huge. You should go for it.
There are people with all kinds of experience level, someone would definitely find it useful.

I did build a complete web app (basically a Reddit clone) in NodeJs from scratch recently (though Angular2 instead of React), most of the things that you described in your book's contents were in the official documentation or tutorials (and Stack overflow).

Still, I don't know things like server-side rendering, and although I was able to configure SystemJs I have no idea how to configure it (or its de/merits over bable/webpack), 3rd party authentication (Google/FB login) was a pain, and now I realize I should have used the Flux architecture and also used TDD. But then all this is just a google search away anyway.

However, I would have paid for the book you describe if a) I wasn't broke, b) was just beginning with web dev, c) the book built a complete nontrivial app (something like the Meteor/Telescope).

PS: Which nodeJs framework would you suggest/use?

I would recommend SailsJS. It's built with Express, so you get the Express ecosystem, but it comes with a lot of things that production-apps need out of the box, like security (CORS, CSRF), REST API generation, code conventions (models, controllers, views), etc.

I believe they went through YC, actually.

(comment deleted)
I would definitely be interested if you threw Electron in as well. I would pay $20-$30 for an ebook on that as I'm struggling with getting React to work with Electron and all the tutorials have their stuff just work and it doesn't work for me when copying what they have. It is beyond frustrating!