This commit is contained in:
Ste Vaidis 2023-02-15 22:20:44 +02:00
parent f79b95ef2f
commit 938e319052
6 changed files with 1442 additions and 1 deletions

2
.env
View File

@ -5,4 +5,4 @@
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
# DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"
DATABASE_URL="postgresql://postgresql:1SGUSUt5FT7ZdHRb@db.qtvrwtoesbghwpblhnxn.superbase.co:6543/postgres"
DATABASE_URL="postgresql://postgres:WW1HcqPSjnFdhLWV@db.wcckzpwutuoohgjllale.supabase.co:5432/postgres"

View File

@ -34,3 +34,26 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
node -v: v18.14.0
"prisma": "^4.8.1"
"@prisma/client": "^4.8.1"
"next": "13.1.6"
"typescript": "4.9.5"
supabase.com
> New Project
- Name
- Password
> Settings
- Connection String
npm install prisma@4.8.2
npx prisma init
vi .env
DATABASE_URL="postgresql://postgres:WW1HcqPSjnFdhLWV@db.wcckzpwutuoohgjllale.supabase.co:5432/postgres"
vi schema.prisma
npx prisma db pull

39
package-lock.json generated
View File

@ -9,6 +9,7 @@
"version": "0.1.0",
"dependencies": {
"@next/font": "13.1.6",
"@prisma/client": "^4.8.1",
"@types/node": "18.13.0",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.10",
@ -264,12 +265,37 @@
"node": ">= 8"
}
},
"node_modules/@prisma/client": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.8.1.tgz",
"integrity": "sha512-d4xhZhETmeXK/yZ7K0KcVOzEfI5YKGGEr4F5SBV04/MU4ncN/HcE28sy3e4Yt8UFW0ZuImKFQJE+9rWt9WbGSQ==",
"hasInstallScript": true,
"dependencies": {
"@prisma/engines-version": "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe"
},
"engines": {
"node": ">=14.17"
},
"peerDependencies": {
"prisma": "*"
},
"peerDependenciesMeta": {
"prisma": {
"optional": true
}
}
},
"node_modules/@prisma/engines": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.8.1.tgz",
"integrity": "sha512-93tctjNXcIS+i/e552IO6tqw17sX8liivv8WX9lDMCpEEe3ci+nT9F+1oHtAafqruXLepKF80i/D20Mm+ESlOw==",
"hasInstallScript": true
},
"node_modules/@prisma/engines-version": {
"version": "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe.tgz",
"integrity": "sha512-MHSOSexomRMom8QN4t7bu87wPPD+pa+hW9+71JnVcF3DqyyO/ycCLhRL1we3EojRpZxKvuyGho2REQsMCvxcJw=="
},
"node_modules/@swc/helpers": {
"version": "0.4.14",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz",
@ -1533,11 +1559,24 @@
"fastq": "^1.6.0"
}
},
"@prisma/client": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.8.1.tgz",
"integrity": "sha512-d4xhZhETmeXK/yZ7K0KcVOzEfI5YKGGEr4F5SBV04/MU4ncN/HcE28sy3e4Yt8UFW0ZuImKFQJE+9rWt9WbGSQ==",
"requires": {
"@prisma/engines-version": "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe"
}
},
"@prisma/engines": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.8.1.tgz",
"integrity": "sha512-93tctjNXcIS+i/e552IO6tqw17sX8liivv8WX9lDMCpEEe3ci+nT9F+1oHtAafqruXLepKF80i/D20Mm+ESlOw=="
},
"@prisma/engines-version": {
"version": "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe.tgz",
"integrity": "sha512-MHSOSexomRMom8QN4t7bu87wPPD+pa+hW9+71JnVcF3DqyyO/ycCLhRL1we3EojRpZxKvuyGho2REQsMCvxcJw=="
},
"@swc/helpers": {
"version": "0.4.14",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz",

View File

@ -10,6 +10,7 @@
},
"dependencies": {
"@next/font": "13.1.6",
"@prisma/client": "^4.8.1",
"@types/node": "18.13.0",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.10",

1326
pages/api/seed.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,3 +9,55 @@ datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Restaurant {
id Int @id @default(autoincrement())
name String
main_image String
images String[]
description String
open_time String
close_time String
slug String @unique
price PRICE
items Item[]
location_id Int
location Location @relation(fields: [location_id], references: [id])
cuisine_id Int
cuisine Cuisine @relation(fields: [cuisine_id], references: [id])
created_at DateTime @default(now())
updated_at DateTime @updatedAt
}
model Item {
id Int @id @default(autoincrement())
name String
price String
description String
restaurant_id Int
restaurant Restaurant @relation(fields: [restaurant_id], references: [id])
created_at DateTime @default(now())
updated_at DateTime @updatedAt
}
model Location {
id Int @id @default(autoincrement())
name String
restaurants Restaurant[]
created_at DateTime @default(now())
updated_at DateTime @updatedAt
}
model Cuisine {
id Int @id @default(autoincrement())
name String
restaurants Restaurant[]
created_at DateTime @default(now())
updated_at DateTime @updatedAt
}
enum PRICE {
CHEAP
REGULAR
EXPENSIVE
}