I have spax screws and would be screwing the studs into each other.
It all depends on how you plan to attach things together....nails? screws? glue? and like a bridge, it is difficult to know how stable something would be just looking at the top.
Personally, I would build a proper "cabinet box" and then slide that bad boy in there. What you are proposing, assuming you are going to properly fasten the studs to other studs within the wall, should work fine. I am a fan of, and exclusively use for woodworking, spax screws. My only concern would be the 31" span in the back of relying strictly on a "piano hinge." I would think about ways to give that guy some support - whether it be another stud in the back with an overlap, some type of cleat, boards underneath to add some stiffness or some combination.