Skip to content

Commit

Permalink
➕ - added svelte-sonner and setup prisma client
Browse files Browse the repository at this point in the history
  • Loading branch information
NaviTheCoderboi committed Mar 28, 2024
1 parent 3660cfd commit 2e747b3
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 25 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^8.56.0",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.56.0",
Expand All @@ -37,13 +38,17 @@
"type": "module",
"dependencies": {
"@internationalized/date": "^3.5.2",
"@neondatabase/serverless": "^0.9.0",
"@prisma/adapter-neon": "^5.11.0",
"@prisma/client": "5.11.0",
"autoprefixer": "^10.4.18",
"jsonwebtoken": "^9.0.2",
"lucide-svelte": "^0.359.0",
"postcss": "^8.4.35",
"svelte-ripple-action": "^1.0.6",
"sweetalert2": "^11.10.7",
"tailwindcss": "^3.4.1"
"tailwindcss": "^3.4.1",
"valibot": "^0.30.0",
"ws": "^8.16.0"
}
}
128 changes: 128 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 19 additions & 18 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,30 @@
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init

generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}


model User{
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
name String
email String @unique
DOB DateTime
languages Languages
avatarImg String?
model User {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
name String
email String @unique
DOB DateTime
languages Languages
avatarImg String?
followersId String[]
followers User[] @relation("Followers")
following User[] @relation("Followers")
gender Gender
OAuth Boolean
created DateTime @default(now())
updated DateTime @default(now())
followers User[] @relation("Followers")
following User[] @relation("Followers")
gender Gender
OAuth Boolean
created DateTime @default(now())
updated DateTime @default(now())
}

enum Gender {
Expand All @@ -36,7 +37,7 @@ enum Gender {
Other
}

enum Languages{
enum Languages {
JS
PYTHON
PHP
Expand Down
2 changes: 0 additions & 2 deletions src/lib/components/Boxbg.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<script lang="ts">
const rows = new Array(80).fill(1);
console.log(rows)
const cols = new Array(75).fill(1);
let initialColor = 'rgba(0,0,0,0)';
let colors = [
'--sky-300',
'--pink-300',
'--green-300',
'--yellow-300',
'--red-300',
'--purple-300',
Expand Down
13 changes: 13 additions & 0 deletions src/lib/utils/prisma.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { DATABASE_URL } from "$env/static/private";
import { Pool, neonConfig } from '@neondatabase/serverless';
import { PrismaNeon } from '@prisma/adapter-neon';
import { PrismaClient } from '@prisma/client';
import ws from 'ws';

neonConfig.webSocketConstructor = ws

const pool = new Pool({ connectionString: DATABASE_URL })
const adapter = new PrismaNeon(pool)
const prisma = new PrismaClient({ adapter })

export default prisma;
4 changes: 0 additions & 4 deletions src/routes/auth/signup/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
import PasswordField from '$components/ui/Field/PasswordField.svelte';
import SelectField from '$components/ui/Field/SelectField.svelte';
import TextField from '$components/ui/Field/TextField.svelte';
import { getUserRegion } from '$utils/calendar';
import { ripple } from 'svelte-ripple-action';
getUserRegion();
</script>

<main
Expand Down

0 comments on commit 2e747b3

Please sign in to comment.