The diffraction-like process displayed by a spatially localized matter wave is here analyzed in a case where the free evolution is frustrated by the presence of hard-wall-type boundaries (beyond the initial localization region). The phenomenon is investigated in the context of a nonrelativistic, spinless particle with mass m confined in a one-dimensional box, combining the spectral decomposition of the initially localized wave function (treated as a coherent superposition of energy eigenfunctions) with a dynamical analysis based on the hydrodynamic or Bohmian formulation of quantum mechanics. Actually, such a decomposition has been used to devise a simple and efficient analytical algorithm that simplifies the computation of velocity fields (flows) and trajectories. As it is shown, the development of space-time patters inside the cavity depends on three key elements: the shape of the initial wave function, the mass of the particle considered, and the relative extension of the initial state with respect to the total length spanned by the cavity. From the spectral decomposition it is possible to identify how each one of these elements contribute to the localized matter wave and its evolution; the Bohmian analysis, on the other hand, reveals aspects connected to the diffraction dynamics and the subsequent appearance of interference traits, particularly recurrences and full revivals of the initial state, which constitute the source of the characteristic symmetries displayed by these patterns. It is also found that, because of the presence of confining boundaries, even in cases of increasingly large box lengths, no Fraunhofer-like diffraction features can be observed, as happens when the same wave evolves in free space. Although the analysis here is applied to matter waves, its methodology and conclusions are also applicable to confined modes of electromagnetic radiation (optical fibers).