 String::finishesWith = (suffix) ->
 	return @indexOf(suffix) is @length-1
 
+
 # -------------------------------------
-# Main
+# Models
+
+class File
+	# Auto
+	id: null
+	basename: null
+	extensions: []
+	extension: null
+	filename: null
+	fullPath: null
+	relativePath: null
+	relativeBase: null
+	content: null
+	contentSrc: null
+	contentRaw: null
+
+	# User
+	title: null
+	date: null
+	slug: null
+	url: null
+	ignore: false
+	tags: []
+	relatedDocuments: []
+
+	# Constructor
+	constructor: (fullPath,relativePath) ->
+		@fullPath = fullPath
+		@relativePath = relativePath
+		@tags = []
+		@relatedDocuments = []
+
+	# Load
+	# next(err)
+	load: (next) ->
+		# Async
+		tasks = new util.Group (err) =>
+			if err
+				logger.log 'err', "Failed to read the file #{@relativePath}"
+			else
+				logger.log 'debug', "Read the file #{@relativePath}"
+			next err
+		tasks.total = 2
+
+		# Stat the file
+		fs.stat @fullPath, (err,fileStat) =>
+			return next err  if err
+			@date = fileStat.ctime
+			tasks.complete()
+
+		# Read the file
+		fs.readFile @fullPath, (err,data) =>
+			return next err  if err
+
+			# Handle data
+			fileData = data.toString()
+			fileSplit = fileData.split '---'
+			fileMeta = {}
+			if fileSplit.length >= 3 and !fileSplit[0]
+				# Extract parts
+				fileHead = fileSplit[1].replace(/\t/g,'    ').replace(/\s+$/m,'').replace(/\r\n?/g,'\n')+'\n'
+				fileBody = fileSplit.slice(2).join('---')
+				fileMeta = yaml.eval fileHead
+			else
+				# Extract part
+				fileBody = fileData
+
+			# Extensions
+			@basename = path.basename @fullPath
+			@extensions = @basename.split /\./g
+			@extensions.shift()
+			@extension = @extensions[0]
+			@filename = @basename.replace(/\..*/, '')
+
+			# Temp
+			fullDirPath = path.dirname @fullPath
+			relativeDirPath = path.dirname(@relativePath).replace(/^\.$/,'')
+
+			# Update Meta
+			@content = fileBody
+			@contentSrc = fileBody
+			@contentRaw = fileData
+			@relativeBase = (if relativeDirPath.length then relativeDirPath+'/' else '')+@filename
+			@title = @title || path.basename(@fullPath)
+			@date = new Date(@date)  if @date
+			@slug = util.generateSlugSync @relativeBase
+			@id = @slug
+			@url = '/'+@relativeBase+'.'+@extension
+
+			# Apply User Meta
+			for own key, value of fileMeta
+				@[key] = value
+
+			# Complete
+			tasks.complete()
+
+class Layout extends File
+	
+class Document extends File
+
+
+# -------------------------------------
+# Docpad
 
 class Docpad
 

								throw err  if err
								logger.log 'info', 'DocPad is is now watching and serving you...'

	# Clean the database
	generateClean: (next) ->
		# Prepare

						logger.log 'info', 'Copied the skeleton'
					next err


	# Server
	serverAction: (next) ->
		# Requires
