The impetus for building it was that I was trying to find a good solution to my own problem and wasn't happy with existing solutions. I knew that it was a niche product, but I figured at the very least if I built this I would use it. Before building it I also talked to a couple of friends who said "Oh, yeah, I'd pay you for that." That was enough validation for me to spend a weekend building a basic version with a friend of mine. After that I started using it immediately and had those two friends sign up (and pay). Their feedback, and my own usage, gave me the motivation to keep improving the product.
The other thing I would mention is expectations setting. The "build it and they will come" mentality is really hard to overcome when you're excited about your side-project. You figure you will turn it on and people will immediately start signing up. In my case it was several weeks (maybe even closer to two months) before I had a paying customer other than those first two friends. It's easy to be discouraged during that time and completely abandon your project. Have a basic marketing plan, stick with it, and don't set your expectations too high. It will take time.