Home

Awesome

<div align="center"> <h1>⚠️ Maintenance Mode</h1> <p>Keystone 5 has moved into maintenance mode!</p> <p>We recommend starting any new projects using <a href="https://keystonejs.com/" target="_blank">Keystone 6</a></p> <p>Information on upgrading an existing keystone 5 project to keystone 6 can be found <a href="https://github.com/keystonejs/keystone-5/discussions/categories/upgrading-to-keystone-6" target="_blank">here</a></p> <p>For more information please read our <a href="https://github.com/keystonejs/keystone-5/issues/21">Keystone 5 and beyond</a> post.</p> <br> </div> <br> <div align="center"> <img src="website/static/readme-header.png" width="557"> <h1>KeystoneJS</h1> <br> <p><b>A scalable platform and CMS to build Node.js applications.</b></p> <p><code>schema => ({ GraphQL, AdminUI })</code></p> <br> <p>Keystone comes with first-class GraphQL support, a highly extensible architecture, and a wonderful Admin UI.</p> <sub>Looking for Keystone v4.x / Keystone Classic? Head over to <a href="https://github.com/keystonejs/keystone-classic"><code>keystone-classic</code></a>.</sub> <br> </div> <br>

CI slack Supported by Thinkmill

Contents

What's new?

Keystone 5 is a complete re-imagining of older versions It builds on the lessons we learned over the last 5 years of the KeystoneJS' history and focuses on the things we believe are the most powerful features for modern web and mobile applications.

This means less focus on hand-holding Node.js template-driven websites and more focus on flexible architecture, a powerful GraphQL API with deep authentication & access control features, an extensible Admin UI and plugins for rich field types, file and database adapters, and session management.

We believe it's a powerful backend for rich React / Vue / Angular applications, Gatsby and Next.js websites, Mobile applications and more. It also makes a great Headless CMS.

Getting Started

To get up and running with a basic project template, run the following commands.

yarn create keystone-5-app my-app
cd my-app
yarn start

For more details and system requirements, check out the 5 Minute Quick Start Guide.

Documentation

The Keystone 5 API documentation contains a reference for all KeystoneJS packages.

For walk-throughs and discussions, see the Keystone 5 Guides documentation.

Version control

We do our best to follow SemVer version control within Keystone. This means package versions have 3 numbers. A change in the first number indicates a breaking change, the second number indicates backward compatible feature and the third number indicates a bug fix.

You can find changelogs either by browsing our repository, or by using our interactive changelog explorer.

A quick note on dependency management: Keystone is organised into a number of small packages within a monorepo. When packages in the same repository depend on each other, new versions might not be compatible with older versions. If two or more packages are updated, it can result in breaking changes, even though collectively they appear to be non-breaking.

We do our best to catch this but recommend updating Keystone packages together to avoid any potential conflict. This is especially important to be aware of if you use automated dependency management tools like Greenkeeper.

Contributing

This project follows the all-contributors specification.

Contributions of any kind are welcome!

You will find the set-up steps in this readme and full release processes and project guidelines in CONTRIBUTING.md.

Contributors

