-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added example roles page * fixed types, added mdx * added another tutorial, added to navigation and added images * Added file structure * removed code from tutorials, added more tutorial words * added image * updated yarn lock file * Adjust eslint rule. * updated cover image * tweaked nav * updated adminui image * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * added password string to login * added a section to getting started and fixed heading overrides * removed other tutorial so this PR can be merged * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * moved tutorials to top of nav * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * fixed script confusion * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * removed installation guide Co-authored-by: Thomas Walker <bladey@me.com> Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
- Loading branch information
1 parent
eff1749
commit 8f17adc
Showing
10 changed files
with
235 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+60.2 KB
...ages/tutorials/getting-started-with-create-keystone-next-app/assets/adminui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions
67
.../pages/tutorials/getting-started-with-create-keystone-next-app/assets/cover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.9 KB
...torials/getting-started-with-create-keystone-next-app/assets/welcome-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions
137
docs-next/pages/tutorials/getting-started-with-create-keystone-next-app/index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
import { Markdown } from '../../../components/Page'; | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
|
||
<img | ||
src={require('./assets/cover.svg')} | ||
alt="A terminal with the output of create-keystone-next-app" | ||
style={{ | ||
margin: '0 -1rem 2rem -1rem', | ||
width: 'calc(100% + 2rem)', | ||
maxWidth: 'none', | ||
}} | ||
/> | ||
|
||
# Getting started with `create-keystone-next-app` | ||
|
||
[`create-keystone-next-app`](https://github.com/keystonejs/create-keystone-next-app) is a CLI app that makes it easier for you to get started with Keystone. | ||
It will generate a couple of files for you and install all the dependencies you need to run the Admin UI and start using the GraphQL API. | ||
|
||
## Quick Start | ||
|
||
```sh | ||
yarn create keystone-next-app | ||
cd my-app | ||
yarn dev | ||
``` | ||
|
||
## Installing your own Keystone instance | ||
|
||
Open your preferred shell and make sure you are in the folder you would like to create your new project in. | ||
`create-keystone-next-app` will generate a new folder with your new Keystone files in it. | ||
|
||
### Yarn | ||
|
||
Use [`yarn create`](https://classic.yarnpkg.com/en/docs/cli/create/): | ||
|
||
```sh | ||
cd your/path/ | ||
yarn create keystone-next-app | ||
``` | ||
|
||
### npm | ||
|
||
Use [`npm init`](https://docs.npmjs.com/cli/v7/commands/npm-init): | ||
|
||
```sh | ||
cd your/path/ | ||
npm init keystone-next-app | ||
``` | ||
|
||
_(`npm init <initializer>` is available in npm 6+)_ | ||
|
||
### npx | ||
|
||
Use npm's [`npx`](https://docs.npmjs.com/cli/v7/commands/npx): | ||
|
||
```sh | ||
cd your/path/ | ||
npx create-keystone-next-app | ||
``` | ||
|
||
_(npx comes with npm 5.2+)_ | ||
|
||
The CLI will ask you to name your new app and for a way to connect to your database. | ||
Make sure you have your connection URL ready for your database, e.g. `postgres://localhost/my-app` or `postgres://username:password@localhost/my-app`. | ||
|
||
_(If you run into trouble with the database, check out this guide on [Database Setup](https://www.keystonejs.com/quick-start/adapters))_ | ||
|
||
## Opening your shiny new Admin UI | ||
|
||
<Image | ||
src={require('./assets/adminui.png')} | ||
alt="The AdminUI of Keystone showing the two lists: User and Posts" | ||
width={1954} | ||
height={764} | ||
/> | ||
|
||
After running `create-keystone-next-app` you can now `cd` into the folder that was created for you and start Keystone. | ||
|
||
```sh | ||
cd my-app | ||
yarn dev | ||
``` | ||
|
||
This will generate the Admin UI pages via [Next.js](https://nextjs.org/) on [http://localhost:3000](http://localhost:3000). | ||
|
||
<Image | ||
src={require('./assets/welcome-screen.png')} | ||
alt="The welcome screen giving you the ability the create a new user to log into the AdminUI" | ||
width={1328} | ||
height={1020} | ||
/> | ||
|
||
When you visit the Admin UI for the first time you will be presented with a handy screen that asks you to create a user. | ||
Go ahead and create your first user. | ||
The email address and password will be used as the login details when you next need to login to the Admin UI. | ||
|
||
Once you've created the user you can see your new Keystone Admin UI that comes with two visible lists. | ||
You can use the Admin UI to explore and interact with the data in your system. | ||
|
||
## Output | ||
|
||
We now have some files in the newly generated folder. The two most important once you want to get into are `keystone.ts` and `schema.ts`. | ||
|
||
```sh | ||
. | ||
├── keystone.ts # The main entry file for Keystone | ||
├── node_modules # Your dependencies | ||
├── package.json # Your package.json with three scripts prepared for you | ||
├── schema.ts # The schema of your data | ||
├── tsconfig.json # Your typescript config | ||
└── yarn.lock # And finally your yarn lock file | ||
``` | ||
|
||
## Scripts | ||
|
||
The files come with three npm scripts you can run locally. | ||
|
||
`dev` | ||
|
||
- The `dev` script will run Keystone in development mode. | ||
Jump over to [http://localhost:3000](http://localhost:3000) to see your Admin UI. | ||
|
||
`build` | ||
|
||
- The `build` script will build the project and is required to be run before `start`. | ||
|
||
`start` | ||
|
||
- The `start` script will run Keystone in production mode. | ||
|
||
## Where to next? | ||
|
||
- Read more about the Keystone config inside `keystone.ts` over at [System Configuration API](/apis/config). | ||
- Read more about how you create a database schema for Keystone over at [Schema API](/apis/schema). | ||
|
||
export default ({ children }) => <Markdown>{children}</Markdown>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8f17adc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: