It is now apparent that future generations of fast electronics and compact sensors may need to rely increasingly on integrated optical components. But integration of electronics and photonics in today's IC's is challenging. Silicon, the ubiquitous electronic material, is neither ideally suited for most photonic functions nor readily integrated with most of the common photonic materials, such as GaAs. The approach we describe here relies on GaN-based films, which can be grown directly on silicon substrates and hence can be potentially integrated with state-of-the-art Si-based electronics. We have demonstrated the fabrication of GaN structures on silicon wafers ranging in overall size from sub-micron to several millimeters, all containing highly accurate individual features on the nm scale. As proof of concept, we have fabricated GaN optical waveguides and photonic crystals containing optical cavities by patterning GaN membranes grown directly on Si wafers. Our optical cavities were designed to have resonant modes within the spectral region of the broad defect-induced luminescence of GaN. We have measured sharp resonant features associated with these cavities by optically pumping above the GaN band edge, and have compared the data to numerical simulations of the spectra. Our results to date demonstrate the feasibility of fabricating high-quality GaN photonic structures directly on Si wafers, thereby providing a possible path to achieving true integration of electronics and photonics in future generations of IC's.