This paper proposes a new renewable energy based integrated system for sustainable communities. The proposed system is conceptually developed, modeled, simulated and analyzed using four software packages, including Engineering Equation Solver (EES), Eureqa, SAM and Aspen Plus. The proposed bigeneration system consists of wind turbines, PV units, electrolyzer, and an ammonia synthesis system. The main inputs to the system are nitrogen, water, solar irradiance, and wind. The freshwater is used as the feedstock for the electrolyzers for hydrogen production. The hydrogen produced by the system is then used as feedstock for the multistage ammonia synthesis system. The maximum overall energy and exergy efficiencies of the system are obtained as follows 75.8% and 73.6% at a wind speed of 8 m/s and a solar irradiance of 0 W/m(2). However, at maximum power output from the solar field, the maximum exergy and energy efficiencies of the overall system are found to be 18.8% and 19.1%, respectively. The total exergy destruction at peak power and ammonia production is found to be 21.1 GW. (C) 2019 Elsevier Ltd. All rights reserved.