Derech HaShem (The "Way of the Name") is a philosophical text written around 1736 by Rabbi Moshe Chaim Luzzatto.
One of its core assertions is that man was created for the purpose of earning closeness to the creator by struggling against evil inclinations. [1]
2. The Way of God, trans. Aryeh Kaplan, Feldheim 1997. ISBN 0-87306-769-X