A carbazolyl-based fluorescent metal-organic framework with deep-blue light emission and a high quantum yield (88%) has been screened out by changing the ratio of mixed ligands, named Cz-MOF-2, which was constructed by ZrO4(OH)4 clusters, 3-(9-ethyl-9H-carbazol-3-yl)-4-methylthieno[2,3-b]thiophene-2,5-dicarboxylate (H2ECMTDC) and 3,4-dimethyl-dihydrothieno[2,3-b]thiophene-2,5-dicarboxylate (H2DMTDC). Cz-MOF-2 has excellent sensitivity in fluorescent sensing of 2,6-dichloro-4-nitroaniline (DCN), nitrofurazone (NZF), and nitrofurantoin (NFT) with detection limits of 3.37 × 10-7, 1.64 × 10-5, and 1.76 × 10-5 M, respectively. The quenching mechanisms involving electron transfer and competitive absorption were comprehensively elucidated through DFT calculations and UV absorption experiments. Cz-MOF-2 has been fabricated into a rapidly regenerated composite membrane with PVDF as a visualized fluorescent sensor for DCN. Furthermore, the carbazolyl groups covalently modified in the framework endowed Cz-MOF-2 with a suitable band gap (2.58 eV) for photocatalytic degradation of organic contaminants. It demonstrated superior photocatalytic efficiency compared to UiO-66 and NH2-UiO-66 in the degradation of tetracycline (TC), and the removal efficiency was up to 85% (20 mg of catalyst, 50 mL, 20 mg/L TC solution and 180 min) under simulated sunlight irradiation using a 300 W Xe lamp. Photoelectrochemical tests demonstrate that Cz-MOF-2 exhibits high photocurrent density and low charge transfer resistance, which provide evidence for the efficient charge separation capability. Radical trapping experiments and ESR detection have substantiated that ·O2- and h+ are the primary active species involved in this photocatalytic reaction. This work highlights the potential of MOFs in the targeted design and development of fluorescent sensors and photocatalysts for environmental detection and remediation.