This book presents an expanded version of a course delivered at Hokkaido University (Sapporo, Japan) and at the Mehta Research Institute (Allahabad, India). Its aim is to examine aspects of the relationship connecting the local moduli space of deformations of a mod p "modular" Galois representation p to the corresponding local component of a p-adic Heck algebra.