John Locke's revolutionary theory of the Social Compact, or Social Contract, served as the inspiration for a "government of the people, by the people, and for the people." In other words, Locke's theory that governments derive their legitimacy from the "will of the people," gave rise to the notion of self-governance, and thus modern representative democracy. The social compact theory that Locke put forth stated that a group of people could agree to hold themselves accountable not to a monarch, but instead to a group of principals and laws that they would obey. Once this set of laws or principles (the social contract) was established, based on the values of those who drafted that contract, everyone in the community would have to obey the contract's provisions, or face the consequences.
The notion of having an actual constitution (in document form) came from Montesquieu, who took the social compact theory a step further. Montesquieu argued that it was not enough to have a group of founding principles, but that for a representative government to be seen as legitimate, it needed to enshrine those founding principles in one document, which everybody could back refer to when conflicts arose about how to govern. However, the entire inspiration for a government whose legitimacy comes from the people, and which is based on the laws of men, came directly from Locke.
Moreover, the United States Constitution and our Declaration of Independence were influenced by John Locke's famous declaration that all men are endowed with certain "natural rights," which Locke described as, "life, liberty and property." Thomas Jefferson and his fellow Founding Fathers later translated Locke’s words into, "Life, Liberty and the pursuit of Happiness. "Not only did these words end up in our Declaration of Independence, but they also served as the inspiration for our Bill of Rights, and the very notion that the government cannot and does have the power to take these rights away. As Locke argued, and as our founding fathers echoed, these rights are "inalienable.” Therefore, as Locke, and later, the Founding Fathers argued, our government can only protect and guarantee these inalienable rights, and the government exists primarily to do just that.