Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVEMENT] add CMS #9

Closed
2 tasks done
wongprom opened this issue Aug 22, 2023 · 2 comments · Fixed by #36
Closed
2 tasks done

[IMPROVEMENT] add CMS #9

wongprom opened this issue Aug 22, 2023 · 2 comments · Fixed by #36
Assignees
Labels
feature New feature prio 1 Take this on first sanity v3

Comments

@wongprom
Copy link
Owner

wongprom commented Aug 22, 2023

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

  • Add CMS (Sanity)
  • Don't want to use hard-coded data for certifications

Helpful links

Success criteria

  • Pull all data about certificates from CMS
  • On live version. Be able to visit endpoint /admin for Sanity Studio
@wongprom wongprom added the ticket Improvement label Aug 22, 2023
@wongprom wongprom self-assigned this Aug 22, 2023
@wongprom wongprom added feature New feature prio 1 Take this on first and removed ticket Improvement labels Sep 11, 2023
@wongprom
Copy link
Owner Author

wongprom commented Sep 12, 2023

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)

  1. I $ cd .. out one step from nextjs project

  2. $ 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)
  3. $ sanity login

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

  5. $ 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.
  6. $ sanity login
    ❗️use same login type as you use when login to Sanity

    •  ewewfer
       Login type GitHub
      Login successful
  7. $ 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 🎉
    
  8. $ 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.

  9. $ cd sanity-for-testing-1

  10. $ 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 pushed a commit that referenced this issue Sep 13, 2023
Embed Sanity Studio to path /about/certificates/admin. Idea is after login we can add new certificates from Sanity Studio.
@wongprom
Copy link
Owner Author

Don't forget to add domain

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

wongprom pushed a commit that referenced this issue Sep 18, 2023
Create schema for Certificates. Fetch all certificate with groq. Display title,subtitle with JSX.
wongprom pushed a commit that referenced this issue Sep 18, 2023
wongprom pushed a commit that referenced this issue Sep 18, 2023
Add new content like post, category, auth. Create types for new content. Add visiontool plugin. Refactore some sanity client code.
wongprom pushed a commit that referenced this issue Sep 18, 2023
wongprom pushed a commit that referenced this issue Sep 18, 2023
 Create ClientSideLink client-side component to be used on server-side pages for optimization.
wongprom pushed a commit that referenced this issue Sep 18, 2023
 with slug and display id and title on page.
wongprom pushed a commit that referenced this issue Sep 18, 2023
wongprom pushed a commit that referenced this issue Sep 18, 2023
 to ClientSideLink.tsx. Idea is to render much as possible from server-side, thats why I created this component.
wongprom pushed a commit that referenced this issue Sep 19, 2023
wongprom pushed a commit that referenced this issue Sep 19, 2023
 and remove out-comment code.
wongprom pushed a commit that referenced this issue Sep 19, 2023
 author, category, post
@wongprom wongprom pinned this issue Sep 20, 2023
wongprom pushed a commit that referenced this issue Sep 20, 2023
 after pushing this branch. Cant access Studio, black screen. Change useCdn to true froom false.
wongprom pushed a commit that referenced this issue Sep 20, 2023
wongprom pushed a commit that referenced this issue Sep 20, 2023
 from next-sanity 5.4.6 to 5.5.4, sanity 3.16.4 to 3.16.7.
wongprom pushed a commit that referenced this issue Sep 21, 2023
wongprom pushed a commit that referenced this issue Sep 25, 2023
wongprom pushed a commit that referenced this issue Sep 25, 2023
packages in package.json. Remove experimental appdir in next.conf file.
wongprom pushed a commit that referenced this issue Sep 25, 2023
wongprom pushed a commit that referenced this issue Sep 27, 2023
 Create a back arrow for every certificate visited so it is possible to go back to prew page.
@wongprom wongprom mentioned this issue Sep 27, 2023
4 tasks
@wongprom wongprom linked a pull request Sep 27, 2023 that will close this issue
4 tasks
@wongprom wongprom unpinned this issue Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature prio 1 Take this on first sanity v3
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant