A groundbreaking project is underway in Saudi Arabia's Red Sea region, where construction has begun on what will become the world's largest photovoltaic-energy storage microgrid. This ambitious endeavor features a 400 megawatt (MW) solar photovoltaic (PV) system paired with a 1. This initiative marks a significant milestone in the kingdom's journey towards sustainable development and energy independence, as part of its Vision 2030 objectives. The design of a power system with the least amount of economic and environmental impact is the main challenge because the world is currently facing. Deployments of microgrids powered by renewable energy are some of the most economical, effective, dependable, and sustainable answers to this problem. This step significantly advanced Saudi Arabia's smart microgrids market development by enhancing grid reliability, enabling. Therefore, this paper, we propose a renewable-energy-based microgrid to supply the King Saud University campus, Riyadh, which is expected to reduce the cost of the supply of electricity to the university community. The rest of this paper is divided into different sections.