Heat the coconut oil in a large pot over medium heat. Add the chopped onions and a pinch of salt, and cook until they're translucent, about 5 minutes.
Add the minced garlic and grated ginger, and sauté for another minute until fragrant. Then add the spices—curry powder, cumin, coriander, turmeric, and red pepper flakes—and give them a quick toast in the pan.
Stir in the sweet potatoes and chickpeas, ensuring they're well-coated with the spices. Pour in the vegetable broth and bring the mixture to a boil. Once boiling, reduce the heat to a simmer and cover the pot.
After about 15 minutes, when the sweet potatoes are just tender, pour in the coconut milk and continue to simmer.
Once the curry has thickened slightly, usually after 10 minutes, stir in the fresh spinach leaves and allow them to wilt in the hot curry, which should take about 2 minutes.
Finish the curry with a generous squeeze of lime juice, and season with salt and pepper to taste. Serve the sweet potato and chickpea coconut curry hot, garnished with chopped cilantro.