In a large frying pan, heat the oil over moderately high heat. Add the onions and cook, stirring frequently, until golden, about 5 minutes.
Add the garlic and ginger and cook, stirring for 2 minutes.
Add the coriander, cumin, cinnamon, cayenne, and turmeric and cook, stirring, for 30 seconds.
Add tomatoes, and cook, stirring for 1 minute.
Add the coconut milk, water and salt and bring to a simmer. Reduce heat and cook at a low boil, stirring frequently, until thickened, 5 to 10 minutes.
Add uncooked shrimp and spinach to the pan. Reduce heat to low and bring to a simmer. Cook, stirring occasionally, until the shrimp are just done, 3 to 5 minutes.
Remove from the heat and stir in the basil or fresh cilantro. Serve immediately over brown rice.