1. Preheat oven to 425°F.
2. Heat olive oil in a cast iron skillet over medium-high heat. Add shallots to the pan and sauté until softened. Reduce heat, add garlic & crushed red pepper flakes, and sauté for an additional 1 minute.
3. Set aside ¼ cup of tomatoes and add the remaining tomatoes to the pan with ¾ tablespoon thyme and season with salt & pepper. Cook for 15 minutes over medium heat. Reduce heat and continue cooking for an additional 30 minutes, stirring frequently.
4. Stir in ¾ tablespoon basil and beans. Top with both cheeses and bake for 10-15 minutes until cheese is golden.
5. To serve, garnish with remaining thyme, basil, and reserved tomatoes. Serve with bread if desired.