In this paper we study large-scale structures and their galaxy content around the most X-ray luminous cluster known, RX J1347.5−1145 at z= 0.45. We make use of u*g′r′i′z′ Canada–France–Hawaii Telescope (CFHT) MegaCam photometry together with VIsible MultiObject Spectrograph (VIMOS) Very Large Telescope (VLT) spectroscopy to identify structures around RX J1347 on a scale of ∼20 × 20 Mpc2. We construct maps of the galaxy distribution and the fraction of blue galaxies. We study the photometric galaxy properties as a function of the environment traced by the galaxy density. We identify group candidates based on galaxy overdensities and study their galaxy content. We also use available Galaxy Evolution Explorer (GALEX) near-ultraviolet imaging to identify strong unobscured star-forming galaxies. We find that the large-scale structure around RX J1347 extends in the north-east–south-west direction for at least 20 Mpc, over a region in which most of the group candidates are located, some of which show X-ray emission in archival XMM–Newton observations. As in other studies, we find that the fraction of blue galaxies (Fblue) is a function of galaxy number density, but the bulk of the trend is due to galaxies belonging to massive systems. The fraction of ultraviolet- (UV-) bright galaxies is also a function of environment, but their relative number compared with the blue population seems to be constant regardless of the environment. These UV emitters also have similar properties at all galaxy densities, indicating that the transition between galaxy types occurs over short time-scales. Candidate galaxy groups show a large variation in their galaxy content and Fblue in those groups displays little dependence on galaxy number density. This may indicate possible differences in their evolutionary status, or suggest that the processes acting in groups are different from those in clusters. The large-scale structure around rich clusters provides a dynamic environment for galaxy evolution. In the case of RX J1347, the transformation may start within infalling groups and finish with the removal of the cold gas once galaxies are accreted into massive systems.