ok so i'm just going to point out the mistakes. there were many things that were done right but i don't think i have to mentrion them too

first of all if you're going to fd you'd better take off your scvs from gas after you get 100 and start building your fax. or just leave 1 mining as most people do. you need as many scvs as possible gathering minerals to have those 400 available for your new cc
2nd mistake was you forgot to get depots after the harass. you nicely continued building factories just as you should, but then you didn't have depots up and that halted you quite a bit to allow to him to get a significant population advantage. since his harass was quite unsuccessful and it was still 2 base vs 2 base that should give you a nice advantage in the long run if you macroed well.
so later on you see he's taking his min only. I think with a good attack there you could have won the game. you had enough to give him enough pressure to either lose his min only or have a nice contain setup outside his natural. remember that generally toss needs +1 expansion from what the terran has to be able to keep up with macro. you were even for so long so you could have realised you had enough to begin being aggressive. also keep in mind that protoss should always be at about +10 or +20 in population ahead terran so whenever you see at replays that you are even with him or have more then you could win the battle if there was one.
then you set up yourself for a great flank which lost you most of your army. there you should either have attacked with all (quite many tanks were left behind) or not have attacked at all. also you could scan a bit and see where his army is and prepare better to fight against it and not just siege up in the middle and wait to be attacked from both sides. also yor macro there got really sloppy you had an awful amount of resources while he kept his money pretty low
lastly 19 minutes in the game you didn't have a single upgrade and it's really bad cause upgrades are really important in tvp and can really give you a significant edge over your opponent.
the last battle was quite bad. you weren't positioned very well and he also had so many more gateways than you had factories to rebuild his army. also notice that you have an awfully huge amount of scvs in all 3 bases which overall gives you less room in that 200 supply to be occupied by real fighting units

he has a much better ratio of peons/fighting units which gives him a much bigger army to go in this last deciding battle. i know non stop scvs is what you've been taught to do (many people give this advice but it's really crap after you level up your game from noob to a cometitive player) but really you have to stop at some point in mid game after your min only and focus on spending all your money on buildings and producing units. you should have like half the scvs of what you had in the end.
that's all I can advice about. hope it helped