Heat olive oil in a large pot over medium heat.
Add onions, carrots, and celery. Sauté for 5 minutes until softened.
Stir in garlic and cook for another minute until fragrant.
Pour in the vegetable or chicken broth.
Add diced tomatoes, green beans, thyme, oregano, and bay leaf.
Season with salt and pepper.
Bring to a boil, then reduce heat and let it simmer for 20 minutes.
If using pasta or rice, add it now and cook until tender (about 10-12 minutes).
Stir in spinach or kale (if using) and cook for 2-3 minutes until wilted.
Remove the bay leaf and adjust seasoning if needed.
Ladle the soup into bowls and garnish with fresh parsley.
Enjoy with crusty bread or a sprinkle of Parmesan cheese!