Cook spaghetti according to package instructions until al dente. Drain and set aside.
In a large skillet, heat olive oil over medium heat.
Add minced garlic and sauté for about 1 minute until fragrant.
Increase heat to medium-high and add shrimp to the skillet.
Cook shrimp for 2-3 minutes, turning once until they are pink and opaque.
Pour in white wine (if using) and let it simmer for 2 minutes.
Add cooked spaghetti to the skillet, tossing to combine.
Stir in chopped parsley and red pepper flakes.
Season with salt and pepper to taste.
Serve immediately with lemon wedges on the side.