Welcome FB,
Welcome to the biggest club nobody wanted to join. It appears you are very self aware. When pondering/reliving your past, look at it as objective as you can. This way you can see your part in the good and bad to learn from it. If you can, forgive your ex for her part as you would want her to forgive you. Also, if your depression continues go see a therapist they can help tremendously.