When we have heavy driving rains it causes the front door to expand and we're unable to close or lock the door until it has dried out and contracted. There is no veranda so the rain hits straight onto the front door.
How can I prevent this?
I am going to guess that you have a wood door causing the problem. If you have checked the original installation and frame alignment and feel that cannot be changed, then the only real solution is to plane it down so it closes properly when damp or humid. You can install extra or new weatherstripping to assure it has a good airtight seal,especially in dryer times when it may shrink a bit.
I would install an awning or porch roof extension out 3 feet from the building wall line to protect the door.
They even make fabric type awnings that can roll up against the wall during nice weather times.
You might consider replacing the wooden door with a fiberglass one. Metal would avoid the swelling issue, but likely suffer from rust/oxidation due to the wet environment.