God is the ultimate basis of justice. The community isn't the basis of justice, neither is individual intuition. Justice exists because God exists. If there is no God, or if God hasn't spoken, then there is no justice. There can be no justice in an atheist world.
God has already spoken definitively about justice in the Bible. The Bible is God's out-breathed word, without error over-all, and in each individual part. This makes it the highest authority.
The Bible defines what is just, and the Bible's definitions of justice are sufficient for all peoples at all times. The Bible does not need to be supplemented by human reason, and is not defined or evolved-past by human culture. Sociology, law, and economics do not define justice, the Bible does.
The Torah states rules of justice in both narrative and prescriptive ways. Genesis tells many stories in which many characters act unjustly. God held them accountable for their unjust acts, even though Moses hadn't written his law yet. Then God gave His written law through Moses.
In the pursuit of clear rules of justice, Moses' Law must be handled with extreme care. Christians have erred toward theocracy (such as Rousas Rushdoony) by applying all of Moses' laws to Gentile societies, which is incorrect. On the other hand, other Christians (such as J. H. Thornwell) preached the exclusive "spirituality" of the church, and that Christianity had nothing to say to the civil society and laws of its own times. This too was wrong.
I believe that nine of the ten commandments can be seen in the stories of Genesis, and the New Testament gives us guidance on which portions of Moses' Law were timeless versus which ones were discontinued; and which of Moses' laws illustrated justice at work. For example, Moses forbids the moving of boundary-stones. This was an example of the timeless law, "Do not steal." We don't use boundary-stones today, but the principle would be not to steal by altering ownership markers.
The New Testament is clear that the entire priestly system of Moses was fulfilled by Christ, and is obsolete. Only Israel was supposed to be God's real theocracy. Christ said the Mosaic food laws were no longer in force. God gave the blessings and cursings of the Law for the Hebrews as they dwelt in the Promised Land. The Puritans, misguided by their "replacement theology" errors, never had the right to claim them. The U.S. was never the New Israel.
I believe God governs the 'secular' world by the general moral laws we see in Genesis. Another way to describe these laws is "conscience."
God affirms the right of non-theocratic governments to exist, both during Israel's time in Babylon (where God tells the Hebrews to be a blessing to the city), and in Romans 13 (where Paul says God appoints the secular rulers and requires us to respect and obey them within certain limits).
This is why the absence of blue laws doesn't bother me in the least. The Fourth Commandment (Sabbath) was only for the Jews, was only for the seventh day, and was fulfilled in Christ. God never expected Gentile nations to keep the sabbath, not even in the Old Testament times.
My bottom line is that true standards of justice are defined by the Bible. The Bible affirms the basic, universal instincts of conscience (even bad people object when evil acts are done to them!). It is a sin to falsely define "justice" by an unbiblical philosophical authority, such as Ghandi, Rousseau, or Marx, then try to Christianize those definitions with verses -- almost always quoted out of context.
So, please don't be wildly swept along by the passionate purveyors of politics. Political theories of justice, social or otherwise, fall under the dissecting sword of Scripture as much any religious sermon does. Scripture alone, studied carefully, defines the fundamental laws of justice. Not sociologists, economists, or philosophers.