One idea is to have more influence on the business decisions, take a more active role in the project. So push back on the crappy parts and bring new ideas to the table. Try to make it your own, be proactive instead of reactive. That might give more weight to the work you do and having more stake is also more thrilling. You could be the next team lead, architect or cto, who knows. And if it doesn't work out, at least you gain some valuable lessons.