This is the best video I’m aware of. Keep in mind, this is with a Sonoff basic, but the terminal connections to mini are the same. There are others, like Dr Zzs, that are great videos, but he uses Home Assistant and flashes with Tasmota.
Now, the terminal connections on the Mini are so close together. I have ruined one by soldering it too many times. Nor do the connecting pads go all the way through the board, so when soldering, the connections will very hard to stay attached- THIS IS A PAIN- but it will work.
I have flashed it correctly and it works with the app, but I cannot get the toggle function (connecting to normal light switch) to work.
Good luck.