Heat your oven to 400F (200C)
Place the chopped sweet potato into a baking dish, add olive oil and salt and mix thoroughly using your hands.
Roast the sweet potato in the oven for 30 minutes turning halfway.
Prepare the tofu by removing as much moisture as possible from it with kitchen paper and cutting it into 1 inch pieces.
Cook the tofu. Place a pan on a medium to high heat and add the groundnut / vegetable oil, add the tofu pieces when the oil is hot and fry them for a few minutes, turning halfway until they are golden and crispy on both sides. Remove them from the pan and set them aside when they are done.
Reduce the heat to medium and add the garlic and ginger and cook for 2 mins until fragrant. Add a little more oil if needed.
Add the red curry paste and fry for two more minutes.
Pour on the coconut milk and bring to simmer. Stir until incorporated.
Put the rice on. If you are cooking your rice on the stovetop, add it to a pan of generously salted water now. Jasmine rice will normally take about 10 minutes to cook.
Add the fish sauce, sugar, kaffir lime leaves and red peppers to the curry and simmer for 5 minutes.
Add the pineapple, sweet potato and tofu and simmer for 5 more minutes.
Take the pan off the heat, stir in the lime juice and serve with rice and fresh cilantro.