Skip to content

Commit

Permalink
chore: initial setup sanity
Browse files Browse the repository at this point in the history
initial setup sanity

ISSUES CLOSED: #4591
  • Loading branch information
kristianulv23 committed Feb 24, 2025
1 parent 3e89981 commit 14846e0
Show file tree
Hide file tree
Showing 7 changed files with 30,246 additions and 20,238 deletions.
3 changes: 3 additions & 0 deletions ny-portal/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
DATABASE_URI=postgresql://localhost/jokul-portal
PAYLOAD_SECRET=YOUR_SECRET_HERE
SANITY_STUDIO_PROJECT_ID=<project_id>
SANITY_STUDIO_DATASET=<dataset>
SANITY_API_READ_TOKEN=<api_read_token>
7 changes: 5 additions & 2 deletions ny-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"type": "module",
"scripts": {
"build": "cross-env NODE_OPTIONS=--no-deprecation next build",
"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev",
"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev -p 3333",
"devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev",
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap",
"generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types",
"lint": "cross-env NODE_OPTIONS=--no-deprecation next lint",
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
"start": "cross-env NODE_OPTIONS=--no-deprecation next start -p 3333"
},
"dependencies": {
"@aws-sdk/client-sts": "^3.731.1",
Expand All @@ -25,15 +25,18 @@
"@payloadcms/next": "latest",
"@payloadcms/richtext-lexical": "latest",
"@payloadcms/ui": "latest",
"@sanity/vision": "^3.76.3",
"@types/mdx": "^2.0.13",
"clsx": "^2.1.1",
"cross-env": "^7.0.3",
"graphql": "^16.8.1",
"next": "15.1.0",
"next-sanity": "^9.8.59",
"payload": "latest",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-live": "^4.1.8",
"sanity": "^3.76.3",
"sharp": "0.32.6"
},
"devDependencies": {
Expand Down
17 changes: 17 additions & 0 deletions ny-portal/sanity.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { visionTool } from "@sanity/vision";
import { defineConfig } from "sanity";
import { structureTool } from "sanity/structure";
import { schemaTypes } from "./sanity/schemas";

export default defineConfig({
name: "portal-sanity-studio",
basePath: "/studio",
title: "portal-sanity-studio",
projectId: process.env.NEXT_PUBLIC_SANITY_STUDIO_PROJECT_ID || "",
dataset: process.env.NEXT_PUBLIC_SANITY_STUDIO_DATASET || "test",
token: process.env.SANITY_API_READ_TOKEN || "",
plugins: [structureTool(), visionTool()],
schema: {
types: schemaTypes,
},
});
1 change: 1 addition & 0 deletions ny-portal/sanity/schemas/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const schemaTypes = [];
8 changes: 8 additions & 0 deletions ny-portal/src/app/studio/[[...index]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use client";

import { NextStudio } from "next-sanity/studio";
import config from "../../../../sanity.config";

export default function Studio() {
return <NextStudio config={config} />;
}
17 changes: 17 additions & 0 deletions ny-portal/src/app/studio/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const metadata = {
title: "Jøkul Portal Studio",
description:
"Velkommen til Jøkul Portal Studio. Her kan du redigere innholdet på Portalen.",
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
Loading

0 comments on commit 14846e0

Please sign in to comment.