Roland Schäfer. 2018. Einführung in die grammatische Beschreibung des Deutschen (Introduction to the Grammar of German), Dritte, überarbeitete und erweiterte Auflage. Berlin: Language Science Press, Text Books in Language Science, No. 2. [BibTeX]
The book can be downloaded freely under an open access license (CC-BY). If you use the book, why not do me a favor and tweet it @codeslapper or send me a message? Or visit the book website grammatick.de.
Buy it on Amazon here: https://www.amazon.de/dp/3961101183
Previous editions: second edition, first edition.