i'm starting get into designing some IOT devices for around the house and looking other peoples design on Hackster.io. I've come across several designs that i'm having a hard time understanding. The below picture to me doesn't make sense. My understanding is the the electric flow starts with positive and flows to the negative. On the below picture for example we see GPIO pin 5 (blue wire) connects to resister then flows to the transistor then to the blue wire though the negative side of the led.
I don't know understand how this works since we would need current to flow through the resister then LED. When the developers code execute whatever on GPIO5, isn't this flowing the wrong way? I will go out and say i'm starting at the bottom with basic understand if that.