The Diode D1 is in parallel with the relay REL1. The Transistor is in series with them.
Starting at the top of the schematic you can see that the +5v from the raspberry Pi (your red wire) is fed to the relay and the cathode of the diode (your orange and yellow wires).
The other side of the relay is connected to the collector of the transistor (second red wire).
When you set the GPIO high on the Raspberry Pi, a small current flows into the base of the transistor (via resistor) to switch it on. This completes the circuit by connecting the relay to the 0v ground.
Now when you set the GPIO to low on the raspberry Pi the current stops flowing to the transistor and the relay switches off.
When it switches off, for a brief moment a back EMF is generated. This means that current is flowing the opposite way, this would be trying to push backwards through the transistor potentially damaging it. But because the diode offers a lower resistance path for the current to flow it is dumped into the diode.
Electric current always takes the path of least resistance.
based on the schematics I see why is the transistor in series, but the diode confuses me - how is it in parallel? why?
also looking at my breadboard to me it looks like both are in parallel - how should I connect the wires to make both, transistor and diode in parallel after the relay? (just so I understand series/parallel configuration better, as it still kinda confuses me)
----------------------------------------------------
so when the transistor is not powered, the current goes all the time to to the diode, where it gets lost as a heat - now there's a question -
1, is the current going straight to the cathode, OR is it going THROUGH the relay and to the anode of the diode?
1a, if it is going straight to the cathode, why is not the current going to the relay as well (as they are in parallel), and then to the anode, thus powering the relay?
1b, if it is going thru relay to the anode, why isn't it powering the relay?
----------------------------------------------------
this would be trying to push backwards through the transistor
how? you said the coil will release magnetic energy, converting it to the electrical energy and pushing it in the opposite direction - therefore it should go from coil to the orange wire - what happens next is not known to me
I appreciate your effort, but as I mentioned above - most of the tutorials (and your lessons) are NOT easy to understand by someone who has basically no knowledge about electronics (I'm not even sure I know how diode works...) - I'd need you to tell me exactly how is the current flowing like I'm 10y old and using few words to explain what and why is going on in the electronic component, e.g.
"when you power the 5V source, the current goes thru yellow wire to orange wire (and diode???), to the coil, then it goes to transistor, but it doesn't go to diode, BECAUSE ..." et cetera