Circuit is done as shown in the diagram. Download trafficLight library from the following link. Unzip and paste the downloaded library to Arduino libraries folder. Restart Arduino IDE and open the example program from File -> Examples -> trafficLight -> trafficLight. Upload the program to your NodeMCU. Program compiled and tested on Arduino-1.8.12. After successful uploading, connect your mobile device to NodeMCU over WiFi.
Package includes :
Get the circuit and program from https://haberocean.com/2020/08/traffic-light-controlled-through-nodemcu-from-mobile-device-over-wifi/
Open a web browser in your mobile device and redirect to 192.168.4.1. Color indicators can be seen on the screen. Press on your desired color. Respective LED will light up on the traffic light. White color button will clear all the LEDs.
Download programs from the following link.