You absolutely should not stay where you are. You are also extremely unlikely to be able to make any positive changes there, the company product and needs “are what they are.”
Find what males you happy, Don't just up and quit. Put your feelers out and see what you can find. Maybe schedule a 1on1 with you boss and express this (once you might have found a new position). Idk what your boss is like, but it doesn't hurt to be honest bro. Suffering through a job you hate is a torture unlike any. Best of luck man.
There's nothing quite like hitting the gym and lifting weights (or whatever you like), to get things pumping and getting dopamine hits.
Personally I find it a great way to not think about work and may help. IANAT
Start looking today — before you quit.
But first you have to chage the mindset. My realization is that, I need to be responsible to myself first. My family is second in order. My close friends is third, and then it goes on. The fucking job is at least out of Ring 5.
Once you realize that, you would agree that you simply should not let Ring 0 suffer for the sake of some Ring 6 or 7. And then you will start do paragraph 1. The best strategy is to find a new gig ASAP, but push it to 4-6 weeks before starting, then figure out a way to let the current company lay you off and pay some $$. Your manager and company obviously don't give you a fuck so let them pay you.
Honestly, I'd doubt that working with legacy code simply causes you to feel depressed.
You might have an actual depression and changing jobs might just make things worse.
Go see some therapist, at least do some online screening for symptoms of depression.
I've had a very good time at my first job where my only task was to maintain a horrible legacy Java codebase because I wasn't depressed.
I've had some tough months in my current job at a startup, working with modern NodeJS, Python + ML, Docker stack because I was depressed.
You are also experiencing something called "learned helplessness". Learned helplessness and depression are inevitable responses to long term stress. Inevitable means every human will experience it. You are stuck in a shitty job you hate and can't get out of and have no control over. The lack of control piece is fundamental to that stress. This is the rat in the shock box experiment. The rat becomes depressed because it can't control or stop the shocks.
You know you are depressed like the rat in the box... so take this very seriously and seek out a therapist and even ask your doctor about medication. The therapist will teach you skills to understand yourself and strategies to cope or change.. and the medications will probably help. Start with the professionals: a therapist and a medical doctor. Eventually you learn that the box is a lie and you can step out of it at anytime and go off free from the trap.
I've hated my job for the past 6 or 7 years. It's not going to be much better anywhere else. Even bouncing from team to team internally doesn't really make it better since they all have problems.
But you don't feel the same, despite being in the that situation. So it naturally follows that your depression is either a frame of mind, or something intrinsic to you, i.e not job dependent. Switching jobs can possibly cause you to not be depressed, but this is a bet that you actually don't have a problem vs sweeping the problem under a rug with a chance of occurring later, which is not a safe bet to take. As such, you should first and foremost seek therapy and psychological evaluation to figure out why you feel that way. It could be stress related, or it could be something else.
For me, what I though was depression was actually a combination of ADHD and being on the spectrum and stress as a result of that.
Also, to add to the above, you would not want incompetent people maintaining legacy applications. Those typically exist because they are stable, because they work, and their owner expects that to continue.
All of this leads me to think that maybe you are actually more valued than you believe.
With that in mind, may I ask what exactly is it that you find frustrating about the job?
You are probably feeling so mant emotions, I'll dare one guess: feeling disrespected since you wrote how they are pushing this undesirable project on you.
It's not easy to look for a job when emotionally charged, so I would set aside a space with silence and focus on the feelings. Repeat for a few days. Processing the emotions will help.
The fanciful suggestions about rewriting legacy apps in some fashionable new tool are fantasies. It never works other than for trivial apps
Talk to your bosses.
Explain the situation (as above is perfect - keep it short and sweet)
Suggest that if you leave they won't find a better replacement because the problem is structural. And that if you stay you'll probably burn out soon and that won't help anyone.
Ergo: the project is doomed every which way.
Except for one hope:
Ask permission to rebuild it from the ground up using modern tools and software engineering. Ask for one or two additional helpers to build a small team to do:
Full system analysis of what it's supposed to be doing
Requirements finding to identify what needs removing or updating
Building a POC replacement alongside the legacy
Implement using all the fun things, including AI assisted code translation
From this system's POV you're probably the last hope. If they say no then;
You tried
You can quit with a clean conscience and escaped a slow miserable death
How do I put this? Your feelings are a result of your frustration. Frustration can lead you to either anger or sadness. In your case, it is sadness. Anger gets work done. Sadness gets you go to connect more with those around you. And that includes looking for help like you are doing.
Frustration, frustration, frustration ... from having certain *expectations*, and yet finding a world completely different from those expectations. We can call it culture shock for lack of a better term because it has the same symptoms.
Let's rewind the clock. Turn back your expectations. Turn down your expectations. And reassess. You are not working on the greatest tech in the world. You are not that great to begin with. A great person can go through mud and come out to the other side because a great person is humble and less frustrated and does not have a problem with the disgust and difficulty of mud.
You are working on old tech. You are having to solve a problem no one can solve normally. You have to work a really long time to get this problem solved. It is not hard. It just takes a long time. And makes you feel like you don't know much. It is just really hard work and you wished you already knew how to do it.
Plus, you have so many great ideas and no opportunities to implement them. And this piece of garbage tech is completely different from your ideas. And that is more frustrating. You can't even fix it. But when was fixing the tech into your great idea even a choice... or a thought? Why did you even think that you could do this? Because you saw some stupid hacker friend who generated a great idea and great attention? And you are never going to get attention so now you hate your job? GROW up. You are not living a fable. You are living a reality that never gets lauded or talked about. Shun the ideas. Discipline yourself. There is a task that needs to get done. And it does not need greatness. It just needs discipline. Give that discipline some time. Soon it will morph to creativity in the boundaries you will soon learn exist. Then ... you can have your ideas.
(This is a note to me. Sorry if I came across too hard on you.)
But in bigger picture you shouldn’t expect the job to entertain you. It is an infantile position.
Employees are paid to bring something meaningful to the table, not to have fun. Generally speaking.