I lived in a family apartment growing up, and we'd lock the door to the entire building at night when everyone was home with a sliding lock so that it could only be opened from the inside. However, that'd mean you need to ensure at least one person from every apartment was home, otherwise you'd need to go downstairs and let the others in in the middle of the night.
All the 3 apartments in the building were sharing the same wi-fi device, therefore I built a simple scanner to find all the devices in the network, connect them to the individuals I knew, and show the devices I found on the network in a simple website, which then I installed on my parents' devices as a PWA. The scanner would run in a Raspberry Pi I had lying around.
In the end it wasn't very reliable, the router kept failing occasionally due to nmap, and after a few failures we stopped using it, but it was a fun experiment for me.