Unmanned aerial vehicle (UAV) design necessitates significant effort in prototyping, testing, and design iterations. To reduce design time and improve wing performance, an automated design and optimization framework is proposed utilizing open-source software, including OpenVSP: VSPAERO & Parasite Drag Tool, XFOIL, and Python. This study presents a preliminary UAV wing design methodology, emphasizing weight estimation, drag analysis, stall prediction, and endurance optimization. The maximum takeoff weight of the UAV was calculated after estimating the empty weight using a linear regression from data from 20 existing similar UAVs. The wing and engine sizing were determined using the matching plot technique. A solver with low-fidelity models, combining the Vortex Lattice Method (VLM) and analytical expressions, was used to predict the drag coefficient and maximum lift coefficient of the designed wing. An optimization process using a genetic algorithm was applied to maximize endurance while satisfying requirements such as rate of climb, stall, and maximum speeds. The optimized wing was analyzed with computational fluid dynamics (CFD), and its aerodynamic characteristics were compared with those obtained using VLM and the suggested aerodynamic solver. According to the CFD results, the proposed aerodynamic solver estimated the drag coefficient at zero angle of attack with an error of 17.2% compared to 63.1% using the VLM classic method. The error on the maximum lift coefficient estimation was limited to 5.3%. In terms of optimization, the framework showed an increase in the endurance ratio of up to 2% compared to the Artificial Neural Network method coupled with XFLR5. The primary advantage of the suggested framework is the utilization of open-source software, giving a cost-effective and accessible solution for small and medium-sized startups to design and optimize UAVs to achieve mission objectives.