Start by preparing the vegetables - trim the ends off the beans then cut them into lengths of roughly 2in/5cm (unless beans are large, this is generally roughly in half). Trim the ends off the stalks from the spinach and roughly chop the spinach leaves.
Make the chili-shallot paste by roughly chopping the chilis, shallot, garlic and galangal and adding all to a mini food processor or blender and blending into a paste.
Remove the central rib from the lime leaves then finely slice the leaves.
Blanch the vegetables one vegetable at a time. Bring a pot of water to a boil and have a bowl filled with iced water nearby. Add the beans to the pot of water, cook for around 2 minutes then remove the beans and transfer to the bowl of iced water. Add the beansprouts to the pot, cook for 30 seconds then remove to the bowl of iced water. Add the spinach to the pot, cook 1 minute then remove the pot from the heat, drain and run the spinach under cold water.
Drain all of the vegetables and set aside.
Warm the coconut oil in a small skillet over a medium heat then add the chili-shallot paste. Cook for a couple minutes, stirring regularly, to become aromatic. Add the grated coconut, sliced lime leaves, palm or other sugar, tamarind, salt and water. Stir to mix everything well and cook for a couple minutes to soften and dry out slightly.
Serve the vegetables, mixed together, with the coconut mixture over the top.