We'd like to start by thanking all our wonderful contributors: (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="http://www.thinkmill.com.au"><img src="https://avatars3.githubusercontent.com/u/872310?v=4" width="80px;" alt=""/><br /><sub><b>Jed Watson</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=JedWatson" title="Code">💻</a></td> <td align="center"><a href="http://jes.st/about"><img src="https://avatars1.githubusercontent.com/u/612020?v=4" width="80px;" alt=""/><br /><sub><b>Jess Telford</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=jesstelford" title="Code">💻</a></td> <td align="center"><a href="http://www.timl.id.au"><img src="https://avatars0.githubusercontent.com/u/616382?v=4" width="80px;" alt=""/><br /><sub><b>Tim Leslie</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=timleslie" title="Code">💻</a></td> <td align="center"><a href="https://hamil.town"><img src="https://avatars1.githubusercontent.com/u/11481355?v=4" width="80px;" alt=""/><br /><sub><b>Mitchell Hamilton</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=mitchellhamilton" title="Code">💻</a></td> <td align="center"><a href="https://twitter.com/JossMackison"><img src="https://avatars3.githubusercontent.com/u/2730833?v=4" width="80px;" alt=""/><br /><sub><b>Joss Mackison</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=jossmac" title="Code">💻</a></td> <td align="center"><a href="http://nathansimpson.design"><img src="https://avatars2.githubusercontent.com/u/12689383?v=4" width="80px;" alt=""/><br /><sub><b>Nathan Simpson</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=nathansimpsondesign" title="Code">💻</a></td> <td align="center"><a href="https://github.com/mikehazell"><img src="https://avatars0.githubusercontent.com/u/814227?v=4" width="80px;" alt=""/><br /><sub><b>Mike</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=mikehazell" title="Code">💻</a></td> </tr> <tr> <td align="center"><a href="https://github.com/molomby"><img src="https://avatars0.githubusercontent.com/u/2416367?v=4" width="80px;" alt=""/><br /><sub><b>John Molomby</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=molomby" title="Code">💻</a> <a href="https://github.com/keystonejs/keystone-5/issues?q=author%3Amolomby" title="Bug reports">🐛</a></td> <td align="center"><a href="https://dominik-wilkowski.com"><img src="https://avatars3.githubusercontent.com/u/1266923?v=4" width="80px;" alt=""/><br /><sub><b>Dominik Wilkowski</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=dominikwilkowski" title="Code">💻</a></td> <td align="center"><a href="https://github.com/Noviny"><img src="https://avatars1.githubusercontent.com/u/15622106?v=4" width="80px;" alt=""/><br /><sub><b>Ben Conolly</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=Noviny" title="Code">💻</a> <a href="#maintenance-Noviny" title="Maintenance">🚧</a> <a href="#tool-Noviny" title="Tools">🔧</a></td> <td align="center"><a href="https://github.com/jaredcrowe"><img src="https://avatars1.githubusercontent.com/u/4995433?v=4" width="80px;" alt=""/><br /><sub><b>Jared Crowe</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=jaredcrowe" title="Code">💻</a></td> <td align="center"><a href="https://www.linkedin.com/in/gautamsi"><img src="https://avatars2.githubusercontent.com/u/5769869?v=4" width="80px;" alt=""/><br /><sub><b>Gautam Singh</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=gautamsi" title="Code">💻</a></td> <td align="center"><a href="https://github.com/lukebatchelor"><img src="https://avatars2.githubusercontent.com/u/18694878?v=4" width="80px;" alt=""/><br /><sub><b>lukebatchelor</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=lukebatchelor" title="Code">💻</a></td> <td align="center"><a href="http://www.ticidesign.com"><img src="https://avatars2.githubusercontent.com/u/289889?v=4" width="80px;" alt=""/><br /><sub><b>Ticiana de Andrade</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=ticidesign" title="Code">💻</a></td> </tr> <tr> <td align="center"><a href="https://github.com/aghaabbasq"><img src="https://avatars2.githubusercontent.com/u/17919384?v=4" width="80px;" alt=""/><br /><sub><b>aghaabbasq</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=aghaabbasq" title="Code">💻</a></td> <td align="center"><a href="http://ajaymathur.github.io/"><img src="https://avatars1.githubusercontent.com/u/9667784?v=4" width="80px;" alt=""/><br /><sub><b>Ajay Narain Mathur</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=ajaymathur" title="Code">💻</a></td> <td align="center"><a href="https://github.com/mshavliuk"><img src="https://avatars0.githubusercontent.com/u/6589665?v=4" width="80px;" alt=""/><br /><sub><b>mshavliuk</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/issues?q=author%3Amshavliuk" title="Bug reports">🐛</a> <a href="https://github.com/keystonejs/keystone-5/commits?author=mshavliuk" title="Code">💻</a></td> <td align="center"><a href="http://www.wesbos.com"><img src="https://avatars2.githubusercontent.com/u/176013?v=4" width="80px;" alt=""/><br /><sub><b>Wes Bos</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=wesbos" title="Documentation">📖</a> <a href="#ideas-wesbos" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-wesbos" title="Maintenance">🚧</a></td> <td align="center"><a href="https://github.com/vlad-elagin"><img src="https://avatars1.githubusercontent.com/u/28232030?v=4" width="80px;" alt=""/><br /><sub><b>vlad-elagin</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=vlad-elagin" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/Olya-Yer"><img src="https://avatars3.githubusercontent.com/u/33322677?v=4" width="80px;" alt=""/><br /><sub><b>Olya-Yer </b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/issues?q=author%3AOlya-Yer" title="Bug reports">🐛</a></td> <td align="center"><a href="https://github.com/1337cookie"><img src="https://avatars2.githubusercontent.com/u/15826769?v=4" width="80px;" alt=""/><br /><sub><b>1337cookie</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=1337cookie" title="Documentation">📖</a></td> </tr> <tr> <td align="center"><a href="http://madebymike.com.au"><img src="https://avatars0.githubusercontent.com/u/1320567?v=4" width="80px;" alt=""/><br /><sub><b>Mike</b></sub></a><br /><a href="#ideas-MadeByMike" title="Ideas, Planning, & Feedback">🤔</a> <a href="#projectManagement-MadeByMike" title="Project Management">📆</a> <a href="https://github.com/keystonejs/keystone-5/pulls?q=is%3Apr+reviewed-by%3AMadeByMike" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/keystonejs/keystone-5/commits?author=MadeByMike" title="Code">💻</a></td> <td align="center"><a href="https://jordanoverbye.com"><img src="https://avatars0.githubusercontent.com/u/6265154?v=4" width="80px;" alt=""/><br /><sub><b>Jordan Overbye</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=jordanoverbye" title="Code">💻</a> <a href="https://github.com/keystonejs/keystone-5/commits?author=jordanoverbye" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/prvit"><img src="https://avatars1.githubusercontent.com/u/2816799?v=4" width="80px;" alt=""/><br /><sub><b>prvit</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=prvit" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/kennedybaird"><img src="https://avatars1.githubusercontent.com/u/20593811?v=4" width="80px;" alt=""/><br /><sub><b>Kennedy Baird</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=kennedybaird" title="Documentation">📖</a></td> <td align="center"><a href="http://thiagodebastos.com"><img src="https://avatars0.githubusercontent.com/u/6151341?v=4" width="80px;" alt=""/><br /><sub><b>Thiago De Bastos</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=thiagodebastos" title="Documentation">📖</a></td> <td align="center"><a href="https://dcousens.com"><img src="https://avatars0.githubusercontent.com/u/413395?v=4" width="80px;" alt=""/><br /><sub><b>Daniel Cousens</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=dcousens" title="Documentation">📖</a></td> <td align="center"><a href="http://simonswiss.com"><img src="https://avatars1.githubusercontent.com/u/485747?v=4" width="80px;" alt=""/><br /><sub><b>Simon Vrachliotis</b></sub></a><br /><a href="#example-simonswiss" title="Examples">💡</a> <a href="#tutorial-simonswiss" title="Tutorials">✅</a> <a href="#video-simonswiss" title="Videos">📹</a></td> </tr> <tr> <td align="center"><a href="https://github.com/Vultraz"><img src="https://avatars0.githubusercontent.com/u/3558659?v=4" width="80px;" alt=""/><br /><sub><b>Charles Dang</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=Vultraz" title="Code">💻</a> <a href="https://github.com/keystonejs/keystone-5/commits?author=Vultraz" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/dzigg"><img src="https://avatars1.githubusercontent.com/u/4436922?v=4" width="80px;" alt=""/><br /><sub><b>dzigg</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=dzigg" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/cmosgh"><img src="https://avatars0.githubusercontent.com/u/911925?v=4" width="80px;" alt=""/><br /><sub><b>Cristian Mos</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=cmosgh" title="Documentation">📖</a></td> <td align="center"><a href="https://arnaud-zg.github.io/"><img src="https://avatars1.githubusercontent.com/u/10991546?v=4" width="80px;" alt=""/><br /><sub><b>Arnaud Zheng</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=arnaud-zg" title="Documentation">📖</a></td> <td align="center"><a href="https://twitter.com/ashinzekene"><img src="https://avatars2.githubusercontent.com/u/20991583?v=4" width="80px;" alt=""/><br /><sub><b>Ashinze Ekene</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=ashinzekene" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/Fabyao"><img src="https://avatars3.githubusercontent.com/u/5112982?v=4" width="80px;" alt=""/><br /><sub><b>Fabyao</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=Fabyao" title="Documentation">📖</a></td> <td align="center"><a href="https://marcosrjjunior.github.io"><img src="https://avatars1.githubusercontent.com/u/5287262?v=4" width="80px;" alt=""/><br /><sub><b>Marcos RJJunior</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=marcosrjjunior" title="Code">💻</a></td> </tr> <tr> <td align="center"><a href="https://ginkgoch.com"><img src="https://avatars1.githubusercontent.com/u/41072618?v=4" width="80px;" alt=""/><br /><sub><b>Ginkgoch</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=ginkgoch" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/MaisaMilena"><img src="https://avatars2.githubusercontent.com/u/28612369?v=4" width="80px;" alt=""/><br /><sub><b>MaisaMilena</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=MaisaMilena" title="Documentation">📖</a></td> <td align="center"><a href="http://www.marxvn.com"><img src="https://avatars2.githubusercontent.com/u/4975208?v=4" width="80px;" alt=""/><br /><sub><b>Martin Pham</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/issues?q=author%3Amarxvn" title="Bug reports">🐛</a></td> <td align="center"><a href="https://github.com/justintemps"><img src="https://avatars3.githubusercontent.com/u/12401179?v=4" width="80px;" alt=""/><br /><sub><b>Justin Smith</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=justintemps" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/gabipetrovay"><img src="https://avatars0.githubusercontent.com/u/1170398?v=4" width="80px;" alt=""/><br /><sub><b>Gabriel Petrovay</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=gabipetrovay" title="Code">💻</a> <a href="https://github.com/keystonejs/keystone-5/commits?author=gabipetrovay" title="Documentation">📖</a></td> <td align="center"><a href="https://atticus.dev"><img src="https://avatars1.githubusercontent.com/u/9361948?v=4" width="80px;" alt=""/><br /><sub><b>Liam Clarke</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=LiamAttClarke" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/wbarcovsky"><img src="https://avatars2.githubusercontent.com/u/5498761?v=4" width="80px;" alt=""/><br /><sub><b>Vladimir Barcovsky</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=wbarcovsky" title="Code">💻</a></td> </tr> <tr> <td align="center"><a href="https://github.com/wcalebgray"><img src="https://avatars2.githubusercontent.com/u/11668534?v=4" width="80px;" alt=""/><br /><sub><b>Caleb Gray</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=wcalebgray" title="Code">💻</a> <a href="https://github.com/keystonejs/keystone-5/commits?author=wcalebgray" title="Tests">⚠️</a></td> <td align="center"><a href="http://hackweb.altervista.org"><img src="https://avatars0.githubusercontent.com/u/754139?v=4" width="80px;" alt=""/><br /><sub><b>frank10gm</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=frank10gm" title="Code">💻</a></td> <td align="center"><a href="https://github.com/mbrodt"><img src="https://avatars2.githubusercontent.com/u/21239560?v=4" width="80px;" alt=""/><br /><sub><b>mbrodt</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=mbrodt" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/zamkevich"><img src="https://avatars0.githubusercontent.com/u/13717428?v=4" width="80px;" alt=""/><br /><sub><b>Misha Zamkevich</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=zamkevich" title="Code">💻</a></td> <td align="center"><a href="https://github.com/matheuschimelli"><img src="https://avatars0.githubusercontent.com/u/10470074?v=4" width="80px;" alt=""/><br /><sub><b>Matheus Chimelli</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=matheuschimelli" title="Documentation">📖</a></td> <td align="center"><a href="https://github.com/gpersable"><img src="https://avatars3.githubusercontent.com/u/48637618?v=4" width="80px;" alt=""/><br /><sub><b>Gita Permatasari Sujatmiko</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=gpersable" title="Documentation">📖</a></td> <td align="center"><a href="http://elevated.to"><img src="https://avatars2.githubusercontent.com/u/203895?v=4" width="80px;" alt=""/><br /><sub><b>Andreas Borg</b></sub></a><br /><a href="https://github.com/keystonejs/keystone-5/commits?author=borg" title="Documentation">📖</a></td> </tr> </table> <!-- markdownlint-enable --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

