The energy modeling of an eco-district, composed of residential and commercial facilities, is proposed. First, an optimal strategy aiming at sizing the rated power of the substation transformer is introduced. Then, considering the introduction of photovoltaic (PV) panels and electric vehicles (EV) in the district, the new operating conditions of the transformer are detailed. In order to reduce (a) the peak power of the transformer and (b) the cumulative durations of the transformer overloading periods, an Energy Management System (EMS) is implemented. The latter uses the district EVs, which have Vehicle-to-grid (V2G) capabilities, as flexibility providing units. An economics layer is added in order to compute the electricity costs considering the French pricing. This approach is used to deduce the optimal contracted power with the local system operator. Results show a reduction of 70% in overloading durations, 71% in average overloading power, and 17% in electricity costs with the EMS.