with good coding practices
vague question = vague answer
there are plenty of open source CMS's out there use a couple of them mark good points and bad points then try to build one that incorporates as many of the good points as possible while eliminating as many of the bad points as possible.