I think you're confusing purpose with motivation, which are two different things.
By what you've described, you're looking for a purpose to code but can't find any because all the ideas are already taken... even though this may (somewhat) be true, just because the wheel was invented doesn't mean the world didn't strive to make it better. So, it doesn't really matter that something has already been coded and it's stable, if you feel you can make it better, then go for it.
As for motivation to code, this has to come from within, it has to be a true passion in order for something great to come out of your code. Look along the history, pretty much anyone who accomplished something great did it because they believed in it 110% and they were extremely passionate about that thing.
So, find your purpose and if you fully believe in yourself and in your goal then you'll have no problems with motivation, it'll become an addiction, this I can promise you.
Best of luck in your ventures.