Demo Projects

These projects are designed to show off different aspects of KeystoneJS features at a range of complexities (from a simple Todo App to a complex Meetup Site).

See the examples/README.md docs to get started.

Development Practices

All source code should be formatted with Prettier. Code is not automatically formatted in commit hooks to avoid unexpected behaviour, so we recommended using an editor plugin to format your code as you work. You can also run yarn format to prettier all the things. The lint script will validate source code with both ESLint and prettier.

Setup

Keystone 5 is set up as a monorepo, using Yarn Workspaces. Make sure to install Yarn if you haven't already.

First, clone the Keystone 5 repository

git clone https://github.com/keystonejs/keystone-5.git

Also make sure you have a local MongoDB server running (instructions).

Then install the dependencies and start the test project:

yarn
yarn dev

See examples/README.md for more details on the available demo projects.

Note For Windows Users

While running yarn on Windows, the process may fail with an error such as this:

Error: EPERM: operation not permitted, symlink 'C:\Users\user\Documents\keystone\packages\arch\packages\alert\src\index.js' -> 'C:\Users\user\Documents\keystone\packages\arch\packages\alert\dist\alert.cjs.js.flow'

This is due to permission restrictions regarding the creation of symbolic links. To solve this, you should enable Windows' Developer Mode and run yarn again.

