This paper analyses an electrification strategy for a depot for a public transport company, through an optimized model. The case study analyses both the transition of a depot able to host 10 buses towards e-buses and proposes the integration of a micro-grid, powered by PV panels to power the e-buses in a sustainable way. The study addresses key challenges such as spatial constraints, passenger demand, and financial considerations, through a Genetic Algorithm (GA). The analysis encompasses two scenarios: a mixed fleet of electric and diesel buses and an exclusive focus on e-buses. The study highlights the importance of considering both electric and diesel buses in fleet optimization, and combined with renewables emphasize the advantages of operational flexibility and sustainability. Thanks to the implementation of a micro-grid capable of providing 1123.87 kWh/day to power the e-buses as much as possible.