I'm confused - what is the actual problem?
I started working in a startup as the one developer - this happens. Welcome to the startup world.
in addition to the CTO(low level Java developer) who is not always available and also not an expert in the stack(MEAN) used to build the product. this also happens. Everyone must eventually fall into a roll do what they need to do for a project to get off the ground.
The product was previously outsourced before I joined and the code is nothing to write home about. Ok ? Lots of code out there is bad.
If you think you can do better, do so. If you think the project is doomed, leave. But again, there isn't an actual question here. Complaining that the boss is never around or that the code sucks aren't valid gripes or problems. That's programming for a startup (with 2 people no less).
At best - tell the CTO what problems your having with the code; tell them what you would change, how, and how long it might take.
At worst - leave and find a new job. It's a job. At a startup. You owe them nothing (I presume) and in reality, they owe you nothing. You have a life to live; you have expenses; maybe you have a wife and kids you need to support. You need to take care of yourself (and family) first.
Sorry for the down vote, but those are just some of the pains of working for a startup. Wait, it'll get worse before it gets better.