A junction box includes an enclosable housing comprising sidewalls and a bottom with a bottom interior surface and a bottom exterior surface opposing the bottom interior surface. The housing is configured to mount to a roof of a structure where the roof includes a slope. The junction box includes a flashing attached to the housing and extending horizontally from the housing in a direction planar to the bottom. The junction box includes a lid configured to attach to a top of the housing along top edges of the sidewalls of the housing. The top is opposite the bottom and the lid includes an outer lip configured to overlap and extend past the top edges of the sidewalls of the housing.