When playing survival, bookshelves are rather costly as they cost 1.5 wood logs, 9 reeds, and 3 leather each. I would like to use the absolute minimum number of bookshelves to enchant level 30 items. How many bookshelves are necessary in order to accomplish this?
You need the maximum number of useful bookshelves (15) in order to get level 30 enchantments. The Minecraft Wiki article on Enchantment mechanics has the following table noting the max level available given a number of bookshelves:
As you can see, you can't compromise on the number of bookshelves without reducing your max enchantment. It's going to take 22.5 logs, 135 sugar cane, and 45 leather. Time to start farming!