In algebraic geometry, the classification of isomorphic classes of certain kinds of geometric objects is one of the major problems, and is usually called the moduli problem. Among all kinds of moduli problems, the moduli of curves started early, and has more mature tools and results. Many famous mathematicians have made many outstanding works, such as Riemann, Deligne and Mumford. The main purpose of this report is to construct moduli spaces of curves by geometric invariant theory (GIT) and stack theory, and their compactifications. First I introduce smooth curves and DM stable curves, which are the geometric objects to be classified. Then I give some general theories as tools constructing moduli spaces, including category theory, stack theory, Hilbert scheme and GIT. These form the major part of this article. Next I construct two kinds of moduli spaces of curves, using the properties of curves and the tools I've shown earlier. At last I give some further questions, and discuss some other moduli spaces.