Heat 30 ml olive oil in a large, heavy-based saucepan over a medium heat. Add the finely chopped onion and cook, stirring occasionally, until softened and translucent, about 5–7 minutes.
Stir in the minced garlic and chilli flakes (if using) and cook for another minute until fragrant, taking care not to let the garlic burn.
Add the chopped tomatoes, dried oregano, 1 tsp salt and ½ tsp black pepper. Bring to a gentle simmer, then reduce the heat to low, cover with a lid and cook for 20–30 minutes, stirring occasionally.
Meanwhile, bring a large pan of generously salted water to the boil. Add the spaghetti and cook for 8–10 minutes, or until al dente. Reserve about 250 ml of the cooking water, then drain the pasta.
Stir the drained spaghetti and chopped basil into the sauce. Toss well, adding a splash or two of the reserved cooking water if the sauce is too thick.
Divide between plates and serve immediately, sprinkled with grated Parmesan cheese and extra basil leaves, if you like.