Preheat oven to 375°F (190°C).
Slice zucchini or eggplant thinly lengthwise. Sprinkle lightly with salt and let sit 10–15 minutes, then pat dry thoroughly.
Heat olive oil in a skillet over medium heat.
Add ground meat and cook until browned, breaking it up as it cooks.
Stir in onion and cook 3–4 minutes until softened.
Add garlic and cook 30 seconds until fragrant.
Stir in marinara sauce, Italian seasoning, salt, pepper, and red pepper flakes. Simmer 5–10 minutes.
In a bowl, mix ricotta cheese, egg, and half of the Parmesan.
Spread a thin layer of meat sauce in a greased 9x13-inch baking dish.
Add a layer of zucchini or eggplant slices.
Spread ricotta mixture over vegetables.
Sprinkle with mozzarella cheese.
Repeat layers until ingredients are used, finishing with mozzarella and remaining Parmesan on top.
Cover loosely with foil and bake 30 minutes.
Remove foil and bake 10–15 minutes more, until bubbly and lightly golden.
Let rest 15 minutes before slicing and serving.