With a dead battery your power locks won't work, and it appears that the linkage in your door lock is disconnected thus the key turning loosely.
Luckily there's an emergency release cable so you can get into the Frunk and charge your battery.
It's original position is behind the right (passenger) side headlight. You'd have to jack up the car, remove the wheel and peel back the fender liner.
What you're looking for is a stainless steel cable, much like a bicycle brake cable.
If you can't find it there, look for it behind the tow hook cover or somewhere behind the front bumper cover. Some people re-position the cable to a place that's easier to access.
Here's a helpful thread on the subject:
Mystery frunk release in headlight well
Good luck!