Help on infinite dungeon generation

Right now, I'm trying to create a custom dungeon that generates infinitely. Previously, I used jigsaw blocks to connect the rooms, but they have a limited levels. I've seen others use armor stands and commands to connect and generate the levels, which also allows for capabilities like collision detection, but I haven't found any tutorials or code explaining how to do it. Is there any guidance I can get, or is there an easy-to-interpret datapack I could look at?
Continue to help post