Hey :).
My DP almost left me once, too. It was 3 years ago. We'd not long been together, but even so I thought it was going quite well.
This woman he'd been hanging round with (he wanted more, she played him badly) suddenly got jealous that he was with someone else and decided she DID want him. This threw him because she was all he had wanted for a very long time before we met. To be fair he was honest about it and we talked it through. We ended up staying together as he knew, realistically, that it wouldn't last with this other woman, and she would end up messing him around again.
But that shook me.
I thought we had a really solid relationship and even though I understand why he would have been thrown by it, because he'd known (and wanted) her for years and we had only been together a couple of months, the way we'd clicked honestly made me think we were made for each other.
He got back to normal quite quickly and blocked this woman on everything, but it took a lot longer for me. I got nervous every time he was on his phone or out a little bit later than I was expecting. I worried when he chatted to other women, thinking the same thing might happen.
I have an anxiety disorder, and started taking meds for it this year. Being honest, that's the only thing that's actually, truly, helped me to put it behind me. I now see the incident clearly for what it was - she messed with his head - and our relationship is better than ever.
But I just wanted to let you know that you're not alone, and it's understandable that this has shaken you a lot.