Begin with the roux. In a large, heavy-bottomed Dutch oven or pot, heat the oil over medium heat. Add the flour and stir constantly with a wooden spoon. This is crucial—if you stop stirring, the roux will burn and you'll need to start over. Continue stirring for 20-30 minutes until the roux reaches a deep, chocolate-brown color. It will smell nutty and rich when it's ready.
Add the holy trinity. Once your roux reaches the right color, immediately add the diced onions, bell peppers, and celery. Stir to coat in the roux and cook for about 5-7 minutes until the vegetables begin to soften.
Add the garlic and sausage. Stir in the minced garlic and sliced andouille sausage. Cook for another 5 minutes until the sausage begins to render its fat and the garlic is fragrant.
Season the mixture. Add the Cajun seasoning, bay leaves, thyme, and cayenne pepper. Stir to combine and let the spices toast lightly for about 30 seconds.
Add the liquid gradually. Slowly pour in the stock, stirring constantly to incorporate the roux without lumps forming. Add the diced tomatoes if using.
Bring to a simmer. Increase the heat to medium-high until the mixture comes to a boil, then reduce to low and simmer, uncovered, for 45 minutes, stirring occasionally.
Add the okra. Stir in the sliced okra and continue to simmer for another 30 minutes. The okra helps thicken the gumbo and adds authentic flavor.
Final additions. About 5-7 minutes before serving, add the peeled and deveined shrimp. They cook quickly and will become tough if overcooked. Simmer just until they turn pink and opaque.
Finish the gumbo. Remove the pot from heat and discard the bay leaves. Stir in the chopped parsley and green onions. Taste and adjust seasoning with salt and black pepper as needed.
Serve the gumbo in deep bowls over a scoop of cooked white rice. Offer file powder at the table for sprinkling on top, along with hot sauce for those who want extra heat.