A robust reduced graphene oxide (rGO), polyaniline (PANI) with calcium (Ca) and magnesium (Mg) bimetallic nanocomposite was successfully prepared using an in-situ chemical facial reducing method and named rGO@PANI-Ca:Mg. Various spectroscopic techniques, including XRD, SEM, TEM, XPS, and supplementary methods, were utilized to characterize the catalyst phase, microstructure, and optical attributes. The composite's photocatalytic efficiency was assessed by degrading antibiotics such as ciprofloxacin (CP) and tetracycline (TC) using calcium peroxide (CaO2) under visible light irradiation. The rGO@PANI-Ca:Mg composite demonstrates superior degradation efficiency for CP, 45%, and for TC, 70%, achieving a correlation coefficient R² of 0.94 and 0.991 respectively. This performance surpasses that of pristine GO, rGO, and rGO@PANI. The heightened photocatalytic activity is ascribed to forming a heterojunction, effectively mitigating electron-hole pair recombination. The incorporation of CaO2 promotes the generation of additional active reactive oxygen species (ROS), particularly OH·, ·O2−, e-, h+, as verified by radical scavenging experiments, indicating an enhancement in the degradation and a potential mechanism is also suggested. The degradation rate of TC, CP, and real wastewater (RW) is about 71%, 45 %, and 40.98 %, respectively. The composite demonstrates stability and reusability for up to three catalytic cycles. Our experiments also showed that when bacteria were treated with a 2 mg catalyst, the minimum inhibitory concentration (MIC) was determined to be at a 10-3 dilution. This MIC value represents the lowest concentration at which the catalyst effectively inhibited bacterial growth, as evidenced by clear inhibition zones.