I don't remember if it was this exact guide, but I'm pretty sure I was following Matt3o's guide when I did it: https://matt3o.com/hand-wiring-a-custom-keyboard/
edit: it may have actually been this one: https://deskthority.net/viewtopic.php?f=7&t=6050&start=