Just to add some contrast to this $20k figure and Watham's comments about the upside, I've published several small books that get very good reviews but haven't sold a lot of copies. I self published on Amazon as an eBook and then Print on Demand. My profits have totaled less than $1,000 in a couple years. My problems are likely that I don't have an audience built and Amazon rank is terrible until you have sales.
If you're not in it _just_ for the money though, go for it. It's extremely satisfying.
My most popular book is actual a book about how I self published. Publish Your Ebook by Joel Dare.
It seems like a lot of communities are built up with the explicit intention of being in it just for the money. There seems to be a lot of hype generation and releasing for-profit educational materials alongside eachother.
In my opinion, there is a strange marketing game around web frameworks and web frontend development especially.
The best advice I got was to focus on the topic way more than on the actual content. Great quality content about a topic that is super niche won't make much revenue compared to an average book that reaches a wide market.
That's not to say that you should write average books. It's more that people usually underestimate the amount of time it takes to come up with a good idea. And then they keep investing time into a bad idea due to sunk cost fallacy.
If you're not in it _just_ for the money though, go for it. It's extremely satisfying.
My most popular book is actual a book about how I self published. Publish Your Ebook by Joel Dare.