Grate the zucchini using the large holes of a box grater. Transfer to a clean kitchen towel and wring out excess moisture to prevent watery pasta.
Heat extra-virgin olive oil in a large skillet over medium heat. Add chopped shallots, grated zucchini, sea salt, red pepper flakes, and freshly ground black pepper. Cook, stirring occasionally, for 15-20 minutes until thick and jammy.
Stir in the grated garlic and cook for another minute to release its aroma.
Meanwhile, bring a large pot of salted water to a boil and cook spaghetti or bucatini according to package instructions until al dente (about 8-10 minutes).
Reserve about 1 cup of pasta cooking water and drain the pasta. Transfer pasta directly into the skillet with the zucchini mixture.
Add ½ cup of reserved pasta water and grated cheese to the skillet. Stir for 2-3 minutes until a lightly creamy sauce forms. Add more pasta water if needed for desired consistency.
Stir in fresh lemon juice and lemon zest. Adjust seasoning and lemon juice to taste.
Serve warm, garnished with fresh basil and/or mint leaves and extra grated cheese if desired.
Notes
Try adding grilled chicken or chickpeas for extra protein. You can also experiment with different herbs like parsley or dill and add a pinch of chili flakes for heat.