1) when i turn on the supply of the board relay connected to D3 turns on for a fraction of second and then turns off, how to remove this problem??2) If all my devices are in ON state and if i turn off the power to the main board, after turning it ON again it gets reset means all the devices are in OFF state now how to remove this problem ??
Provided this doesn't happen too often you can save the relay state in the MCU EEPROM and then at power on read the saved state and activate the relays accordingly.
NodeMCU doesn't have any EEPROM as far as I know, unfortunately.
I can code it for you :-) If you want: email@example.com