Chop the onion into small pieces. Heat a bit of oil in a pan and add the onion. Once browned, add the tomato sauce, salt, basil, and crème fraîche. Stir well.
Cover the bottom of a square baking pan with four slices of bread. If necessary, cut the bread so that the slices fit perfectly.
Transfer a few spoonfuls of the sauce onto the bread and spread. Next, add four slices of ham as well as four slices of cheese. In the center of each slice of cheese, add a piece of fresh mozzarella. Repeat the entire process again, starting with four more slices of bread.
The third and last layer of bread slices form the "lid." Add another layer of sauce on top, followed by grated cheese and the rest of the mozzarella. Now bake for 390°F for 15 minutes and serve!