We present HydroCompute, a high-performance client-side computational library specifically designed for web-based hydrological and environmental science applications. Leveraging state-of-the-art technologies in web-based scientific computing, the library facilitates both sequential and parallel simulations, optimizing computational efficiency. Employing multithreading via web workers, HydroCompute enables the porting and utilization of various engines, including WebGPU, Web Assembly, and native JavaScript code. Furthermore, the library supports local data transfers through peer-to-peer communication using WebRTC. The flexible architecture and open-source nature of HydroCompute provide effective data management and decision-making capabilities, allowing users to integrate their own code into the framework. To demonstrate the capabilities of the library, we conducted two case studies: a benchmarking study assessing the performance of different engines and a real-time data processing and analysis application for the state of Iowa. The results exemplify HydroCompute's potential to enhance computational efficiency and contribute to the interoperability and advancement of hydrological and environmental sciences.