Heat a large skillet over medium heat. Drizzle a little olive oil in the pan, add the shrimp and season with salt. Stir and cook the shrimp until almost done. Remove the shrimp from the pan and place in a bowl to use later.
In the same pan add another drizzle of olive oil along with the shallots or onions, garlic, and ginger. Cook for a minute or two. Add the curry powder and red pepper flakes if you are using them. Salt lightly and stir for a minute.
Next, stir in the coconut milk and slowly start adding the chicken or vegetable broth. If the sauce seems like it will be too thin, add the cornstarch to some of the broth and add to the mixture. Cook and stir for a few minutes until thickened.
Add juice from ½ - 1 lime, along with the sugar. Stir, and taste. Adjust sugar and salt if needed. Add the shrimp and the fresh basil or cilantro. The shrimp should be thoroughly cooked in a minute or two.