A reactor for water splitting or water treatment includes a first electrode, a second electrode electrically coupled to the first electrode, and a proton exchange membrane separating the first electrode and the second electrode. The first electrode includes a first optical fiber coated with a photocatalytic material.