Heat olive oil in a frying pan over medium heat.
Add onion, carrots, and celery and sauté for 5–7 minutes until slightly softened.
Stir in garlic, oregano, thyme, salt, and black pepper and cook for 30 seconds until fragrant.
Transfer the mixture to the slow cooker.
Add chopped tomatoes, cannellini beans, courgette, vegetable stock, and water. Stir well.
Cover and cook on LOW for 6–7 hours or HIGH for 3–4 hours.
About 30 minutes before serving, stir in the pasta and cook until tender.
Stir in chopped spinach or kale and cook until wilted.
Add lemon juice if using. Taste and adjust seasoning if needed.