-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from davidemarcoli/feature/pwa
Feature/pwa
- Loading branch information
Showing
21 changed files
with
240 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,53 @@ | ||
import "./globals.css"; | ||
import { Analytics } from "@vercel/analytics/react"; | ||
import {Analytics} from "@vercel/analytics/react"; | ||
import Nav from "@/components/layout/nav"; | ||
import React from "react"; | ||
import { ThemeProvider } from "@/components/theme-provider"; | ||
import { inter, sfPro } from "@/app/fonts"; | ||
import { cx } from "class-variance-authority"; | ||
import { Toaster } from "@/components/ui/toaster"; | ||
import {ThemeProvider} from "@/components/theme-provider"; | ||
import {inter, sfPro} from "@/app/fonts"; | ||
import {cx} from "class-variance-authority"; | ||
import {Toaster} from "@/components/ui/toaster"; | ||
import {CommandMenu} from "@/components/command-menu"; | ||
import {Changelog} from "@/components/changelog"; | ||
|
||
export const metadata = { | ||
title: "NextQuiz", | ||
description: | ||
"NextQuiz is a quiz app built with Next.js, Prisma, and Tailwind CSS.", | ||
twitter: { | ||
card: "summary_large_image", | ||
title: "NextQuiz", | ||
description: | ||
"NextQuiz is a quiz app built with Next.js, Prisma, and Tailwind CSS.", | ||
creator: "@davide_marcoli", | ||
}, | ||
metadataBase: new URL("https://next-quiz.davidemarcoli.dev"), | ||
themeColor: "#000000", | ||
"NextQuiz is a quiz app built with Next.js, Prisma, and Tailwind CSS.", | ||
twitter: { | ||
card: "summary_large_image", | ||
title: "NextQuiz", | ||
description: | ||
"NextQuiz is a quiz app built with Next.js, Prisma, and Tailwind CSS.", | ||
creator: "@davide_marcoli", | ||
}, | ||
manifest: '/manifest.webmanifest', | ||
keywords: ['NextQuiz', 'Quiz', 'Davide Marcoli'], | ||
metadataBase: new URL("https://next-quiz.davidemarcoli.dev"), | ||
themeColor: "#000000", | ||
}; | ||
|
||
export default async function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<> | ||
<html lang="en"> | ||
<body className={cx(sfPro.variable, inter.variable)}> | ||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem> | ||
{/*<Suspense fallback="...">*/} | ||
{/* @ts-expect-error Server Component */} | ||
<Nav /> | ||
{/*</Suspense>*/} | ||
<main className={"mx-4 mt-16"}>{children}</main> | ||
<Toaster /> | ||
<Analytics /> | ||
<CommandMenu /> | ||
<Changelog /> | ||
</ThemeProvider> | ||
</body> | ||
</html> | ||
</> | ||
); | ||
return ( | ||
<> | ||
<html lang="en"> | ||
<body className={cx(sfPro.variable, inter.variable)}> | ||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem> | ||
{/*<Suspense fallback="...">*/} | ||
{/* @ts-expect-error Server Component */} | ||
<Nav/> | ||
{/*</Suspense>*/} | ||
<main className={"mx-4 mt-16"}>{children}</main> | ||
<Toaster/> | ||
<Analytics/> | ||
<CommandMenu/> | ||
<Changelog/> | ||
</ThemeProvider> | ||
</body> | ||
</html> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "mysql" | ||
url = env("DATABASE_URL") | ||
relationMode = "prisma" | ||
} | ||
|
||
model Account { | ||
id String @id @default(cuid()) | ||
userId String | ||
type String | ||
provider String | ||
providerAccountId String | ||
refresh_token String? @db.Text | ||
refresh_token_expires_in Int? | ||
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]) | ||
@@index([userId]) | ||
} | ||
|
||
model Session { | ||
id String @id @default(cuid()) | ||
sessionToken String @unique | ||
userId String | ||
expires DateTime | ||
user User @relation(fields: [userId], references: [id], onDelete: Cascade) | ||
@@index([userId]) | ||
} | ||
|
||
model User { | ||
id String @id @default(cuid()) | ||
name String? | ||
email String? @unique | ||
emailVerified DateTime? | ||
image String? | ||
accounts Account[] | ||
sessions Session[] | ||
quizzes Quiz[] | ||
Skill Skill[] | ||
LearnedWord LearnedWord[] | ||
} | ||
|
||
model VerificationToken { | ||
identifier String | ||
token String @unique | ||
expires DateTime | ||
@@unique([identifier, token]) | ||
} | ||
|
||
model QuizWord { | ||
id String @id @default(cuid()) | ||
term String | ||
definition String | ||
quiz Quiz @relation(fields: [quizId], references: [id], onDelete: Cascade) | ||
quizId String | ||
Skill Skill[] | ||
LearnedWord LearnedWord[] | ||
@@index([quizId]) | ||
} | ||
|
||
model Quiz { | ||
id String @id @default(cuid()) | ||
name String | ||
words QuizWord[] | ||
user User @relation(fields: [userId], references: [id], onDelete: Cascade) | ||
userId String | ||
@@index([userId]) | ||
} | ||
|
||
model Skill { | ||
id String @id @default(cuid()) | ||
user User @relation(fields: [userId], references: [id], onDelete: Cascade) | ||
userId String | ||
quizWord QuizWord @relation(fields: [quizWordId], references: [id], onDelete: Cascade) | ||
quizWordId String | ||
proficiency Int | ||
@@index([userId]) | ||
@@index([quizWordId]) | ||
} | ||
|
||
model LearnedWord { | ||
id String @id @default(cuid()) | ||
learned Boolean | ||
userId String | ||
quizWordId String | ||
user User @relation(fields: [userId], references: [id], onDelete: Cascade) | ||
quizWord QuizWord @relation(fields: [quizWordId], references: [id], onDelete: Cascade) | ||
@@index([userId, quizWordId]) | ||
@@index([quizWordId]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"theme_color": "#020817", | ||
"background_color": "#020817", | ||
"display": "standalone", | ||
"scope": "/", | ||
"start_url": "/", | ||
"name": "Next Quiz", | ||
"short_name": "Next Quiz", | ||
"description": "NextQuiz is a quiz app built with Next.js, Prisma, and Tailwind CSS.", | ||
"icons": [ | ||
{ | ||
"src": "/icons/icon-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/icons/icon-256x256.png", | ||
"sizes": "256x256", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/icons/icon-384x384.png", | ||
"sizes": "384x384", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/icons/icon-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
], | ||
"screenshots": [ | ||
{ | ||
"src": "/images/screenshot-narrow-quiz-list.png", | ||
"type": "image/png", | ||
"sizes": "388x813", | ||
"form_factor": "narrow" | ||
}, | ||
{ | ||
"src": "/images/screenshot-narrow-quiz.png", | ||
"type": "image/png", | ||
"sizes": "388x813", | ||
"form_factor": "narrow" | ||
}, | ||
{ | ||
"src": "/images/screenshot-narrow-cards.png", | ||
"type": "image/png", | ||
"sizes": "388x813", | ||
"form_factor": "narrow" | ||
}, | ||
{ | ||
"src": "/images/screenshot-wide-quiz-list.png", | ||
"type": "image/jpg", | ||
"sizes": "1918x993", | ||
"form_factor": "wide" | ||
}, | ||
{ | ||
"src": "/images/screenshot-wide-quiz.png", | ||
"type": "image/jpg", | ||
"sizes": "1918x993", | ||
"form_factor": "wide" | ||
}, | ||
{ | ||
"src": "/images/screenshot-wide-cards.png", | ||
"type": "image/jpg", | ||
"sizes": "1918x993", | ||
"form_factor": "wide" | ||
} | ||
] | ||
} |