This paper presents an improved model based on a three-dimensional non-hydrostatic wave model NHWAVE to simulate the interactions between the surface water and the groundwater affected by tides or waves in coastal areas. With the model, both the surface water flow and the groundwater flow are calculated based on the well-balanced Volume-averaged Reynolds-averaged Navier-Stokes equations. The spatially varying porosity and hydraulic conductivity are used to identifiy the domains for the surface water and the groundwater. The model is calibrated and validated using a wide range of laboratory measurements reported in the literature, involving the tide propagation through a sandy embankment, the tide-induced groundwater table fluctuation in a sandy beach, and the wave setup in a sloping sandy beach. The interactions between the surface water and the groundwater are analyzed and the influencing factors on the groundwater flow are discussed. The phase lag between the surface water elevation and the groundwater table fluctuation is mainly influenced by the hydraulic conductivity of the porous media. The wave attenuation in the groundwater is proportional to its propagation distance. The computed wave setup elevationin the permeable beach is smaller than in the impermeable beach. It is shown that the fully integrated model is capable of simulating the interactions between the surface water and the groundwater affected by tides or waves in coastal areas. It can be an efficient tool to study the tide and wave dynamics in the permeable sandy beach.