From cf12a164b3b71773fdc0d87b9b60bd63d8c4badc Mon Sep 17 00:00:00 2001 From: AdarshVMore Date: Sun, 7 Jun 2026 07:23:11 +0530 Subject: [PATCH] mking changes to run is locally and some schema updates --- Server/prisma/schema.prisma | 48 +++++++++++------------------------- client/src/lib/api/client.ts | 4 ++- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/Server/prisma/schema.prisma b/Server/prisma/schema.prisma index 80b9ae3..cfda725 100644 --- a/Server/prisma/schema.prisma +++ b/Server/prisma/schema.prisma @@ -1,8 +1,3 @@ -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema - -// Get a free hosted Postgres database in seconds: `npx create-db` - generator client { provider = "prisma-client" output = "../generated/prisma" @@ -18,21 +13,21 @@ model User { githubUsername String githubAvatar String? email String? - plan String @default("free") - repos Repository[] + plan String @default("free") createdAt DateTime @default(now()) + repos Repository[] } model Repository { - id String @id @default(cuid()) + id String @id @default(cuid()) owner String name String installationId Int userId String - user User @relation(fields: [userId], references: [id]) - reviews PRReview[] + createdAt DateTime @default(now()) deployments Deployment[] - createdAt DateTime @default(now()) + reviews PRReview[] + user User @relation(fields: [userId], references: [id]) @@unique([owner, name]) } @@ -42,64 +37,51 @@ model PRReview { prNumber Int prTitle String? summary String? + repositoryId String + createdAt DateTime @default(now()) score Int? author String - prAuthor String @default("") commitSHA String - repositoryId String + prAuthor String @default("") + issues Issue[] repository Repository @relation(fields: [repositoryId], references: [id]) - - issues Issue[] - - createdAt DateTime @default(now()) } model Issue { id String @id @default(cuid()) - reviewId String - review PRReview @relation(fields: [reviewId], references: [id]) - file String line Int - category String severity String - problem String fix String - createdAt DateTime @default(now()) + review PRReview @relation(fields: [reviewId], references: [id]) } model Deployment { id String @id @default(cuid()) repositoryId String - repository Repository @relation(fields: [repositoryId], references: [id]) - provider String status String deploymentId String prNumber Int? branch String? - cause String? fix String? rawLogs String? - - fixes DeploymentFix[] - createdAt DateTime @default(now()) + repository Repository @relation(fields: [repositoryId], references: [id]) + fixes DeploymentFix[] } model DeploymentFix { id String @id @default(cuid()) deploymentId String - deployment Deployment @relation(fields: [deploymentId], references: [id]) - status String commitSha String? diff String? - createdAt DateTime @default(now()) -} \ No newline at end of file + deployment Deployment @relation(fields: [deploymentId], references: [id]) +} diff --git a/client/src/lib/api/client.ts b/client/src/lib/api/client.ts index d227926..5b58101 100644 --- a/client/src/lib/api/client.ts +++ b/client/src/lib/api/client.ts @@ -2,7 +2,9 @@ import axios from "axios" import { getSession } from "next-auth/react" import type { Session } from "next-auth" -const apiClient = axios.create({ baseURL: "https://a49e-13-53-84-130.ngrok-free.app" }) +const apiClient = axios.create({ + baseURL: process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:3001", +}) apiClient.interceptors.request.use(async (config) => { const session = await getSession() as Session | null