1
This WiFi Module will receive signals from Alexa and turn them into signals to turn on and off a relay. The relay is used turn things on and off.
2
The transistor is used as a curernt amplifier in this circuit to help the nodeMCU low current turn on and off the relay.
3
The relay is switched on and off from the NodeMCU. The Normally Open contacts are used to turn on and off different objects like lights, TVs and other electronics that use switches.
4
The diode is used a suppression or flyback diode. These are needed when switching on and off inductive loads like motors or a relay in this case. Otherwise can cause damage to NodeMCU or transistor.