Under most viable definitions of democracy, the US isn't the oldest. If you restrict to non-aristocratic (i.e., not limiting franchise by ancestry) representative democracy, Finland and New Zealand, among others, achieved that first; if you accept participatory democracies, the Iroquois Confederacy has it beat by even more; you need to tightly define “democracy” around exactly the US model at a particular time to make it first.
> It's also the legal foundation for the establishment of the country
No, it's not, the country was established before the Constitution.
OP mentioned the Declaration and the Constitution in the same sentence, but for the record, both are revered and held to high regard and do provide the legal foundation for the nation in its current iteration (Articles of Confederation were older than Constitution but have been cast aside due to their ineffective results).