Wash the beans thoroughly. String them by pulling the fiber off the sides, then chop them diagonally into thin slices.
In a small blender or using a mortar and pestle, coarsely grind the coconut, green chilies, shallots, garlic, cumin seeds, coriander leaves, and turmeric powder. Keep it aside.
Heat oil in a heavy-bottomed pan (a kadai or uruli). Once hot, add the mustard seeds, urad dal, red chilli, and curry leaves.
Once the seeds start popping and the urad dal turns light golden, add the finely chopped flat beans and salt. Give it a good stir on medium heat for 2-3 minutes.
Add 4 tablespoons of water. Cover and cook beans over low heat till they are almost done.
Add the coconut mixture to the poriyal. Stir it all together. Sauté for another 2 minutes on medium-high heat until the coconut coats the beans beautifully.
Avarakkai Poriyal is ready to serve.