  In this paper, we use the framework of mod-$\phi$ convergence to prove
precise large or moderate deviations for quite general sequences of real valued
random variables $(X_{n})_{n \in \mathbb{N}}$, which can be lattice or
non-lattice distributed. We establish precise estimates of the fluctuations
$P[X_{n} \in t_{n}B]$, instead of the usual estimates for the rate of
exponential decay $\log( P[X_{n}\in t_{n}B])$. Our approach provides us with a
systematic way to characterise the normality zone, that is the zone in which
the Gaussian approximation for the tails is still valid. Besides, the residue
function measures the extent to which this approximation fails to hold at the
edge of the normality zone.
  The first sections of the article are devoted to a proof of these abstract
results and comparisons with existing results. We then propose new examples
covered by this theory and coming from various areas of mathematics: classical
probability theory, number theory (statistics of additive arithmetic
functions), combinatorics (statistics of random permutations), random matrix
theory (characteristic polynomials of random matrices in compact Lie groups),
graph theory (number of subgraphs in a random Erd\H{o}s-R\'enyi graph), and
non-commutative probability theory (asymptotics of random character values of
symmetric groups). In particular, we complete our theory of precise deviations
by a concrete method of cumulants and dependency graphs, which applies to many
examples of sums of "weakly dependent" random variables. The large number as
well as the variety of examples hint at a universality class for second order
fluctuations.
