Boil spaghetti in salted water until al dente. Drain and set aside.
In a bowl, whisk eggs, then mix in Parmesan cheese and ricotta.
Toss the cooked spaghetti in this mixture until well coated.
Heat olive oil in a skillet over medium heat.
Sauté onion and garlic until soft.
Add ground beef/sausage, breaking it apart, and cook until browned.
Stir in marinara sauce, Italian seasoning, salt, and pepper. Simmer for 5 minutes.
Press the cheesy spaghetti mixture into a greased pie dish to form a crust.
Spread meat sauce evenly over the spaghetti.
Top with shredded mozzarella.
Preheat oven to 350°F (175°C).
Bake for 30-35 minutes until cheese is bubbly and golden.
Let cool for 5-10 minutes before slicing.