This will sound cantankerous, and I should preface this by saying I
hate decks both aesthetically and for this sort of reason.
But anyway, if it's that big a mess you'll need to dig in and see if
you have termites, carpenter ants, mold, or more extensive damage.
(I am off now to spread more cheer !)
Your situation is - unfortunately - common.
pan flashing below the door threshold.
flashing over the ledger.
It sounds like this doesn't exist.
Rain splashes up from the deck and blows along the deck, putting a lot
of water at the line where the deck meets the main building. It takes
special care that's seldom given to manage the water.
I don't know of any books or web sites that address the problem.
Your best bet is a well respected contractor or an architect.