{"_id":"47pages-keystone","_rev":"12-d8ddba1d762b1031e638a76038e5f1e8","name":"47pages-keystone","description":"47Pages fork of the Node.js CMS: Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"47pages-keystone","version":"0.0.1","description":"47Pages fork of the Node.js CMS: Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose","main":"index.js","repository":{"type":"git","url":"https://github.com/47pages/keystone.git"},"dependencies":{"async":"~0.9.0","azure":"~0.9.16","bcrypt-nodejs":"~0.0.3","cloudinary":"~1.0.12","connect-flash":"~0.1.1","csv":"~0.3.7","embedly":"~1.0.2","express":"~3.3.8","jade":"~1.6.0","keystone-utils":"~0.1.12","knox":"~0.9.1","less-middleware":"~1.0.4","mandrill-api":"~1.0.40","marked":"~0.3.2","moment":"~2.8.1","mongoose":"~3.8.16","mpromise":"~0.5.1","mv":"^2.0.3","numeral":"~1.5.3","queryfilter":"~0.0.4","range_check":"~0.0.4","semver":"~3.0.1","underscore":"~1.7.0"},"devDependencies":{"browserify":"~5.11.2","chalk":"~0.5.1","fs-extra":"~0.11.1","gulp":"~3.8.8","gulp-coverage":"~0.3.27","gulp-jshint":"~1.8.4","gulp-mocha":"~1.1.0","gulp-rename":"~1.2.0","gulp-rimraf":"~0.1.0","gulp-uglify":"~1.0.1","gulp-util":"~3.0.1","gulp-watch":"~1.0.4","jshint":"~2.5.5","jshint-stylish":"~0.4.0","mocha":">= 1.21 < 2","must":">= 0.12 < 1","reactify":"~0.14.0","sinon":"^1.10.3","supertest":"~0.13.0","vinyl-source-stream":"~1.0.0","watchify":"~1.0.2"},"author":{"name":"Jed Watson"},"license":"MIT","keywords":["express","web","app","cms","admin","framework","mongoose","gui","forms"],"gitHead":"ef3fd612285315ea8e12f68da4c8d6031e2c7fe7","bugs":{"url":"https://github.com/JedWatson/keystone/issues"},"scripts":{"test":"mocha ./test -R spec"},"engines":{"node":">= 0.10.28","npm":">= 1.4.9"},"homepage":"https://github.com/47pages/keystone","_id":"47pages-keystone@0.0.1","dist":{"shasum":"787450a63431493150716ce0ec6dc76bd4a24fe9","tarball":"https://registry.npmjs.org/47pages-keystone/-/47pages-keystone-0.0.1.tgz","integrity":"sha512-JUrqCvUfmhN1+fAJ2H/WwnX7DQsJz42widQLkwrlt7PA6m4gpVDXDhrG39oWnNdc+OVifGgF0xKdIhDc81MzQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALDpKGx04YyCwVk5ytt0f2nIwFfe4pm0Ut8yCNF/bUMAiAR9C3ESlRNd9jJBroCY4QAjwyZkzPAhlAGsrGxKiLVgw=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"},"maintainers":[{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"}]},"0.0.2":{"name":"47pages-keystone","version":"0.0.2","description":"47Pages fork of the Node.js CMS: Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose","main":"index.js","repository":{"type":"git","url":"https://github.com/47pages/keystone.git"},"dependencies":{"async":"~0.9.0","azure":"~0.9.16","bcrypt-nodejs":"~0.0.3","cloudinary":"~1.0.12","connect-flash":"~0.1.1","csv":"~0.3.7","embedly":"~1.0.2","express":"~3.3.8","jade":"~1.6.0","keystone-utils":"~0.1.12","knox":"~0.9.1","less-middleware":"~1.0.4","mandrill-api":"~1.0.40","marked":"~0.3.2","moment":"~2.8.1","mongoose":"~3.8.16","mpromise":"~0.5.1","mv":"^2.0.3","numeral":"~1.5.3","queryfilter":"~0.0.4","range_check":"~0.0.4","semver":"~3.0.1","underscore":"~1.7.0"},"devDependencies":{"browserify":"~5.11.2","chalk":"~0.5.1","fs-extra":"~0.11.1","gulp":"~3.8.8","gulp-coverage":"~0.3.27","gulp-jshint":"~1.8.4","gulp-mocha":"~1.1.0","gulp-rename":"~1.2.0","gulp-rimraf":"~0.1.0","gulp-uglify":"~1.0.1","gulp-util":"~3.0.1","gulp-watch":"~1.0.4","jshint":"~2.5.5","jshint-stylish":"~0.4.0","mocha":">= 1.21 < 2","must":">= 0.12 < 1","reactify":"~0.14.0","sinon":"^1.10.3","supertest":"~0.13.0","vinyl-source-stream":"~1.0.0","watchify":"~1.0.2"},"author":{"name":"Matt Dahl"},"license":"MIT","keywords":["express","web","app","cms","admin","framework","mongoose","gui","forms"],"gitHead":"ef3fd612285315ea8e12f68da4c8d6031e2c7fe7","bugs":{"url":"https://github.com/47pages/keystone/issues"},"scripts":{"test":"mocha ./test -R spec"},"engines":{"node":">= 0.10.28","npm":">= 1.4.9"},"homepage":"https://github.com/47pages/keystone","_id":"47pages-keystone@0.0.2","dist":{"shasum":"36225ff804ebb368a069e2099c97a89546e8a7dd","tarball":"https://registry.npmjs.org/47pages-keystone/-/47pages-keystone-0.0.2.tgz","integrity":"sha512-b6VjgsA+5+HH7u6F0jmRPuJe011Cm08SIzyg1tizTsaDb8FOcqV8O/Ab0HC7/i4lWHLaJ+QgoWpd8z0GX/p5Ug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEpZKvkOzWmOPMCKrJuOTBP3z0MOzB5n0OA0J7cBH7ZKAiEAspIdP6GFDmyR4cxCQTwl91mMzxfP2Ox+O8c3V4mp0UM="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"},"maintainers":[{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"}]},"0.0.3":{"name":"47pages-keystone","version":"0.0.3","description":"47Pages fork of the Node.js CMS: Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose","main":"index.js","repository":{"type":"git","url":"https://github.com/47pages/keystone.git"},"dependencies":{"async":"~0.9.0","azure":"~0.9.16","bcrypt-nodejs":"~0.0.3","cloudinary":"~1.0.12","connect-flash":"~0.1.1","csv":"~0.3.7","embedly":"~1.0.2","express":"~3.3.8","jade":"~1.6.0","keystone-utils":"~0.1.12","knox":"~0.9.1","less-middleware":"~1.0.4","mandrill-api":"~1.0.40","marked":"~0.3.2","moment":"~2.8.1","mongoose":"~3.8.16","mpromise":"~0.5.1","mv":"^2.0.3","numeral":"~1.5.3","queryfilter":"~0.0.4","range_check":"~0.0.4","semver":"~3.0.1","underscore":"~1.7.0"},"devDependencies":{"browserify":"~5.11.2","chalk":"~0.5.1","fs-extra":"~0.11.1","gulp":"~3.8.8","gulp-coverage":"~0.3.27","gulp-jshint":"~1.8.4","gulp-mocha":"~1.1.0","gulp-rename":"~1.2.0","gulp-rimraf":"~0.1.0","gulp-uglify":"~1.0.1","gulp-util":"~3.0.1","gulp-watch":"~1.0.4","jshint":"~2.5.5","jshint-stylish":"~0.4.0","mocha":">= 1.21 < 2","must":">= 0.12 < 1","reactify":"~0.14.0","sinon":"^1.10.3","supertest":"~0.13.0","vinyl-source-stream":"~1.0.0","watchify":"~1.0.2"},"author":{"name":"Matt Dahl"},"license":"MIT","keywords":["express","web","app","cms","admin","framework","mongoose","gui","forms"],"gitHead":"ef3fd612285315ea8e12f68da4c8d6031e2c7fe7","bugs":{"url":"https://github.com/47pages/keystone/issues"},"scripts":{"test":"mocha ./test -R spec"},"engines":{"node":">= 0.10.28","npm":">= 1.4.9"},"homepage":"https://github.com/47pages/keystone","_id":"47pages-keystone@0.0.3","dist":{"shasum":"0ed7dec354b2d96025e53111039691f7c59a7df2","tarball":"https://registry.npmjs.org/47pages-keystone/-/47pages-keystone-0.0.3.tgz","integrity":"sha512-qQLzfvxo7DNONP/I92ADFGGT5YpoL/4VOnD8MKDq+pIpsytG97CoO8FfzuGO+SoZ2AlD8swMbhBGNe0ObxeITw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJxXYL62Kociw13NeqMoj1ZdNtTVtLyOrFHpblkqegjgIhAK/qY98aolCtNvSutR7TzYKLqZuUGqHFwsdV7yg5bO6A"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"},"maintainers":[{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"}]},"0.0.4":{"name":"47pages-keystone","version":"0.0.4","description":"47Pages fork of the Node.js CMS: Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose","main":"index.js","repository":{"type":"git","url":"https://github.com/47pages/keystone.git"},"dependencies":{"async":"~0.9.0","azure":"~0.9.16","bcrypt-nodejs":"~0.0.3","cloudinary":"~1.0.12","connect-flash":"~0.1.1","csv":"~0.3.7","embedly":"~1.0.2","express":"~3.3.8","jade":"~1.6.0","keystone-utils":"~0.1.12","knox":"~0.9.1","less-middleware":"~1.0.4","mandrill-api":"~1.0.40","marked":"~0.3.2","moment":"~2.8.1","mongoose":"~3.8.16","mpromise":"~0.5.1","mv":"^2.0.3","numeral":"~1.5.3","queryfilter":"~0.0.4","range_check":"~0.0.4","semver":"~3.0.1","underscore":"~1.7.0"},"devDependencies":{"browserify":"~5.11.2","chalk":"~0.5.1","fs-extra":"~0.11.1","gulp":"~3.8.8","gulp-coverage":"~0.3.27","gulp-jshint":"~1.8.4","gulp-mocha":"~1.1.0","gulp-rename":"~1.2.0","gulp-rimraf":"~0.1.0","gulp-uglify":"~1.0.1","gulp-util":"~3.0.1","gulp-watch":"~1.0.4","jshint":"~2.5.5","jshint-stylish":"~0.4.0","mocha":">= 1.21 < 2","must":">= 0.12 < 1","reactify":"~0.14.0","sinon":"^1.10.3","supertest":"~0.13.0","vinyl-source-stream":"~1.0.0","watchify":"~1.0.2"},"author":{"name":"Matt Dahl"},"license":"MIT","keywords":["express","web","app","cms","admin","framework","mongoose","gui","forms"],"gitHead":"ef3fd612285315ea8e12f68da4c8d6031e2c7fe7","bugs":{"url":"https://github.com/47pages/keystone/issues"},"scripts":{"test":"mocha ./test -R spec"},"engines":{"node":">= 0.10.28","npm":">= 1.4.9"},"homepage":"https://github.com/47pages/keystone","_id":"47pages-keystone@0.0.4","dist":{"shasum":"c8671d391e0dca13f3119a4ec128958c15d55be2","tarball":"https://registry.npmjs.org/47pages-keystone/-/47pages-keystone-0.0.4.tgz","integrity":"sha512-M3/gOYk6llM0VaJtlix4D60w3oT5vQdBx1S3qcacGczF3oG9V+d321FNM+vsS0RDjjHsMwQTmoI71JiUhAc4kQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHVpoWRyPVI1xplT05jEP+cqpKVFYisPl+6CZr+Kd74wIgJUSezsZZNI1+MhWLrsEENQCdIlh01kmM87mpmWjrWwI="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"},"maintainers":[{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"}]},"0.0.5":{"name":"47pages-keystone","version":"0.0.5","description":"47Pages fork of the Node.js CMS: Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose","main":"index.js","repository":{"type":"git","url":"https://github.com/47pages/keystone.git"},"dependencies":{"async":"~0.9.0","azure":"~0.9.16","bcrypt-nodejs":"~0.0.3","cloudinary":"~1.0.12","connect-flash":"~0.1.1","csv":"~0.3.7","embedly":"~1.0.2","express":"~3.3.8","jade":"~1.6.0","keystone-utils":"~0.1.12","knox":"~0.9.1","less-middleware":"~1.0.4","mandrill-api":"~1.0.40","marked":"~0.3.2","moment":"~2.8.1","mongoose":"~3.8.16","mpromise":"~0.5.1","mv":"^2.0.3","numeral":"~1.5.3","queryfilter":"~0.0.4","range_check":"~0.0.4","semver":"~3.0.1","underscore":"~1.7.0"},"devDependencies":{"browserify":"~5.11.2","chalk":"~0.5.1","fs-extra":"~0.11.1","gulp":"~3.8.8","gulp-coverage":"~0.3.27","gulp-jshint":"~1.8.4","gulp-mocha":"~1.1.0","gulp-rename":"~1.2.0","gulp-rimraf":"~0.1.0","gulp-uglify":"~1.0.1","gulp-util":"~3.0.1","gulp-watch":"~1.0.4","jshint":"~2.5.5","jshint-stylish":"~0.4.0","mocha":">= 1.21 < 2","must":">= 0.12 < 1","reactify":"~0.14.0","sinon":"^1.10.3","supertest":"~0.13.0","vinyl-source-stream":"~1.0.0","watchify":"~1.0.2"},"author":{"name":"Matt Dahl"},"license":"MIT","keywords":["express","web","app","cms","admin","framework","mongoose","gui","forms"],"gitHead":"ef3fd612285315ea8e12f68da4c8d6031e2c7fe7","bugs":{"url":"https://github.com/47pages/keystone/issues"},"scripts":{"test":"mocha ./test -R spec"},"engines":{"node":">= 0.10.28","npm":">= 1.4.9"},"homepage":"https://github.com/47pages/keystone","_id":"47pages-keystone@0.0.5","dist":{"shasum":"5f1f8c65311151bcc6edc8de643e2dae862bb721","tarball":"https://registry.npmjs.org/47pages-keystone/-/47pages-keystone-0.0.5.tgz","integrity":"sha512-RFUS1ikFkmVtYFcf6vCy65tLkZm0n6CwXeycJN5oQC5Oi3JIMXzY9hx4C7QhEjM0WK3bfhjM3jdjW+9Jvvv4Tw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKTA6vu8PBye5QM0dXwYNjY/1f0doiIEImZbESo6DkVAiA30rdEdus8V+GDIpiq4HOq2fdykf0VK4vWmXCNPTO/kw=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"},"maintainers":[{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"}]}},"readme":"## 47Pages Fork\n\nThe 47Pages fork of KeystoneJS is necessary for two reasons:\n*\tKeystone is still in a stage of relatively unstable development\n*\tThe 47Pages site requires additional functionality tailored to its unique needs\n\nThat being said, it is important that localized changes be kept in sync with the upstream Keystone repository, as development there is continuously improving. We want to be able to pull down those changes into our forked branch, while maintaining stability on our production release and retaining the custom changes made for 47Pages.\n\n### Branching model\nClone **keystone-47pages** locally and set the upstream origin:\n\n    git clone git@github.com:git@github.com:47pages/keystone.git\n    git remote add upstream git@github.com:JedWatson/keystone.git\n    \nTo develop, checkout the latest development branch (e.g. **47pages-0617-4f48821**). The first number is the month and date of the branch's creation, to allow for easy chronological sorting. The second number is the short SHA1 hash of the latest upstream commit that this branch has been rebased against. Add commits to this branch as you make changes.\n\nWhen you are ready to merge into the production branch, you must first rebase **47pages-prod** against the upstream fork! This is to ensure that our changes do not diverge too much from the official repository.\n\n    git checkout master\n    git pull upstream master\n    git checkout 47pages-prod\n    git merge master\n    \nResolve any conflicts. Check that everything is working okay with the changes pulled in from upstream. Note that 47pages-related changes *only* ever happen in branches prefixed with **47pages** - our **master** should always be pristine.\n\nThen, simply merge the changes in your development branch into production. There should be no conflicts at this point.\n\n    git merge 47pages-date-sha1\n    git push origin 47pages-prod\n    \nFinally, create the new development branch for future changes. Old development branches can stay around to rollback to if something breaks, but no new development should take place in them.\n\n    git checkout master\n    git rev-parse --short HEAD\n    git checkout 47pages-prod\n    git checkout -b 47pages-newdate-newsha1\n\n\n![KeystoneJS](http://keystonejs.com/images/logo.svg)\n===================================\n\n![Build Status](https://travis-ci.org/keystonejs/keystone.svg)\n\n[KeystoneJS](http://keystonejs.com) is a powerful new Node.js content management system and web app framework built on [express](http://expressjs.com) and [mongoose](http://mongoosejs.com) that makes it easy to create sophisticated web sites and apps, and gives you a beautiful, auto-generated Admin UI.\n\nTo get started, check out [keystonejs.com](http://keystonejs.com)!\n\n## About\n\nKeystone gives you:\n*\tA simple way to create a dynamic web site or app with well-structured routes, templates and models\n*\tA beautiful Admin UI based on the database models you define\n*\tEnhanced `models` with additional field types and functionality, building on those natively supported by Mongoose\n*\tOut of the box session management and authentication\n*\tAn updates framework for managing data updates or initialisation\n*\tIntegration with Cloudinary for image uploading, storage and resizing\n*\tIntegration with Mandrill for sending emails easily\n*\tIntegration with Google Places for clever location fields\n*\tIntegration with Embedly for powerful video and rich media embedding tools\n\n... plus a lot of other tools and utilities to make creating complex web apps easier.\n\nUse our [Yeoman Generator](https://github.com/JedWatson/generator-keystone) to get up and running with KeystoneJS quickly, then check out our getting started guide &amp; docs at [keystonejs.com/docs/getting-started](http://keystonejs.com/docs/getting-started).\n\nWe have a demo website at [demo.keystonejs.com](http://demo.keystonejs.com/) where you can play with the Keystone Admin UI, and you can [read the source](https://github.com/JedWatson/keystone-demo) to see how it was built.\n\nIf you have ideas or questions, get in touch on the [KeystoneJS Google Group](https://groups.google.com/d/forum/keystonejs) or tweet at [@KeystoneJS](https://twitter.com/KeystoneJS) on twitter.\n\n\n### SydJS Website\n\nThe primary contributors to Keystone are based in Sydney, Australia and KeystoneJS is written in Javascript, so it was only natural to create a site for the Sydney Javascript Community using it.\n\nThe [SydJS Website](http://www.sydjs.com) is a great example of a more sophisticated project than the Keystone Demo, and you can [view the source code](https://github.com/JedWatson/sydjs-site) to see how it was built.\n\nWe have also written a [SydJS Mobile App](https://github.com/bladey/sydjs-app) with Cordova, Backbone, Velocity.js and jQuery to demonstrate how Javascript can be used to create a native experience for mobile apps, running against a KeystoneJS back-end. For more, including our design resources, check out the [SydJS Showbag](http://www.sydjs.com/showbag).\n\nIf you run a community group, please feel free to copy our site and app and make them your own! And if you do, we'd love to hear from you.\n\n\n### Contributing\n\nKeystoneJS has a big vision, and the support of the community is an important part of making it a reality.\n\nWe love to hear feedback about Keystone and the projects you're using it for, and are happy to give advice on the [KeystoneJS Google Group](https://groups.google.com/d/forum/keystonejs) if you get stuck.\n\nIf you can, please contribute by reporting issues, discussing ideas, or submitting pull requests with patches and new features. We do our best to respond to all issues and pull requests within a day or two, and make patch releases to npm regularly.\n\nIf you're going to contribute code, please try and mimic the existing code standards - we follow [AirBNB's Javascript Style Guide](https://github.com/airbnb/javascript) fairly closely, with the exception of using tab indentation.\n\n\n### Documentation\n\nThe Keystone docs are hosted online at [keystonejs.com](http://keystonejs.com). If you are offline, or would like to contribute to the docs and preview your changes, you can serve them locally by running `node docs` within the `./docs` folder (you will also have to run `npm install` first. This will start the docs site on port 8080.\n\n\n## Usage\n\n**Check out the [KeystoneJS Documentation](http://keystonejs.com/docs) for a walk-through on how to use KeystoneJS.**\n\n### Installation\n\nThe easiest way to get started with Keystone is to use the Yeoman generator.\n\nTo install it, type the following in your terminal:\n\n    npm install -g yo\n    npm install -g generator-keystone\n\nThen, create a new folder for your project and from it, type the following in your terminal:\n\n    yo keystone\n\nThis will create a new project based on the options you select, and install the required packages from **npm**.\n\nAfter the intallation is complete, run this command to start Keystone:\n\n    node keystone\n\nAlternatively, to include Keystone in an existing project or start from scratch (without Yeoman), specify `keystone: \"0.2.x\"` in the `dependencies` array in your `package.json` file, and run `npm install` from your terminal.\n\nThen read through the [Documentation](http://keystonejs.com/docs) and the [Example Projects](http://keystonejs.com/examples) to understand how to use it.\n\n\n### Example application script (keystone.js)\n\nRunning in default mode, Keystone takes care of everything required to configure your application with Express, connect to your MongoDB database, and start the web server.\n\nHere is an example of what your `keystone.js` (or `app.js`, etc) file may look like:\n\n\tvar keystone = require('keystone');\n    \n\tkeystone.init({\n\t\t\n\t\t'name': 'My Project',\n\t\t'brand': 'Project',\n\t\t\n\t\t'favicon': 'public/favicon.ico',\n\t\t'less': 'public',\n\t\t'static': 'public',\n\t\t\n\t\t'views': 'templates/views',\n\t\t'view engine': 'jade',\n\t\t\n\t\t'auth': true,\n\t\t'user model': 'User',\n\t\t'cookie secret': '--- your secret ---',\n\t\t\n\t\t'auto update': true,\n\t\t\n\t\t'emails': 'templates/emails',\n\t\t'mandrill api key': '--- your api key ---',\n\t\t'email rules': { find: '/images/', replace: (keystone.get('env') != 'production') ? 'http://localhost:3000/images/' : 'http://www.keystonejs.com/images/email/' },\n\t\t\n\t\t'cloudinary config': { cloud_name: '--- your cloud name ---', api_key: '--- your api key ---', api_secret: '--- your api secret ---' }\n\t\t\n\t});\n    \n\tkeystone.import('models');\n    \n\tkeystone.set('routes', require('./routes'));\n\t\t\n\tkeystone.start();\n\n\n### Configuration\n\nConfig variables can be passed in an object to the `keystone.init` method, or can be set any time before `keystone.start` is\ncalled using `keystone.set(key, value)`. This allows for a more flexible order of execution (e.g. if you refer to Lists in your\nroutes, you can set the routes after configuring your Lists, as in the example above).\n\nSee the [KeystoneJS configuration documentation](http://keystonejs.com/docs/configuration) for details and examples of the available\nconfiguration options.\n\nTo understand how these settings are used, and how the Express application initialised, see `Keystone.prototype.start` in\n`/index.js`.\n\n\n### Database field types\n\nKeystone builds on the basic data types provided by mongo and allows you to easily add rich,\nfunctional fields to your application's models.\n\nYou get helper methods on your models for dealing with each field type easily (such as \nformatting a date or number, resizing an image, getting an array of the available options\nfor a select field, or using Google's Places API to improve addresses) as well as a beautiful,\nresponsive admin UI to edit your data with.\n\nSee the [KeystoneJS database documentation](http://keystonejs.com/docs/database) for details and examples of the various field types,\nas well as how to set up and use database models in your application.\n\nKeystone's field types include:\n\n*\t[Boolean](http://keystonejs.com/docs/database/#fieldtypes-boolean)\n*\t[Text](http://keystonejs.com/docs/database/#fieldtypes-text)\n*\t[Textarea](http://keystonejs.com/docs/database/#fieldtypes-textarea)\n*\t[Email](http://keystonejs.com/docs/database/#fieldtypes-email)\n*\t[Url](http://keystonejs.com/docs/database/#fieldtypes-url)\n*\t[Html](http://keystonejs.com/docs/database/#fieldtypes-html)\n*\t[Color](http://keystonejs.com/docs/database/#fieldtypes-color)\n*\t[Date](http://keystonejs.com/docs/database/#fieldtypes-date)\n*\t[Datetime](http://keystonejs.com/docs/database/#fieldtypes-datetime)\n*\t[Key](http://keystonejs.com/docs/database/#fieldtypes-key)\n*\t[Number](http://keystonejs.com/docs/database/#fieldtypes-number)\n*\t[Money](http://keystonejs.com/docs/database/#fieldtypes-money)\n*\t[Select](http://keystonejs.com/docs/database/#fieldtypes-select)\n*\t[Markdown](http://keystonejs.com/docs/database/#fieldtypes-markdown)\n*\t[Name](http://keystonejs.com/docs/database/#fieldtypes-name)\n*\t[Password](http://keystonejs.com/docs/database/#fieldtypes-password)\n*\t[Location](http://keystonejs.com/docs/database/#fieldtypes-location)\n*\t[CloudinaryImage](http://keystonejs.com/docs/database/#fieldtypes-cloudinaryimage)\n*\t[CloudinaryImages](http://keystonejs.com/docs/database/#fieldtypes-cloudinaryimages)\n*\t[LocalFile](http://keystonejs.com/docs/database/#fieldtypes-localfile)\n*\t[S3 File](http://keystonejs.com/docs/database/#fieldtypes-s3file)\n*\t[Embedly](http://keystonejs.com/docs/database/#fieldtypes-embedly)\n\nKeystone also has [Relationship fields](http://keystonejs.com/docs/database#relationships) for managing one-to-many and many-to-many\nrelationships between different models.\n\n\n### Running KeystoneJS in Production\n\nWhen you deploy your KeystoneJS app to production, be sure to set your `ENV` environment variable to `production`.\nYou can do this by setting `NODE_ENV=production` in your `.env` file, which gets handled by [dotenv](https://github.com/scottmotte/dotenv).\n\nSetting your environment enables certain features, including template caching, simpler error reporting and html minification, that are important in production but annoying in development.\n\n\n### Linking Keystone for Development and Testing\n\nIf you want to test or develop against the `master` branch of KeystoneJS (or against your own branch), rather than a published version on **npm**, you just need to check it out then use `npm link` to link it to your project. On Mac OS, this is done like this:\n\n*\tCheckout KeystoneJS locally, e.g. to `~/Development/KeystoneJS`\n*\tFrom the KeystoneJS directory, run `sudo npm link` (you will need to enter your system password)\n*\tFrom your project directory, e.g. `~/Development/MySite` (the one with your `package.json` file in it) run `npm link keystone`. This will create a link between `~/Development/MySite/node_modules/keystone` and `~/Development/KeystoneJS`.\n\nThen `require('keystone')` normally in your app - the development copy will be used. Note that running `npm update` will ignore new versions of keystone that have been published.\n\nTo go back to using a published version of KeystoneJS from npm, from your project directory, run `npm unlink keystone` then `npm install`.\n\n\n### Advanced Usage\n\nIt is also possible to integrate keystone into an existing express app, without using the `start` method. This assumes less about your app and provides a lot of flexibility.\n\nYou can provide a `mongoose` or `express` instance to Keystone's `connect` function before defining any lists. `connect` returns `this` so you can do this in the `require` call.\n\n`keystone.static(app)` adds Keystone's static route-handling middleware to the Express app. It's a good idea to do this after your application's other static assets, before any dynamic logic (e.g. cookie parsing, session authentication, body parsing, etc)\n\n`keystone.routes(app);` adds Keystone's dynamic routes to the Express app router. This can be done before or after your application's routes are defined, although if they come after, you can explicitly lock down or replace Keystone routes with your own (so be careful).\n\n### Mounting Keystone as a sub-app or creating a node module out of your Keystone project\n\nYou may also just want to mount Keystone as a sub-app within a larger express app, and still let Keystone run its full configuration and setup routine but not start its own http server (i.e. `embedded` mode). \n\n…Or you might also want to turn a Keystone project into a node module that can be embedded easily via `npm link` or `npm install`.\n\nThe following detailed example will cover both creating a node module as well as mounting the Keystone app as a sub-app within a larger Express based application. \n\nLet's say you have a solution broken out into a structure like so…\n\n```\n\t/client\n\t/content\n\t/server\n```\n\n...where `/client` is some super awesome large scale single page client app written in [AngularJS](https://angularjs.org/) or [Polymer](http://www.polymer-project.org/), `/server` is a whiz-bang back end powered by [StrongLoop](http://strongloop.com/mobile-application-development/loopback/) or something else based on Express that serves up the data and maybe the built version of `/client`, and finally `/content` is a Keystone app that you want to use just for the awesome CMS modeling, querying, and automatic admin interface. In other words, you think Keystone is great at the content related data management and email stuff but don't really love its front end stuff (other than the admin app).\n\nIn this example, all three projects are their own node apps with their own `package.json` files. The `/content` app in this example might be the result of you using [Keystone's yeoman generator](https://github.com/JedWatson/generator-keystone) and then ripping out most of the stuff from `/routes` and `/templates` and just using `/models` and `/updates` and the email stuff.\n\nYou then want to integrate the `/content` app as a linked module inside of `/server` and mount it as a sub-app at the path `/content`.\n\n**Your `/content/keystone.js` file would look something like this: **\n\n```\n// Simulate config options from your production environment by\n// customising the .env file in your project's root folder.\nrequire('dotenv')().load();\n\n// Require keystone\nvar keystone = require('keystone');\n\n// Initialise Keystone with your project's configuration.\n// See http://keystonejs.com/guide/config for available options\n// and documentation.\n\nkeystone.init({\n\t\n\t'name': 'Your App Name',\n\t'brand': 'Your App Name',\n\t\n\t'emails': 'templates/emails',\n\t\n\t'auto update': true,\n\t\n\t'session': true,\n\t'auth': true,\n\t'user model': 'User',\n\t'cookie secret': 'your cookie secret'\n\t\n});\n\n// Load your project's Models\n\nkeystone.import('models');\n\n// Setup common locals for your emails. The following are required by Keystone's\n// default email templates, you may remove them if you're using your own.\n\nkeystone.set('email locals', {\n\tlogo_src: '/images/logo-email.gif',\n\tlogo_width: 194,\n\tlogo_height: 76,\n\ttheme: {\n\t\temail_bg: '#f9f9f9',\n\t\tlink_color: '#2697de',\n\t\tbuttons: {\n\t\t\tcolor: '#fff',\n\t\t\tbackground_color: '#2697de',\n\t\t\tborder_color: '#1a7cb7'\n\t\t}\n\t}\n});\n\n// Setup replacement rules for emails, to automate the handling of differences\n// between development a production.\n\n// Be sure to update this rule to include your site's actual domain, and add\n// other rules your email templates require.\n\nkeystone.set('email rules', [{\n\tfind: '/images/',\n\treplace: (keystone.get('env') == 'production') ? 'http://www.your-server.com/images/' : 'http://localhost:3000/images/'\n}, {\n\tfind: '/keystone/',\n\treplace: (keystone.get('env') == 'production') ? 'http://www.your-server.com/keystone/' : 'http://localhost:3000/keystone/'\n}]);\n\n// Load your project's email test routes\n\nkeystone.set('email tests', require('./routes/emails'));\n\n// Configure the navigation bar in Keystone's Admin UI\n\nkeystone.set('nav', {\n\t'posts': ['posts', 'post-categories'],\n\t'galleries': 'galleries',\n\t'enquiries': 'enquiries',\n\t'users': 'users'\n});\n\nmodule.exports = keystone;\n\n```\n\nNotice the last line. Instead of starting the keystone server via `keystone.start()` you simply export the keystone object. This will allow you to easily embed this module in another application. \n\nYou may also want to make an `app.js` file at the same level as `keystone.js` the does nothing more than require this exported object and starts the server. This is useful if you still want to hack on your models and test them in an isolated manner.\n\n**`app.js`:**\n\n```\nvar keystone = require('./keystone');\n\nkeystone.start();\n```\nThe last piece of the setup for your embeddable Keystone project is to slightly modify the `package.json` file to include a `main` value. This is needed for the next step to work.\n\n**`package.json`:**\n\n```\n{\n  \"name\": \"your-app-content\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"keystone\": \"~0.2.6\",\n    \"async\": \"~0.2.9\",\n    \"underscore\": \"~1.5.2\",\n    \"dotenv\": \"0.0.3\"\n  },\n  \"engines\": {\n    \"node\": \">=0.10.22\",\n    \"npm\": \">=1.3.14\"\n  },\n  \"main\": \"keystone.js\",\n  \"scripts\": {\n    \"start\": \"app.js\"\n  }\n}\n\n```\n\nNow to embed the Keystone project into your `/server` app as a node_module during development, just run `npm link` from within the `/content` project's root folder, followed by `npm link your-app-content` in the `/server` app's root folder (note: when doing the second `npm link`, replace `your-app-content` with the actual name of your `/content` app within its `package.json` file).\n\nThe next step for all this to work is to use `keystone.mount` in the server app. \n\n**Example `app.js` in `/server`:**\n\n```\nvar express = require('express'),\n\tapp = express();\n\t\napp.keystone = require('your-app-content');\n\n//...do your normal express setup stuff, add middleware and routes (but not static content or error handling middleware yet)\n\napp.keystone.mount('/content', app, function() {\n\t//put your app's static content and error handling middleware here and start your server\n});\n```\nAssuming you are using port `3000` to run the above example, you could then open a browser to `http://localhost:3000/content/keystone` to access your Keystone admin interface (hosted from your own higher level application).\n\nPutting a reference to the keystone object directly on your app like we did above means you can now use all the powerful querying tools from your Keystone models in your app, perhaps behind some ridiculously secure ACL managed routes or something else fun like that.\n\nAnd finally, if you _are_ using `dotenv` in your Keystone project to store your config in a `.env` file, you will also need to create a `.env` file at the root level of the `/server` project.\n\nNow you have a fully functioning embeddable KeystoneJS module and you can achieve good separation of concerns between the development and testing of the back-end, the front-end, and the content.\n\n\n\n## Thanks\n\nKeystoneJS is a free and open source community-driven project. Thanks to our many [contributors](https://github.com/JedWatson/keystone/graphs/contributors) and [users](https://github.com/JedWatson/keystone/stargazers) for making it great.\n\nThanks to the following companies and projects whose work we have used or taken inspiration from in the making of KeystoneJS:\n\n* [Node.js](http://nodejs.org)\n* [Thinkmill](http://thinkmill.com.au)\n* [ExpressJS](http://expressjs.com)\n* [MongoDB](http://www.mongodb.org)\n* [Mongoose](http://mongoosejs.com)\n* [jQuery](http://jquery.com)\n* [Underscore](http://underscorejs.org)\n* [Bootstrap](http://getbootstrap.com)\n* [Amazon](http://aws.amazon.com)\n* [Heroku](http://www.heroku.com)\n* [Google](https://developers.google.com)\n* [Cloudinary](https://cloudinary.com)\n* [Embedly](http://embed.ly)\n* [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/)\n\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 Jed Watson\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"matt.dahl","email":"matt.dahl.2013@gmail.com"}],"time":{"modified":"2022-06-12T14:07:44.611Z","created":"2014-09-29T00:57:21.421Z","0.0.1":"2014-09-29T00:57:21.421Z","0.0.2":"2014-09-29T01:01:15.588Z","0.0.3":"2014-09-29T01:37:06.157Z","0.0.4":"2014-10-16T05:57:28.363Z","0.0.5":"2014-10-16T06:47:30.914Z"},"homepage":"https://github.com/47pages/keystone","keywords":["express","web","app","cms","admin","framework","mongoose","gui","forms"],"repository":{"type":"git","url":"https://github.com/47pages/keystone.git"},"author":{"name":"Matt Dahl"},"bugs":{"url":"https://github.com/47pages/keystone/issues"},"license":"MIT","readmeFilename":"README.md"}