A major goal of community ecology is understanding the processes responsible for generating biodiversity patterns along spatial and environmental gradients.In stream ecosystems, system-specific conceptual frameworks have dominated research describing biodiversity change along longitudinal gradients of river networks. However, support for these conceptual frameworks has been mixed, mainly applicable to specific stream ecosystems and biomes, and these frameworks have placed less emphasis on general mechanisms driving biodiversity patterns. Rethinking biodiversity patterns and processes in stream ecosystems with a focus on the overarching mechanisms common across ecosystems will provide a more holistic understanding of why biodiversity patterns vary along river networks. In this study, we apply the theory of ecological communities (TEC) conceptual framework to stream ecosystems to focus explicitly on the core ecological processes structuring communities: dispersal, speciation, niche selection, and ecological drift. Using a unique case study from high-elevation networks of connected lakes and streams, we sampled stream invertebrate communities in the Sierra Nevada, California, USA to test established stream ecology frameworks and compared them with the TEC framework. Local diversity increased and β-diversity decreased moving downstream from the headwaters, consistent with the river continuum concept and the small but mighty framework of mountain stream biodiversity. Local diversity was also structured by distance below upstream lakes, where diversity increased with distance below upstream lakes, in support of the serial discontinuity concept. Despite some support for the biodiversity patterns predicted from the stream ecology frameworks, no single framework was fully supported, suggesting "context dependence." By framing our results under the TEC, we found that species diversity was structured by niche selection, where local diversity was highest in environmentally favorable sites. Local diversity was also highest in sites with small community sizes, countering the predicted effects of ecological drift. Moreover, higher β-diversity in the headwaters was influenced by dispersal and niche selection, where environmentally harsh and spatially isolated sites exhibit higher community variation. Taken together our results suggest that combining system-specific ecological frameworks with the TEC provides a