If it were me I'd be tempted to customise something (these for instance are easy to chop to size and pretty cheap https://www.strictlybedsandbunks.co.uk/product-category/bed-frames/ or one of the cabin beds) rather than try and build it all new. Mattress sizes will be your restriction.
For sockets I'd just use an extenstion rather than trying to do anything fancy.
If it were me I'd be tempted to customise something (these for instance are easy to chop to size and pretty cheap https://www.strictlybedsandbunks.co.uk/product-category/bed-frames/ or one of the cabin beds) rather than try and build it all new. Mattress sizes will be your restriction.
For sockets I'd just use an extenstion rather than trying to do anything fancy.