OptiFine is not added due to it causing render mods to break. If you want to install at your own risk, you can do so.

Place OptiFabric in .minecraft/libraries/me/deftware/emc-f-v2/latest-1.17.1
Place OptiFine in .minecraft/mods/

Normal Fabric mods also go in .minecraft/libraries/me/deftware/emc-f-v2/latest-1.17.1.