This research explores the incorporation of initial capital limitations into the design and optimization of grid-connected photovoltaic (PV) systems, with a focus on their economic and environmental implications. Moving beyond traditional approaches that prioritize energy cost reduction alone, this study presents a unique framework that harmonizes financial viability with technical efficiency. The investigation is divided into three main stages: determining system size, managing excess energy, and analyzing economic outcomes. A case study conducted in Sousse, Tunisia, validates the proposed methodology, utilizing simulation tools such as HOMER and MATLAB. The results demonstrate that an optimal PV setup, featuring a 2.25 kW photovoltaic array, a 1.5 kW inverter, and a 1 kWh battery, becomes economically viable when investments surpass TND 8 million. The findings reveal that integrating financial limitations enables a more strategic approach to renewable energy deployment, lowering the energy cost to TND 0.130/kWh and reducing CO2 emissions from 2597 kg/year to 1490 kg/year. Additionally, the study offers insights applicable to other areas with comparable economic and environmental characteristics. This research provides a practical framework for policymakers and investors seeking to optimize PV systems under budget constraints, supporting the global shift toward sustainable energy practices.