Soak the dried beans in water overnight. The next day, drain and rinse them. Cook the beans in boiling water for about 45 minutes until tender. Drain and set aside.
Heat olive oil in a large pot over medium heat. Add diced celery, carrot, and onion. Sauté until softened, stirring occasionally.
Pour in the vegetable or chicken stock. Add the Parmigiano-Reggiano rind to infuse the broth with flavour. Bring to a boil, then reduce heat and let it simmer.
Cut the tomatoes in half and add them to the pot, cut side down. Also, add the chopped spinach or Swiss chard. Add the pasta and stir gently.
Cut off the crust from leftover bread and dice it into small pieces. Alternatively, use grissini. Add them to the pot.
Once the pasta and vegetables are cooked, add the cooked beans to the pot. Stir everything together and let it simmer for a few more minutes to blend flavors.
Season the pasta e fagioli with salt and pepper to taste. Serve hot, garnished with fresh thyme leaves and additional Parmigiano-Reggiano cheese if desired.
Ladle the pasta fagioli into bowls and serve immediately. Enjoy this comforting and hearty Italian dish!