Skip to content

Commit

Permalink
Merge pull request #13 from Yogesh070/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Yogesh070 committed Aug 21, 2023
2 parents 0d34987 + 185615c commit 67677df
Show file tree
Hide file tree
Showing 40 changed files with 3,666 additions and 1,576 deletions.
59 changes: 31 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"postinstall": "prisma generate",
"build:1-generate": "prisma generate",
"build:2-next": "cross-env NODE_ENV=production next build",
"build:3-server": "tsc --project tsconfig.server.json",
"build:4-migrate": "prisma migrate deploy",
"build": "run-s build:*",
"lint": "next lint",
"start": "next start",
"dev:wss": "cross-env PORT=3001 tsx watch src/server/wssDevServer.ts --tsconfig tsconfig.server.json ",
Expand All @@ -19,48 +22,48 @@
"@dnd-kit/sortable": "^7.0.2",
"@heroicons/react": "^2.0.18",
"@next-auth/prisma-adapter": "^1.0.7",
"@prisma/client": "^4.16.2",
"@tanstack/react-query": "^4.29.19",
"@trpc/client": "^10.33.0",
"@trpc/next": "^10.33.0",
"@trpc/react-query": "^10.33.0",
"@trpc/server": "^10.33.0",
"antd": "^5.6.3",
"@prisma/client": "5.1.1",
"@tanstack/react-query": "^4.33.0",
"@trpc/client": "^10.37.1",
"@trpc/next": "^10.37.1",
"@trpc/react-query": "^10.37.1",
"@trpc/server": "^10.37.1",
"antd": "^5.8.0",
"aos": "^2.3.4",
"dayjs": "^1.11.9",
"next": "^13.4.7",
"next-auth": "^4.22.1",
"node-fetch": "^3.3.1",
"next": "^13.4.19",
"next-auth": "^4.23.1",
"node-fetch": "^3.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"recharts": "^2.7.2",
"superjson": "^1.12.4",
"recharts": "^2.7.3",
"superjson": "^1.13.1",
"tsx": "^3.12.7",
"ws": "^8.13.0",
"zod": "^3.21.4",
"zustand": "^4.3.8"
"zod": "^3.22.2",
"zustand": "^4.4.1"
},
"devDependencies": {
"@faker-js/faker": "^8.0.2",
"@playwright/test": "^1.35.1",
"@types/node": "^20.3.3",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@playwright/test": "^1.37.1",
"@types/node": "^20.5.1",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/ws": "^8.5.5",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"classnames": "^2.3.2",
"cross-env": "^7.0.3",
"eslint": "^8.44.0",
"eslint-config-next": "^13.4.7",
"eslint-plugin-prettier": "^4.2.1",
"eslint": "^8.47.0",
"eslint-config-next": "^13.4.19",
"eslint-plugin-prettier": "^5.0.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.24",
"postcss": "^8.4.28",
"postcss-loader": "^7.3.3",
"postcss-nested": "^6.0.1",
"postcss-simple-vars": "^7.0.1",
"prisma": "^4.16.2",
"sass": "^1.63.6",
"prisma": "5.1.1",
"sass": "^1.66.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
},
Expand Down
63 changes: 63 additions & 0 deletions prisma/migrations/20230716054349_latest/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
Warnings:
- You are about to drop the `Example` table. If the table is not empty, all the data it contains will be lost.
*/
-- AlterTable
ALTER TABLE "Issue" ADD COLUMN "sprintId" TEXT;

-- AlterTable
ALTER TABLE "Project" ADD COLUMN "workspaceId" TEXT;

-- AlterTable
ALTER TABLE "User" ADD COLUMN "workspaceId" TEXT;

-- DropTable
DROP TABLE "Example";

-- CreateTable
CREATE TABLE "Workspace" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"shortName" TEXT NOT NULL,
"description" TEXT,
"website" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"createdById" TEXT NOT NULL,
"color" TEXT NOT NULL,

CONSTRAINT "Workspace_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Sprint" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"title" TEXT NOT NULL,
"startDate" TIMESTAMP(3),
"endDate" TIMESTAMP(3),
"projectId" TEXT NOT NULL,
"goal" TEXT,
"isCompleted" BOOLEAN NOT NULL DEFAULT false,
"hasStarted" BOOLEAN NOT NULL DEFAULT false,

