This quick start guide will get you up and running in just a few minutes. Let's build a simple todo app with a fresh install of Keystone 5!
Before we start, check that your computer or server meets the following requirements:
And ONE of the following databases:
- MongoDB >= 4.x: MongoDB is a powerful NoSQL document storage database.
- Postgres >= 9.x: PostgreSQL is an open source relational database that uses the SQL language.
Finally, make sure your database is configured and running.
All set? Great, let's get started!
To create a new KeystoneJS application, run the following commands in your terminal:
npm init keystone-app my-app
or with yarn:
yarn create keystone-app my-app
You'll be prompted with a few questions:
- What is your project name? Pick any name for your project. You can change it later if you like.
- Select a starter project. Select the
Todoapplication if you wish to follow this guide.
- Select an adapter. We'll go more into database adapters later. For now, simply choose
Mongooseif you're running a MongoDB database and
Knexif you're running a Postgres one.
Wait a few minutes for all the project dependencies to install. Once that's finished, run this:
cd my-app npm run dev
You are now running your very own KeystoneJS application! Here's what you get out of the box:
Your app is up and running at the following URL:
Your application also has an Admin UI, which lets you directly manipulate the data in your database:
Both your application and the Admin UI are powered by a GraphQL API. KeystoneJS provides a web interface for this API at this URL:
This todo app is a good introduction to KeystoneJS, but chances are you'll want to build something a bit more complex and secure than that!