Powering up an ESP32 with IO extender (MCP23017) and two of 8 channel relays from an external 5 V, 10 A power supply
The ESP32 runs of 3.3V (I found a schematic which I hope is the correct one). 

I do not have schematics of the other parts but I notice that everything runs of 5V. 
I suggest you check:


If the I/O of all connected ports are 3V3. 
or 
If the ESP32 has 5V tolerant ports.


If not you are connecting 5V I/O ports to a 3V3 processor. That might explain why it gets hot.

A more dangerous way is to connect things one-by-one and check which one makes it get hot. (I would normally not recommended that but it is a quick-and-dirty way to narrow done where the problem is)