Prepare a wide saucepan or frying pan. Wash vegetables and herbs, peel onions and garlic. Remove the skin from the tomato, to do this, make a couple of cuts in the place of the stalk and dip the tomato first in boiling water for 1-1.5 minutes, and then in cold water. This will allow the tomato skin to come off easily.
Pour water into a wide, large saucepan, salt it, bring the water to a boil and put the spaghetti in it, cook the pasta for 8-10 minutes. Adjust your steps and cooking time according to the package instructions.
Cut the eggplants into strips, add salt to them in a separate bowl and leave for 20-30 minutes.
Cut the tomatoes without skin into cubes. Cut the onion into small cubes or quarter rings. Finely chop the garlic or pass the cloves through a garlic press.
Heat the oil in a frying pan, set the heat to medium, add the onion, add salt and fry it until golden brown. Add tomatoes, salt, sugar to taste, stir and add the whole hot pepper (no need to chop the pepper). Bring to a boil, reduce heat and simmer for 10 minutes, stirring gently.
Chop the basil greens. Separate one third of the greens, combine with the sauce in a frying pan and simmer for another 5-7 minutes. Adjust the sauce to the final desired taste with salt and sugar. Remove the hot pepper from the sauce; it is no longer needed.
Combine eggplants with tomato sauce, stir and heat the resulting mixture for 2-3 minutes. Add garlic and remaining basil. Stir. Combine cooked spaghetti with tomato sauce and serve the dish.
Place the spaghetti on a serving plate, folding the pasta nicely into a nest shape. A fork will help with this. Sprinkle with grated cheese and add a couple of fresh basil leaves.