CONSTRAINT "Sprint_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "User" ADD CONSTRAINT "User_workspaceId_fkey" FOREIGN KEY ("workspaceId") REFERENCES "Workspace"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Workspace" ADD CONSTRAINT "Workspace_createdById_fkey" FOREIGN KEY ("createdById") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Project" ADD CONSTRAINT "Project_workspaceId_fkey" FOREIGN KEY ("workspaceId") REFERENCES "Workspace"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Issue" ADD CONSTRAINT "Issue_sprintId_fkey" FOREIGN KEY ("sprintId") REFERENCES "Sprint"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Sprint" ADD CONSTRAINT "Sprint_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
88 changes: 45 additions & 43 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ generator client {
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
provider = "postgresql"
url = env("DATABASE_PRISMA_URL") // uses connection pooling
directUrl = env("DATABASE_URL_NON_POOLING") // uses a direct connection
shadowDatabaseUrl = env("DATABASE_URL_NON_POOLING")
}

model Account {
Expand Down Expand Up @@ -39,19 +41,19 @@ model User {
email String? @unique
emailVerified Boolean? @default(false)
image String?
workspaceId String?
accounts Account[]
checkListItems CheckListItem[]
comments Comment[]
createdIssues Issue[] @relation("createdBy")
defaultAssigneeProjects Project[] @relation("defaultAssignee")
leadProjects Project[]
sessions Session[]
issue Issue[]
Workspace Workspace? @relation(fields: [workspaceId], references: [id])
userActions UserActions[]
projects Project[] @relation("projectMembers")
defaultAssigneeProjects Project[] @relation("defaultAssignee")
workspace Workspace[] @relation("createdBy")
Workspace Workspace? @relation(fields: [workspaceId], references: [id])
workspaceId String?
issue Issue[] @relation("IssueToUser")
projects Project[] @relation("projectMembers")
}

model VerificationToken {
Expand All @@ -70,11 +72,11 @@ model Workspace {
website String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
members User[]
projects Project[]
createdBy User @relation("createdBy", fields: [createdById], references: [id])
createdById String
color String
projects Project[]
members User[]
createdBy User @relation("createdBy", fields: [createdById], references: [id])
}

model Project {
Expand All @@ -85,16 +87,16 @@ model Project {
viewType ViewType @default(KANBAN_BOARD)
status ProjectStatus @default(ACTIVE)
projectLeadId String
defaultAssigneeId String?
workspaceId String?
labels Label[]
defaultAssignee User? @relation("defaultAssignee", fields: [defaultAssigneeId], references: [id])
projectLead User @relation(fields: [projectLeadId], references: [id])
Workspace Workspace? @relation(fields: [workspaceId], references: [id])
sprints Sprint[]
userActions UserActions[]
workflows WorkFlow[]
members User[] @relation("projectMembers")
defaultAssigneeId String?
defaultAssignee User? @relation("defaultAssignee", fields: [defaultAssigneeId], references: [id])
labels Label[]
Workspace Workspace? @relation(fields: [workspaceId], references: [id])
workspaceId String?
sprints Sprint[]
}

model WorkFlow {
Expand All @@ -109,15 +111,15 @@ model WorkFlow {
}

model Label {
id String @id @default(cuid())
title String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
color String
issueId String?
issue Issue? @relation(fields: [issueId], references: [id])
Project Project? @relation(fields: [projectId], references: [id])
projectId String?
id String @id @default(cuid())
title String
description String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
color String
projectId String?
issues Issue[]
Project Project? @relation(fields: [projectId], references: [id])
}

model Issue {
Expand All @@ -132,16 +134,16 @@ model Issue {
flagged Boolean @default(false)
dueDate DateTime?
issueId String?
sprintId String?
checkLists CheckList[]
comments Comment[]
createdBy User @relation("createdBy", fields: [createdById], references: [id])
issue Issue? @relation("linkedIssues", fields: [issueId], references: [id])
linkedIssues Issue[] @relation("linkedIssues")
sprint Sprint? @relation(fields: [sprintId], references: [id])
workFlow WorkFlow @relation(fields: [workFlowId], references: [id], onDelete: Cascade)
labels Label[]
assignees User[]
sprint Sprint? @relation(fields: [sprintId], references: [id])
sprintId String?
assignees User[] @relation("IssueToUser")
}

model Comment {
Expand Down Expand Up @@ -189,6 +191,21 @@ model UserActions {
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model Sprint {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
startDate DateTime?
endDate DateTime?
projectId String
goal String?
isCompleted Boolean @default(false)
hasStarted Boolean @default(false)
issues Issue[]
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
}

enum ProjectType {
KANBAN
SCRUM
Expand Down Expand Up @@ -245,18 +262,3 @@ enum Action {
ADDED_A_CHECKLIST_TO_ISSUE
REMOVED_A_CHECKLIST_FROM_ISSUE
}

model Sprint {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
startDate DateTime?
endDate DateTime?
projectId String
goal String?
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
issues Issue[]
isCompleted Boolean @default(false)
hasStarted Boolean @default(false)
}
Loading

0 comments on commit 67677df

Please sign in to comment.