Testing

Keystone uses Jest for unit tests and Cypress for end-to-end tests. All tests can be run locally and on GitHub.

Unit Tests

To run the unit tests, run the script:

yarn jest

Unit tests for each package can be found in packages/<package>/tests and following the naming pattern <module>.test.js. To see test coverage of the files touched by the unit tests, run:

yarn jest --coverage

To see test coverage of the entire monorepo, including files which have zero test coverage, use the special script:

yarn coverage

End-to-End Tests

Keystone tests end-to-end functionality with the help of Cypress. Each project (ie; tests/test-projects/basic, tests/test-projects/login, etc) have their own set of Cypress tests. To run an individual project's tests, cd into that directory and run:

yarn cypress:run

Cypress can be run in interactive mode from project directories with its built in GUI, which is useful when developing and debugging tests:

cd tests/test-projects/basic && yarn cypress:open

End-to-end tests live in project/**/cypress/integration/*spec.js. It is possible to run all cypress tests at once from the monorepo root with the command:

yarn cypress:run

NOTE: The output from this command will mix together the output from each project being tested in parallel. This is only recommended as sanity check before pushing code.

Code of Conduct

KeystoneJS adheres to the Contributor Covenant Code of Conduct.

License

Copyright (c) 2019 Jed Watson. Licensed under the MIT License.