Combine the flour and salt on a flat work surface; shape into a mound and make a well in the center. Add the eggs and 1 tablespoon of the olive oil to the well and lightly beat with a fork. Gradually draw in the flour from the inside wall of the well in a circular motion. Continue to incorporate all the flour until it forms a ball. Wrap the ball in plastic wrap and let rest 30 minutes.
While the pasta is resting, prepare the filling. Steam the spinach and drain well, pressing the spinach to remove all excess liquid. Chop finely. Heat a large pan over medium heat. Add the olive oil and heat until hot but not smoking. Add shallots and cook for about a minute, stirring so that they do not brown. Add the shallots to the spinach, along with the ricotta, Parmesan cheese and egg. Taste and adjust seasoning with more salt, pepper as needed.
Cut the ball of dough in 1/2, cover and reserve the piece you are not immediately using to prevent it from drying out. Dust the counter and dough with a little flour. Press the dough into a rectangle and roll it through a pasta machine, 2 or 3 times, at widest setting. Pull and stretch the sheet of dough with the palm of your hand as it emerges from the rollers. Reduce the setting and crank the dough through again, 2 or 3 times. Continue tightening until the machine is at the second narrowest setting; the dough should be almost paper-thin.
Dust the counter and sheet of dough with flour, lay out the long sheet of pasta, and brush the top surface with a little water, which acts as a glue. Drop 1 tablespoon of the filling on 1/2 of the pasta sheet, about 2-inches apart. Fold the other 1/2 over the filling like a blanket. With your fingers, gently press out air pockets around each mound of filling. Use a sharp knife to cut each pillow into squares and crimp the 4 edges with the tins of a fork to make a tight seal. A fluted pastry wheel also works well to make an attractive edge around the pasta. Dust the ravioli and a sheet pan with cornmeal to prevent the pasta from sticking and lay them out to dry slightly while assembling the rest. If not using within an hour or two refrigerate until needed.
To prepare the sauce, heat the two tablespoons of oil in a heavy pot and cook the garlic for just a minute. Add the tomatoes, salt, pepper, and pepper flakes and cook over medium low heat for 10 minutes. Add the chopped basil, and mix well. Cook over low heat an additional 10 minutes. Keep warm while you cook the pasta.
Cook the ravioli in plenty of boiling salted water until tender. They will float to the top when ready, so be careful not to overcrowd the pot. Drain the ravioli and return to the pot. Pour half of the sauce mixture into the pot and carefully stir until the ravioli is lightly coated. Serve the ravioli with a spoonful of additional sauce and a sprinkling of grated cheese. Serve hot.