The Constitution
The Constitution is the supreme law of the land, it provides the government powers, while also providing limitations that protect the fundamental rights of US citizens.

Issues with the Articles of Confederation: Although it did loosely unite the states, it gave Congress power. This power was very limited, as the central government created diplomacy and declared war, set weights and measures, and was the final arbiter of state disputes. It could not raise funds, as it depended on states for money to operate. Also, any decision that needed a vote from all the states, failed.
The Federal Convention met in the State House (AKA Independence Hall) in Philadelphia on May 14, 1787, to revise the Articles of Confederation. Soon they decided that, rather than change the Articles, the Convention would draft an entirely new structure of government. All through the summer, in closed sessions, the delegates debated, and redrafted the articles of the new Constitution. Some of the major issues that were brought up included how power would be given to the central government, how many representatives in Congress to allow each state, and how these representatives should be elected--directly by the people or by the state legislators.

Aims of the Constitution: It wanted to create a strong federal government that did not infringe on an individual's fundamental rights. One way to avoid this was to create a system of checks and balances to make sure no branch of government would gain supremacy over the other two. Any powers that the branches didn't have were left to the states.

Two plans were considered to determine the number of representatives each state would get: the Virginia Plan, which granted representation based on the population of each state, and the New Jersey plan, which gave each state an equal vote in Congress. The Virginia Plan was supported by the larger states, and the New Jersey plan preferred by the smaller. In the end, they created the Great Compromise (sometimes called the Connecticut Compromise), where the House of Representatives would represent the people based on population; the Senate would represent the states apportioned equally; and the President would be elected by the Electoral College. The plan also called for an independent judiciary (court system).

Finally, the Founders also created a system where the Constitution could be amended. An amendment could be proposed by a 2/3 vote of both Houses of Congress, or, if two-thirds of the states request one, by a convention called for that purpose. The amendment could be ratified by three-fourths of the state legislatures, or three-fourths of conventions called in each state for ratification. No amendment can deny a state equal representation in the Senate without that state's consent.
The Constitution was actually written by a delegate from Pennsylvania, Gouverneur Morris, who is also credited with the Preamble. On September 17, 1787, 39 of the 55 delegates signed the new document, with many of those who refused to sign due to the lack of a bill of rights. At least one delegate refused to sign because the Constitution still protected slavery and the slave trade.

Of course, this opened up debates between the Federalists and Antifederalitsts

The first election under the Constitution took place early in the year of 1789. George Washington became the first President, and John Adams became the first Vice President. To appease the Antifederalists, the first Congress drafted a Bill of Rights, the first 10 Amendments to the Constitution:

The First Amendment provides that Congress make no law respecting an establishment of religion or prohibiting its free exercise. It protects freedom of speech, the press, assembly, and the right to petition the Government for a redress of grievances.
The Second Amendment gives citizens the right to bear arms.
The Third Amendment prohibits the government from quartering troops in private homes, a major grievance during the American Revolution.
The Fourth Amendment protects citizens from unreasonable search and seizure. The government may not conduct any searches without a warrant, and such warrants must be issued by a judge and based on probable cause.
The Fifth Amendment provides that citizens not be subject to criminal prosecution and punishment without due process. Citizens may not be tried on the same set of facts twice, and are protected from self-incrimination (the right to remain silent). The amendment also establishes the power of eminent domain, ensuring that private property is not seized for public use without just compensation.
The Sixth Amendment assures the right to a speedy trial by a jury of one's peers, to be informed of the crimes with which they are charged, and to confront the witnesses brought by the government. The amendment also provides the accused the right to compel testimony from witnesses, and to legal representation.
The Seventh Amendment provides that civil cases also be tried by jury.
The Eighth Amendment prohibits excessive bail, excessive fines, and cruel and unusual punishments.
The Ninth Amendment states that the list of rights enumerated in the Constitution is not exhaustive, and that the people retain all rights not enumerated.
The Tenth Amendment assigns all powers not delegated to the United States, or prohibited to the states, to either the states or to the people.
For some other amendments in detail: 13th 14th and 15th Amendments, the 16th Amendment, the 17th Amendment, the 18th Amendment, the 19th Amendment