The proposed system uses a dual-loop organic Rankine cycle, a reverse osmosis desalination unit, an absorption cooling unit, and a thermoelectric generator to produce electricity and freshwater for urban areas. A thorough assessment of the system's thermodynamic and economic performance has been conducted, with a parameter-based investigation to assess the effect of key variables on the system performance. The parametric study indicates that rising the geothermal mass flow rate enhances the energy efficiency, but lowers the energy efficiency and affects the cooling requirements. Moreover, the optimum inlet temperature in turbine 1 increases the desalination efficiency up to 105.02 kg/s at 115 °C, and higher temperatures reduce the performance and system efficiency. Adjusting the temperature difference at the pinch point at Evaporator1 is crucial for system efficiency, with trade-offs between freshwater output, expenses, and exergy efficiency. The capability of the system to produce up to 6,048,000 L of potable water daily signifies a monumental leap towards meeting the water demands of nearly 42,000 individuals, based on European consumption standards. Lastly, the application of genetic algorithms in the optimization process results in an exergetic efficiency of 32.79 % and a cost rate of 58.05 $/h, demonstrating the system's enhanced operational effectiveness.