All of the code necessary for this site is covered in the Gate Tutorial.