I'm working on my first circuit, controlling closet fans with an ESP32. I did some research drew the following circuit. I control the flow to GND from a 5V USB power supply with the GPIO pin thorugh the transistor. The fans would want 12V, but work with 5V just as well. I use the step-up-module to increase the airflow.
The 1k Ohm resistor should protect the base of the transistor (BC547B) and the diode is used as a " flyback diode", to protect the transistor as well. I've gathered that from this question. For this I bought a mix of common diodes (IN4001 4004 4007 5404 5406 5408 RL207 FR107 207 UF4007 IN5817 5819 5822 4148).
The question is, if the transistor is used safely in this circuit and what diode is best used here?
EDIT: I've updated the above shown circuit with feedback from the community:
EDIT 2: A second update of the circuit.