Bring a large pot of water to a boil. Coat a medium baking dish with olive oil.
While water boils, prepare the sauce. In a large skillet, heat olive oil until hot. Add in shallots and garlic. Season with salt and pepper. Cook until shallots are soft and translucent.
Stir in tomato paste, and cook until caramelized, about 5 minutes.
Deglaze with white wine. Add in canned tomatoes and break up slightly with a wooden spoon. Season with salt and pepper. Simmer for 20 minutes.
Heavily season boiling water with salt. Drop in pasta and cook until al dente.
While pasta cooks, mix ricotta and pesto together in a small bowl. Set aside.
Drain pasta and add into the sauce. Add a few splashes of pasta water and the parmesan cheese. Stir to coat. Season with salt and pepper if needed. Transfer to the prepared baking dish.
Top pasta with dollops of the ricotta mixture, sliced mozzarella, and more grated parmesan. Drizzle with olive oil.