Although the plant leaves need light to allow photosynthesis and growth to occur, there is no requirement for the roots of the plants to also be illuminated.
If you are indifferent to whether the plants roots are visible, using an opaque container is the best way to prevent algal growth as it stops light reaching the water and wet component surfaces. Alternatively, you can creatively cover or paint a transparent container, which personalises your systems while reducing algal growth.