Nonlinear optical (NLO) responses have garnered tremendous interest for decades due to their fundamental and technological interests. The theory and calculations of NLO responses including electron-hole interactions, which is especially crucial for reduced-dimensional materials, however, remain underdeveloped. Here, we develop an ab initio approach to calculate second-order nonlinear responses (such as second harmonic generation (SHG) and shift current) with excitonic effects in an exciton-state basis, going beyond the independent-particle approximation. We compute SHG in monolayer h-BN and MoS2 employing exciton states from GW-Bethe-Salpeter equation (GW-BSE) calculations and show both materials exhibit huge excitonic enhancement. The physical origin of the enhancement is directly understood through the coupling amplitudes among exciton states, assisted with diagrammatic representations. Our method provides an accurate and ab initio description of second-order NLO responses, capturing self-energy and electron-hole interaction effects.