Skip to content

Commit

Permalink
Remove cms-keystonejs-embedded and link to official docs (#62876)
Browse files Browse the repository at this point in the history
## What?

The example was severely outdated and couldn't `npm install`. This
ensures the latest example can always be used from the Keystone
documentation.


<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2709
  • Loading branch information
timneutkens committed Mar 5, 2024
1 parent c59b391 commit 96f88e0
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 336 deletions.
72 changes: 2 additions & 70 deletions examples/cms-keystonejs-embedded/README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,3 @@
# Embedded KeystoneJS Example
# Keystone Example

A Static Blog starter project powered by [KeystoneJS](https://keystonejs.com):

- Powerful Admin UI for creating & editing content in dev mode
- Statically built pages for fast production sites
- Client-side access to data via auto-generated GraphQL API

## Deploy on Vercel

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/cms-keystonejs-embedded&project-name=cms-keystonejs-embedded&repository-name=cms-keystonejs-embedded)

## How to use

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:

```bash
npx create-next-app --example cms-keystonejs-embedded cms-keystonejs-embedded
# or
yarn create next-app --example cms-keystonejs-embedded cms-keystonejs-embedded
```

Next, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the Next.js site, and [http://localhost:8000](http://localhost:8000) to see the KeystoneJS Admin UI.

Make changes in the KeystoneJS Admin UI, then reload the Next.js site to see what it looks like!

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

## KeystoneJS

[KeystoneJS](https://keystonejs.com) is the best headless content management system around, especially when you're using a component-based front-end like React and Vue. In addition to auto-generating a GraphQL API and providing a powerful Admin UI, KeystoneJS is backed by Prisma, so can work with a range of different databases.

This example uses a local SQLite database (a `.db` file) to store data. In development mode, the KeystoneJS Admin UI will save data to the local SQLite database file, and in production the KeystoneJS GraphQL & node APIs will read data from it.

NOTE: The local SQLite database must be deployed along with the rest of the code in this example. Usually this means committing it to source control. Due to this reason, it is not recommended to store any private data using this example repo.

For more details, see [How to embed Keystone + SQLite in a Next.js app](https://next.keystonejs.com/tutorials/embedded-mode-with-sqlite-nextjs)

## The code

The key files for this project

```
.
├─ app.db # The SQLite database. Commit this with your changes
├─ keystone.ts # Configure Keystone's data model & other options
└─ pages
  ├─ api
  │  └─ graphql.tsx # Access your data via a GraphQL API
  └─ post
   └─ [slug].tsx # Statically generate pages based on your data
```

## Learn More

To learn more about KeystoneJS, take a look at the following resources:

- [KeystoneJS Documentation](https://keystonejs.com) - learn about KeystoneJS features and API.
- [How to embed Keystone + SQLite in a Next.js app](https://next.keystonejs.com/tutorials/embedded-mode-with-sqlite-nextjs) - the tutorial which inspired this example

You can check out [the KeystoneJS GitHub repository](https://github.com/keystonejs/keystone) - your feedback and contributions are welcome!
The [official example](https://github.com/keystonejs/keystone/tree/main/examples/framework-nextjs-pages-directory) and [documentation](https://keystonejs.com/blog/nextjs-keystone) for using Keystone are available on [keystonejs.com](https://keystonejs.com/blog/nextjs-keystone).
19 changes: 0 additions & 19 deletions examples/cms-keystonejs-embedded/keystone.ts

This file was deleted.

3 changes: 0 additions & 3 deletions examples/cms-keystonejs-embedded/next.config.js

This file was deleted.

20 changes: 0 additions & 20 deletions examples/cms-keystonejs-embedded/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions examples/cms-keystonejs-embedded/pages/_app.tsx

This file was deleted.

1 change: 0 additions & 1 deletion examples/cms-keystonejs-embedded/pages/api/graphql.tsx

This file was deleted.

62 changes: 0 additions & 62 deletions examples/cms-keystonejs-embedded/pages/index.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions examples/cms-keystonejs-embedded/pages/post/[slug].tsx

This file was deleted.

Binary file removed examples/cms-keystonejs-embedded/public/favicon.ico
Binary file not shown.
94 changes: 0 additions & 94 deletions examples/cms-keystonejs-embedded/styles/Home.module.css

This file was deleted.

20 changes: 0 additions & 20 deletions examples/cms-keystonejs-embedded/styles/globals.css

This file was deleted.

0 comments on commit 96f88e0

Please sign in to comment.