Is there any way to upgrade ionic 3 project to Ionic 5 project directly?

No. If memory serves, there is a guide on the Ionic website (maybe in the blogs), that outlines a good strategy for the migration. It usually is not too painful. Styling will probably be the largest area of effort that you will undertake.