❯ nvm install node Downloading and installing node v20.4.0... Downloading https://nodejs.org/dist/v20.4.0/node-v20.4.0-linux-x64.tar.xz... ######################################################################################################################################################### 100.0% Computing checksum with sha256sum Checksums matched! Now using node v20.4.0 (npm v9.7.2) Creating default alias: default -> node (-> v20.4.0)
❯ node --version v20.4.0
❯ npm --version 9.7.2
[ Keystone JS ]
npm을 이용해서 keystone-app을 생성할 수 있다.
나의 app 이름을 지어주면 기본적인 boilerplate를 생성해준다.
❯ mkdir keystone
❯ cd keystone
❯ npm init keystone-app@latest Need to install the following packages: create-keystone-app@9.0.1 Ok to proceed? (y)
✨ You're about to generate a project using Keystone 6 packages.
✔ What directory should create-keystone-app generate your app into? · my-app
⠋ Installing dependencies with yarn. This may take a few minutes. ⚠ Failed to install with yarn. ✔ Installed dependencies with npm.
🎉 Keystone created a starter project in: my-app
To launch your app, run:
- cd my-app - npm run dev
Next steps:
- Read my-app/README.md for additional getting started details. - Edit my-app/keystone.ts to customize your app. - Open the Admin UI - Open the Graphql API - Read the docs - Star Keystone on GitHub
❯ cd my-app/
❯ ls -al 합계 484 drwxrwxr-x 4 chani22 chani22 4096 7월 12 16:28 . drwxrwxr-x 3 chani22 chani22 4096 7월 12 16:26 .. -rw-rw-r-- 1 chani22 chani22 46 7월 12 16:26 .gitignore drwxr-xr-x 2 chani22 chani22 4096 7월 12 16:28 .keystone -rw-rw-r-- 1 chani22 chani22 2874 7월 12 16:26 README.md -rw-rw-r-- 1 chani22 chani22 2710 7월 12 16:26 auth.ts -rw-rw-r-- 1 chani22 chani22 1014 7월 12 16:26 keystone.ts drwxrwxr-x 570 chani22 chani22 20480 7월 12 16:28 node_modules -rw-rw-r-- 1 chani22 chani22 410056 7월 12 16:28 package-lock.json -rw-rw-r-- 1 chani22 chani22 397 7월 12 16:26 package.json -rw-rw-r-- 1 chani22 chani22 9506 7월 12 16:26 schema.graphql -rw-rw-r-- 1 chani22 chani22 1056 7월 12 16:26 schema.prisma -rw-rw-r-- 1 chani22 chani22 5178 7월 12 16:26 schema.ts -rw-rw-r-- 1 chani22 chani22 195 7월 12 16:26 tsconfig.json 3.8.16 chani22@chani22-VBox /srv/workspace/ks/my-app
❯ nano keystone.ts
❯ npm run dev
> keystone-app@1.0.2 dev > keystone dev
✨ Starting Keystone ⭐️ Server listening on :3000 (http://localhost:3000/) ⭐️ GraphQL API available at /api/graphql ✨ Generating GraphQL and Prisma schemas ✨ sqlite database "keystone.db" created at file:./keystone.db ✨ Your database is now in sync with your schema ✨ Connecting to the database ✨ Creating server ✅ GraphQL API ready ✨ Generating Admin UI code ✨ Preparing Admin UI app - warn You have enabled experimental feature (appDir) in next.config.js. - warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
- event compiled client and server successfully in 195 ms (18 modules) ✅ Admin UI ready - wait compiling /_error (client and server)... - event compiled client and server successfully in 6.5s (1706 modules)