-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc6c599
commit 6d846cf
Showing
3,802 changed files
with
655,145 additions
and
2,690,052 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# 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 | ||
|
||
# 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 | ||
|
||
DATABASE_URL="postgresql://" |
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,10 +1,10 @@ | ||
node_modules | ||
dist | ||
.wrangler | ||
.dev.vars | ||
|
||
# Change them to your taste: | ||
package-lock.json | ||
yarn.lock | ||
pnpm-lock.yaml | ||
node_modules | ||
dist | ||
.wrangler | ||
.dev.vars | ||
|
||
# Change them to your taste: | ||
package-lock.json | ||
yarn.lock | ||
pnpm-lock.yaml | ||
bun.lockb |
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,8 +1,8 @@ | ||
``` | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
``` | ||
npm run deploy | ||
``` | ||
``` | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
``` | ||
npm run deploy | ||
``` |
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,19 +1,19 @@ | ||
{ | ||
"scripts": { | ||
"dev": "wrangler dev src/index.ts", | ||
"deploy": "wrangler deploy --minify src/index.ts" | ||
}, | ||
"dependencies": { | ||
"@krishna7060/common": "^1.0.0", | ||
"@prisma/client": "^5.14.0", | ||
"@prisma/extension-accelerate": "^1.0.0", | ||
"hono": "^4.3.8", | ||
"prisma": "^5.14.0", | ||
"yarn": "^1.22.22" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^4.20240403.0", | ||
"@types/node": "^20.12.12", | ||
"wrangler": "^3.57.2" | ||
} | ||
} | ||
{ | ||
"scripts": { | ||
"dev": "wrangler dev src/index.ts", | ||
"deploy": "wrangler deploy --minify src/index.ts" | ||
}, | ||
"dependencies": { | ||
"@krishna7060/common": "^1.0.0", | ||
"@prisma/client": "^5.14.0", | ||
"@prisma/extension-accelerate": "^1.0.0", | ||
"hono": "^4.3.8", | ||
"prisma": "^5.14.0", | ||
"yarn": "^1.22.22" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^4.20240403.0", | ||
"@types/node": "^20.12.12", | ||
"wrangler": "^3.57.2" | ||
} | ||
} |
52 changes: 26 additions & 26 deletions
52
backend/prisma/migrations/20240522173045_first_model/migration.sql
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,26 +1,26 @@ | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" SERIAL NOT NULL, | ||
"name" TEXT, | ||
"username" TEXT NOT NULL, | ||
"password" TEXT NOT NULL, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Blog" ( | ||
"id" SERIAL NOT NULL, | ||
"authorId" INTEGER NOT NULL, | ||
"content" TEXT NOT NULL, | ||
"title" TEXT NOT NULL, | ||
"published" BOOLEAN NOT NULL DEFAULT false, | ||
|
||
CONSTRAINT "Blog_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Blog" ADD CONSTRAINT "Blog_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" SERIAL NOT NULL, | ||
"name" TEXT, | ||
"username" TEXT NOT NULL, | ||
"password" TEXT NOT NULL, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Blog" ( | ||
"id" SERIAL NOT NULL, | ||
"authorId" INTEGER NOT NULL, | ||
"content" TEXT NOT NULL, | ||
"title" TEXT NOT NULL, | ||
"published" BOOLEAN NOT NULL DEFAULT false, | ||
|
||
CONSTRAINT "Blog_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Blog" ADD CONSTRAINT "Blog_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
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,3 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
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,33 +1,33 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? | ||
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model User { | ||
id Int @id @default(autoincrement()) | ||
name String? | ||
username String @unique | ||
password String | ||
blog Blog[] | ||
} | ||
|
||
|
||
model Blog{ | ||
id Int @id @default(autoincrement()) | ||
authorId Int | ||
content String | ||
title String | ||
published Boolean @default(false) | ||
author User @relation(fields: [authorId], references: [id]) | ||
} | ||
|
||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? | ||
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model User { | ||
id Int @id @default(autoincrement()) | ||
name String? | ||
username String @unique | ||
password String | ||
blog Blog[] | ||
} | ||
|
||
|
||
model Blog{ | ||
id Int @id @default(autoincrement()) | ||
authorId Int | ||
content String | ||
title String | ||
published Boolean @default(false) | ||
author User @relation(fields: [authorId], references: [id]) | ||
} | ||
|
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,27 +1,27 @@ | ||
import { Hono } from 'hono' | ||
import userRouter from './routes/userRouter'; | ||
import { blogRouter } from './routes/blogRouter'; | ||
import { cors } from 'hono/cors'; | ||
|
||
|
||
// const prisma = new PrismaClient({ this should be initilize in each and evry route for | ||
// datasourceUrl: env.DATABASE_URL, | ||
// }).$extends(withAccelerate()) | ||
|
||
// <{ | ||
// Bindings: { defining the type | ||
// DATABASE_URL: string | ||
// } | ||
// }> | ||
|
||
const app = new Hono() | ||
app.use('/*', cors()) | ||
app.route("/api/v1/user", userRouter); | ||
app.route("/api/v1/blog", blogRouter); | ||
|
||
app.get('/', (c) => { | ||
|
||
return c.text('Hello Hono!') | ||
}) | ||
|
||
import { Hono } from 'hono' | ||
import userRouter from './routes/userRouter'; | ||
import { blogRouter } from './routes/blogRouter'; | ||
import { cors } from 'hono/cors'; | ||
|
||
|
||
// const prisma = new PrismaClient({ this should be initilize in each and evry route for | ||
// datasourceUrl: env.DATABASE_URL, | ||
// }).$extends(withAccelerate()) | ||
|
||
// <{ | ||
// Bindings: { defining the type | ||
// DATABASE_URL: string | ||
// } | ||
// }> | ||
|
||
const app = new Hono() | ||
app.use('/*', cors()) | ||
app.route("/api/v1/user", userRouter); | ||
app.route("/api/v1/blog", blogRouter); | ||
|
||
app.get('/', (c) => { | ||
|
||
return c.text('Hello Hono!') | ||
}) | ||
|
||
export default app |
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"lib": [ | ||
"ESNext" | ||
], | ||
"types": [ | ||
"@cloudflare/workers-types" | ||
], | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "hono/jsx" | ||
}, | ||
{ | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"lib": [ | ||
"ESNext" | ||
], | ||
"types": [ | ||
"@cloudflare/workers-types" | ||
], | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "hono/jsx" | ||
}, | ||
} |
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,24 +1,24 @@ | ||
name = "backend" | ||
compatibility_date = "2023-12-01" | ||
|
||
[vars] | ||
# MY_VAR = "my-variable" | ||
DATABASE_URL="prisma://accelerate.prisma-data.net/" | ||
JWT_SECRET="" | ||
|
||
|
||
# [[kv_namespaces]] | ||
# binding = "MY_KV_NAMESPACE" | ||
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
|
||
# [[r2_buckets]] | ||
# binding = "MY_BUCKET" | ||
# bucket_name = "my-bucket" | ||
|
||
# [[d1_databases]] | ||
# binding = "DB" | ||
# database_name = "my-database" | ||
# database_id = "" | ||
|
||
# [ai] | ||
name = "backend" | ||
compatibility_date = "2023-12-01" | ||
|
||
[vars] | ||
# MY_VAR = "my-variable" | ||
DATABASE_URL="prisma://accelerate.prisma-data.net/" | ||
JWT_SECRET="" | ||
|
||
|
||
# [[kv_namespaces]] | ||
# binding = "MY_KV_NAMESPACE" | ||
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
|
||
# [[r2_buckets]] | ||
# binding = "MY_BUCKET" | ||
# bucket_name = "my-bucket" | ||
|
||
# [[d1_databases]] | ||
# binding = "DB" | ||
# database_name = "my-database" | ||
# database_id = "" | ||
|
||
# [ai] | ||
# binding = "AI" |
Oops, something went wrong.