7812 gets hot because there's a low of power that needs to waste to bring the voltage down to 12v.
Linear regulators like 7812 take a voltage above their output voltage and output the lower voltage and the difference is dissipated as heat. In the case of 7812, the datasheet of various 7812 regulators made by various companies specify the "dropout voltage" as 2v at 1A of output current. Naturally, if you're powering only a 0.2 A fan, the dropout voltage will be a bit lower, but it's a good idea to be conservative and just assume 2v.
So let's go step by step.
Your transformer will output 14.5v AC, probably at full load, when something uses those 470mA the transformer is capable of. At low current amounts, the transformer probably outputs a bit higher voltage, something like 15-16v AC could definitely be possible.
But let's just go with 14.5v AC to keep things simple. When the AC voltage is rectifier by the bridge rectifier formed by the 4 1n4003 diodes, you get a DC voltage with a peak level of 1.414 x Vac = 1.414 x 14.5v = 20.5 volts but there's also some voltage drop on the diodes in the bridge rectifier. At any moment, the current flows through two of the four diodes in the bridge rectifier so the peak voltage drops a bit. If you look at a
generic datasheet for 1n400*, you can see on page 2 first graph that the forward voltage of such diodes is about 0.9v at 1A, so you can just substract 1.8v from the peak dc voltage of 20.5v, and you end up with 18.7v ... let's just round it up to 19v for easier math.
The maximum current the transformer could output can be approximated with the formula I peak dc = ~ 0.62 x I peak AC = 0.62 x 0.47 = 0.29A .. let's just say 0.3 A
So basically, right after the bridge rectifier, you have a DC voltage with a peak voltage of 19v and up to 0.3A
The capacitor after the bridge rectifier helps keep the minimum DC voltage above a certain threshold. The formula for this is something like this :
Capacitance (in Farads) = Current (A) / [ 2 x AC Frequency x ( V peak DC - V minimum DC) ]
so since you're in US you have 60 Hz mains frequency, and we agreed that we want the voltage to be at least 14v DC all the time, and since the transformer is estimated to output up to 0.3A we can now safely estimate the capacitor size required :
C = 0.3 A / ( 2 x 60 x (19-14) ) = 0.3 / 120 x 5 = 0.0005 Fards or 500uF.
So you see, here's the problem in your circuit. Since you used a 4700uF capacitor, the minimum DC voltage that the linear regulator sees is always much higher than needed, which means more energy has to be wasted on the regulator to produce 12v.
Let's go backwards and see what's the minimum voltage with the 4700 uF :
0.0047 Farads = 0.3 A / 120 * (19-Vmin) ==> 0.0047 * (19-Vmin) * 120 = 0.3 => (19-Vmin) = 0.3 / (120 *0.0047) ==> 19-Vmin = 0.3 / 0.564 = 0.531 ==> Vmin = 19 - 0.3 = 18.7
So basically, the linear regulator always has over 18.5v on it, and since it outputs up to 0.2A to the fan, it needs to dissipate (18.5-12) * 0.2A = 1.3 watts of power , and that's why it gets hot.
So the easiest fix would be to replace your big capacitor with something smaller. A 820uF or 1000uF capacitor would be more than enough considering the maximum current capability of about 0.3 A and the minimum voltage requirement of 14v.
---
later edit.
As for the fuse .. since you say it's a 14.5v Ac 0.47A transformer , you're in US so you have a ratio of 110 / 14.5 = ~7.58 , so the current drawn from mains will be 0.47 / 7.58 = 0.062 A , so less than 100mA.
Of course, when you plug the transformer in the mains for a very short moment, that capacitor after the bridge rectifier behaves like a short circuit and pulls a lot of current filling up, the bigger the capacitor the worse it is. So you need to account for that when you choose a fuse, and the easiest way is to just get a TIME DELAY fuse, which will tolerate higher currents for a few ms, before it blows up.
So since your current will be at most under 0.1, even accounting for shorts and everything else, a 0.2A .. 0.25A time delay fuse would probably be suitable.
--
Mains plugs .. there's loads of them on Digikey as you already saw. There's also plain ac plugs like
this one or plugs with built in fuse holder like
this one but considering this is just for powering a fan and that it's probably gonna be in a plastic or wood case, you may prefer
C8 connectors more (the mickey mouse connectors), they're tinier and there's thinner ac cables available, but the downside is they don't typically have fuse holders so you'd have to put fuse holder separately on pcb or on case.
Digikey (same store i linked to in post) has fuse holders, has fuses, has anything you may need.
--
later later edit: someone suggested there should be a on/off indicator. That's actually a great idea, since it's not mentioned but most linear regulators do need a bit of minimum load to be happy, so it wouldn't hurt to have something like 0.5 mA on the linear regulator all the time.
Easiest indicator would be to put a led on the output of the linear regulator, but you'll need to limit the current going through the led otherwise it would blow up.
Red leds have a forward voltage of about 2v so for 12v power supply and 0.5mA current, you're looking at : Vdc - Vforward = current x r => R = (12-2) / 0.005A = 2000 ohm , so probably 2200 ohm resistor would work perfectly fine. The power dissipated in the resistor will be I*I*R = 0.005*0.005*2000 = 0.05 watts, so even a tiny basic 0.125w resistor will be just fine.
Red leds are very efficient and even at 0.5mA they'll light up enough to give you nice indicator and not to blind you up.
later later later edit : the 1 uF capacitor on the output of 7812 in the picture is just ridiculous. A 0.01 or 0.1uf ceramic is recommended on the output, the 1uF is kinda pointless. If you add capacitance on the output, you may just as well add a 33-47uF or a 100uF electrolytic capacitor, it would be more useful.