This template uses a javascript port of wave function collapse, integrated in Construct 3.
You can generate both random dungeons and mazes with it.
You can get the full template at the scirra store : https://www.construct.net/en/game-assets/game-templates/dungeon-generation-96
It is fully documented and explained, and free to use for any purpose.
The javascript port : kchapelier.com/wfc-example/overlapping-model.html
Contact me on Fiverr if you want further assistance :
https://www.fiverr.com/bartalluyn/assist-you-in-creating-your-construct-3-project