I've made a few sets for both the lake house and the kids' room.
Lake house set
I used 2x4s (headboard/footboard), 2x6s (bed rails) and 4x4s (legs). The slats are 1x3 furring strips connected via duct strapping and staples and the top rails are 2x2s.
The head and footboard are pocket screwed and glued as a large panel the full height.
For the lower bed rails, Rockler sells these brackets (
https://www.rockler.com/surface-mount-bed-rail-brackets) that work great.
For the upper bed rail and guard rail, I used threaded inserts and 3/8" bolts to tie the whole thing together. I used a forstner bit to recess the bolt heads and washers.
Since I was traveling with these I broke them down into the head and footboard, lower bed rails, upper bed rails + guard rail and top and bottom slats. Worked great. Also made them twin xl so that adults can sleep comfortably on them as well. The footboard doubles as a ladder, and so far my kids (3 at the time, and 6) don't have any issue going up and down.
I'll have to get some pics of the set I made for my kids' room, since it uses some of the same elements, however I tied 2 sides for both top and bottom bunks into the wall (bolted directly to the wall) and only have one 4x4 leg supporting the top. The bottom I put on hinges at the wall and can lift it up if the wife ever needs to get under there and vacuum. I also built a dedicated ladder on the end to make it easier for my son to go up and down since this was an every day bed. These are also twin xl due to a screw up on Amazon's part in sending a duplicate order of memory foam mattresses that they said we could just keep. Thanks Amazon!
The one downside to tieing the bed directly into the wall is that anytime they bump the bed or go up and down the ladder you can hear the soft thud in the wall.