wongprom / test-next-13

"My coding project, akin to a 'baby' that continually evolves, will never reach a final stage as I consistently incorporate fascinating new technologies."
https://www.jimmybackstrom.com/
3 stars 0 forks source link

[IMPROVEMENT] add CMS #9

Closed wongprom closed 11 months ago

wongprom commented 1 year ago

Is your feature request related to a problem? Please describe.

Helpful links

Success criteria

wongprom commented 1 year ago

What I had to do before adding Sanity v3 to this existing next 13 project

Node

  1. Changed node version v14.16.1 => to at least v16.20.2

    Where to create Sanity Studio?

    ⚠️ Not in the frontend folder (we will embed Sanity Studio in our nextjs)

  2. I $ cd .. out one step from nextjs project
  3. $ npm create sanity@latest

    •  Need to install the following packages:
       create-sanity@3.16.4
       Ok to proceed? (y) y
    •   Error: Failed to communicate with the Sanity API:
        Unauthorized - Session not found. You may need to login again with sanity login.
      
        For more information, see https://docs.sanity.io/help/cli-errors.
        at getOrCreateProject (~/.npm/_npx/64b24/node_modules/@sanity/cli/lib/_chunks/cli- 
        129.js:111:11)
        at async initSanity (~/.npm/_npx/789/node_modules/@sanity/cli/lib/_chunks/cli- 
        119.js:18411:415)
  4. $ sanity login

    •   zsh: command not found: sanity
  5. $ npm install --global sanity@latest

  6. $ npm create sanity@latest

    •  Error: Failed to communicate with the Sanity API:
       Unauthorized - Session not found. You may need to login again with sanity login.
  7. $ sanity login ❗️use same login type as you use when login to Sanity
    •  ewewfer
       Login type GitHub

      Login successful

  8. $ npm create sanity@latest
    • 
       Fetching existing projects
       ? Select project to use Create new project
       ? Your project name: Sanity For testing-1
       ? Use the default dataset configuration? Yes
       ✅ Creating dataset
       ? Project output path: /..../react/next/sanity-for-testing-1
       ? Select project template Clean project with no predefined schemas
       ? Do you want to use TypeScript? Yes
       ✅ Bootstrapping files from template
       ✅ Resolving latest module versions
       ✅ Creating default project files
       ? Package manager to use for installing dependencies? npm
      Success 🎉
  9. $ ls

    • campout connect-next-with-gql git-test
      hulu-2 testing-1 sanity-for-testing-1

      testing-1 is the name of my nextjs project. sanity-for-testing-1 is the Sanity Studio folder.

  10. $ cd sanity-for-testing-1

  11. $ npm run dev

    •   Checking configuration files...
        ✅ Sanity Studio using vite@4.4.9 ready in 1567ms and running at http://localhost:3333/  

      Skärmavbild 2023-09-12 kl  17 53 49

DONE 🎉

wongprom commented 1 year ago

Don't forget to add domain

Skärmavbild 2023-09-13 kl  12 23 36