Carbon nitride exhibits mediocre activity in photocatalytic environmental remediation and energy conversion due to its limited light absorption and sluggish charge transfer. Most studies have focused on structural engineering with either a single carbon or nitrogen defect, and insufficient attention has been paid to the effects of various defects within the bulk structure of carbon nitride on its photocatalytic activity. In this study, we prepared CN via thermal polymerization using different precursors, including melamine, 3-amino-1,2,4-triazole, 5-aminotetrazole, and a mixture of these compounds to explore the synergistic effects of carbon/nitrogen vacancies. All samples exhibited both carbon and nitrogen defects, which were correlated with the energy band gaps and sub-energy band levels, as well as photocatalytic activity for H2 evolution and tetracycline degradation. Among these samples, melamine-derived CN exhibited the fewest carbon/nitrogen defects and showed an apparent quantum yield of 7.6 % under light irradiation (λ = 420 nm) for photocatalytic H2 evolution. This sample was also used for tetracycline degradation and exhibited high activity and recyclability. A Pt-loaded melamine-derived CN sample was fabricated in a plate reactor for photocatalytic H2 evolution under sunlight. H2 evolution was correlated with sunlight intensity, revealing that our reactor holds promise for the potential large-scale production of H2 under daylight irradiation.