First-principles calculations combining density functional theory and many-body perturbation theory can provide microscopic insight into the dynamics of electrons and phonons in materials. We review this theoretical and computational framework, focusing on perturbative treatments of scattering, dynamics and transport of coupled electrons and phonons. We discuss application of these first-principles calculations to electronics, lighting, spectroscopy and renewable energy.