diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..6e87a00
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,13 @@
+# Editor configuration, see http://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+max_line_length = off
+trim_trailing_whitespace = false
diff --git a/.env b/.env
index 48679b1..ae747a9 100644
--- a/.env
+++ b/.env
@@ -1,15 +1,25 @@
NEXT_PUBLIC_API_URL=https://otherway.dev.fergl.ie:3000
+QSTASH_CURRENT_SIGNING_KEY=khs3lpVBv1QtV/L9MTdXlcnoI8tTlg0aDfrFz+o8utA=
+DATABASE_URL="postgresql://postgres:hackme@localhost:5432/radio-otherway?schema=public"
#auth
NEXTAUTH_URL=https://otherway.dev.fergl.ie:3000
GOOGLE_CLIENT_ID=47147490249-adhc8cbko4nvigrfoodo17oa3qfsg4pd.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=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
-
#calendar api
GOOGLE_CALENDAR_PROJECT_ID=47147490249
-GOOGLE_CALENDAR_ID=geh501qel59lf3505v2huebo18@group.calendar.google.com
+LIVE_GOOGLE_CALENDAR_ID=geh501qel59lf3505v2huebo18@group.calendar.google.com
+GOOGLE_CALENDAR_ID=7732f7973f574db2638371394769a94aad5e38b98362d528cd985728d98cf3bd@group.calendar.google.com
+
GOOGLE_CALENDAR_API_KEY=AIzaSyAMvrSrwqvz9o4Y8b-0zneU-REWDIzuKR0
GOOGLE_CALENDAR_CREDENTIALS_PRIVATE_KEY_ID="d694fded9dca2e36e5974032d458c28edfd40852"
GOOGLE_CALENDAR_CREDENTIALS_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCaMVP3P+Do/KcZ\np/EH2cbj6bDb0weBcJzAyL8McrmZta8sSizQ63ui6CEcqrFhL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zSzVAusHCB2OSc1Y0aRtNmTLrMCmj8RxQZfj2s9NjWFFN0mLE9IQBQyrErh7d\nGSHlFuAnCFfxIi6Py57uQSKKPeuwO6XHMxpLiCtziMAMwYgu/oddqhjZxwKBgDi2\nzDmBLaIIz9MdtyQnOuWZF9sgI4QQ2osxEEf31eXfo+f4I57ibr4CACBg3rxsxzch\nWftuyV4elSPqlUupAfN7Ui7405kIqi0N9IG9md0c2RzVTAF+ytVNu8pliPlOP+SR\nT7GVcYmppBiLAMtZeM0L2g0yKUWna4cu48HVk0FxAoGBAKCSVvU2yAPKQlFZMjWZ\nf3lZVssPNf1/xSfvnsSqzURN7MzPlQRChZK7XgoAtKARep3vl8Uiti+OnPXCSf0P\nOvq6ckSGQxViVA3xlVTkYFA37CqCsCk5e3pAmv6nFcEnhbWMEIiK1+fEoVYpcMJB\ng8dJPLVOhoUcuGMYFE9KBp3K\n-----END PRIVATE KEY-----\n"
GOOGLE_CALENDAR_CREDENTIALS_CLIENT_EMAIL="otherway-calendar-proxy@radio-otherway.iam.gserviceaccount.com"
+
+# This was inserted by `prisma init`:
+# Environment variables declared in this file are automatically made available to Prisma.
+# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
+
+# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
+# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..b58b603
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,5 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..03d9549
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..f589ca3
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/web.iml b/.idea/web.iml
new file mode 100644
index 0000000..24643cc
--- /dev/null
+++ b/.idea/web.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/package.json b/package.json
index c1ae5e0..d049007 100644
--- a/package.json
+++ b/package.json
@@ -10,10 +10,13 @@
"lint": "next lint"
},
"dependencies": {
+ "@next-auth/prisma-adapter": "^1.0.5",
"@next/font": "13.1.5",
+ "@prisma/client": "^4.9.0",
"@types/node": "18.11.18",
"@types/react": "18.0.27",
"@types/react-dom": "18.0.10",
+ "@upstash/qstash": "^0.3.6",
"daisyui": "^2.49.0",
"eslint": "8.32.0",
"eslint-config-next": "13.1.5",
@@ -32,6 +35,7 @@
"postcss": "^8.4.21",
"prettier": "^2.8.3",
"prettier-plugin-tailwindcss": "^0.2.2",
+ "prisma": "^4.9.0",
"tailwindcss": "^3.2.4"
}
}
diff --git a/postcss.config.js b/postcss.config.js
index 33ad091..b4dfba6 100644
--- a/postcss.config.js
+++ b/postcss.config.js
@@ -1,6 +1,7 @@
module.exports = {
plugins: {
- tailwindcss: {},
+ tailwindcss: {
+ },
autoprefixer: {},
},
}
diff --git a/prisma/migrations/20230130203220_initial/migration.sql b/prisma/migrations/20230130203220_initial/migration.sql
new file mode 100644
index 0000000..7ae4196
--- /dev/null
+++ b/prisma/migrations/20230130203220_initial/migration.sql
@@ -0,0 +1,66 @@
+-- CreateTable
+CREATE TABLE "Account" (
+ "id" TEXT NOT NULL,
+ "userId" TEXT NOT NULL,
+ "type" TEXT NOT NULL,
+ "provider" TEXT NOT NULL,
+ "providerAccountId" TEXT NOT NULL,
+ "refresh_token" TEXT,
+ "access_token" TEXT,
+ "expires_at" INTEGER,
+ "token_type" TEXT,
+ "scope" TEXT,
+ "id_token" TEXT,
+ "session_state" TEXT,
+
+ CONSTRAINT "Account_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "Session" (
+ "id" TEXT NOT NULL,
+ "sessionToken" TEXT NOT NULL,
+ "userId" TEXT NOT NULL,
+ "expires" TIMESTAMP(3) NOT NULL,
+
+ CONSTRAINT "Session_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "User" (
+ "id" TEXT NOT NULL,
+ "name" TEXT,
+ "email" TEXT,
+ "emailVerified" TIMESTAMP(3),
+ "image" TEXT,
+
+ CONSTRAINT "User_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "VerificationToken" (
+ "identifier" TEXT NOT NULL,
+ "token" TEXT NOT NULL,
+ "expires" TIMESTAMP(3) NOT NULL
+);
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token");
+
+-- AddForeignKey
+ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml
new file mode 100644
index 0000000..fbffa92
--- /dev/null
+++ b/prisma/migrations/migration_lock.toml
@@ -0,0 +1,3 @@
+# Please do not edit this file manually
+# It should be added in your version-control system (i.e. Git)
+provider = "postgresql"
\ No newline at end of file
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
new file mode 100644
index 0000000..f68456f
--- /dev/null
+++ b/prisma/schema.prisma
@@ -0,0 +1,56 @@
+// This is your Prisma schema file,
+// learn more about it in the docs: https://pris.ly/d/prisma-schema
+
+generator client {
+ provider = "prisma-client-js"
+}
+
+datasource db {
+ provider = "postgresql"
+ url = env("DATABASE_URL")
+}
+
+model Account {
+ id String @id @default(cuid())
+ userId String
+ type String
+ provider String
+ providerAccountId String
+ refresh_token String? @db.Text
+ access_token String? @db.Text
+ expires_at Int?
+ token_type String?
+ scope String?
+ id_token String? @db.Text
+ session_state String?
+
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
+
+ @@unique([provider, providerAccountId])
+}
+
+model Session {
+ id String @id @default(cuid())
+ sessionToken String @unique
+ userId String
+ expires DateTime
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
+}
+
+model User {
+ id String @id @default(cuid())
+ name String?
+ email String? @unique
+ emailVerified DateTime?
+ image String?
+ accounts Account[]
+ sessions Session[]
+}
+
+model VerificationToken {
+ identifier String
+ token String @unique
+ expires DateTime
+
+ @@unique([identifier, token])
+}
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 7e1ca0d..f4350d6 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -18,7 +18,7 @@ export default function RootLayout({
-
+
{children}
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 8a8679e..0b1c3de 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -7,17 +7,21 @@ const getData = async () => {
export default async function Home() {
const results = await getData();
- return results.events.length === 0 ? (
-
- No upcoming events
-
+ return results.events.length === 0 && results.message ? (
+
+
+
+
{results.message}
+
+
+
) : (
Upcoming Shows
-
+
diff --git a/src/components/auth/LoginPage.tsx b/src/components/auth/LoginPage.tsx
index 066bdab..ebc93aa 100644
--- a/src/components/auth/LoginPage.tsx
+++ b/src/components/auth/LoginPage.tsx
@@ -1,15 +1,17 @@
"use client";
import React from "react";
-import { signIn } from "next-auth/react";
+import {signIn} from "next-auth/react";
+import {useRouter} from "next/navigation";
const LoginPage = () => {
+ const router = useRouter()
return (
Login
-
+
diff --git a/src/components/layout/NavBar.tsx b/src/components/layout/NavBar.tsx
index fbcd10c..133397b 100644
--- a/src/components/layout/NavBar.tsx
+++ b/src/components/layout/NavBar.tsx
@@ -1,11 +1,14 @@
"use client";
-import { signOut, useSession } from "next-auth/react";
+import {signOut, useSession} from "next-auth/react";
import React from "react";
-import { BiLogInCircle } from "react-icons/bi";
+import {BiLogInCircle} from "react-icons/bi";
+import Link from "next/link";
+
const Navbar = () => {
- const { data: session, status } = useSession();
+ const {data: session, status} = useSession();
return (
-
+