Salting the zucchini before cooking it draws out water, eliminating sogginess.
Shred zucchini on the large holes of a box grater. (You should have about 4 cups.) Toss with 1/2 teaspoon salt in a colander set over a bowl. Let stand 10 minutes. Squeeze out excess moisture with your hands.
Melt butter in a large skillet over medium-high. Add shallot; cook 1 minute. Add zucchini; cook until tender and golden, 5 minutes. Stir in red-pepper flakes; season with salt and pepper. Serve atop baguette slices, drizzled with olive oil.