Soak shallots in water for 10 to 15 mins so that they can be easily peeled off.
Chop the bigger shallots and keep the smaller ones as it is.
Heat 1 tbsp oil in a pan,add 3 broken dry red chillies,black peppercorns,cumin seeds and coriander seeds.
Dry roast for some time till the dry chillies change the colour.
Add grated coconut and roast on low flame till it turns light brown.
Switch off the flame and keep aside,let it cool down.
Ground this by adding 1/2 cup of water into fine paste.
In the same pan,add 3 tbsp oil, add shallots and saute till the onions become soft.
Add salt and turmeric powder and mix well.
Soak tamarind in a cup of water and pour the pulp into the pan.
Add the ground paste with 1 cup of water and cook for 10 mins. Keep stirring in between.
Cook till the gravy thickens and switch off the flame.
For tempering,heat a kadai, add 1 tbsp of oil,add mustard seeds and curry leaves. Let it splutter.
Add dry red chilli and finely chopped shallots and saute on medium to high flame till it turns brown.
Add this to the theeyal and mix.
Keep it covered for 10 mins before serving.