Boil water with salt and cook the spaghetti all dente.
Sweat the onion and garlic in olive oil.
Add the tomatoes and pour in a little bit of pasta water (3-4 tablespoons). Simmer for 4 minutes and add more noodle water, depending on the desired consistency.
Season with pepper and salt.
Add basil leaves. Drain the pasta and add it to the pan.
Mix everything together and serve on a plate. Garnish with fresh basil leaves and grated cheese.