From f09cb09018b233180656ad5a5820bb13c105695c Mon Sep 17 00:00:00 2001 From: sheninthjr Date: Sun, 5 Nov 2023 19:02:37 +0530 Subject: [PATCH] Deploy.sh for client --- apps/client/src/deploy.sh | 7 +++ package.json | 55 +++++++++++----------- packages/prisma/deploy.sh | 1 + packages/prisma/package.json | 2 +- packages/ui/src/components/LandingPage.tsx | 8 ++-- 5 files changed, 42 insertions(+), 31 deletions(-) create mode 100644 apps/client/src/deploy.sh diff --git a/apps/client/src/deploy.sh b/apps/client/src/deploy.sh new file mode 100644 index 0000000..eae4a3e --- /dev/null +++ b/apps/client/src/deploy.sh @@ -0,0 +1,7 @@ +export PATH=$PATH:/home/ubuntu/.nvm/versions/node/v20.5.1/bin + +cd /home/ubuntu/Automatic-Question-Generator +git pull origin master +yarn build +pm2 stop react +pm2 start npm --name "react" -- run "start:react" \ No newline at end of file diff --git a/package.json b/package.json index 3867e95..1a08a54 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,29 @@ { - "private": true, - "scripts": { - "build": "turbo run build", - "dev": "turbo run dev", - "lint": "turbo run lint", - "start:express": "cd packages/prisma && yarn prisma migrate dev && yarn yarn prisma generate && sudo docker-compose up -d && node dist/index.js", - "format": "prettier --write \"**/*.{ts,tsx,md}\"" - }, - "devDependencies": { - "eslint": "^8.48.0", - "prettier": "^3.0.3", - "tsconfig": "*", - "turbo": "latest" - }, - "name": "QG", - "packageManager": "yarn@1.22.19", - "workspaces": [ - "apps/*", - "packages/*" - ], - "dependencies": { - "@types/cors": "^2.8.15", - "@types/express": "^4.17.20", - "cors": "^2.8.5", - "express": "^4.18.2" - } -} + "private": true, + "scripts": { + "build": "turbo run build", + "dev": "turbo run dev", + "lint": "turbo run lint", + "start:react": "cd apps/client-react/dist && serve -p 3001", + "start:express": "cd packages/prisma && sudo docker-compose up -d && yarn prisma migrate dev && yarn prisma generate && node dist/index.js", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" + }, + "devDependencies": { + "eslint": "^8.48.0", + "prettier": "^3.0.3", + "tsconfig": "*", + "turbo": "latest" + }, + "name": "QG", + "packageManager": "yarn@1.22.19", + "workspaces": [ + "apps/*", + "packages/*" + ], + "dependencies": { + "@types/cors": "^2.8.15", + "@types/express": "^4.17.20", + "cors": "^2.8.5", + "express": "^4.18.2" + } + } \ No newline at end of file diff --git a/packages/prisma/deploy.sh b/packages/prisma/deploy.sh index 9eda589..beb34d7 100644 --- a/packages/prisma/deploy.sh +++ b/packages/prisma/deploy.sh @@ -2,6 +2,7 @@ export PATH=$PATH:/home/ubuntu/.nvm/versions/node/v20.5.1/bin cd /home/ubuntu/Automatic-Question-Generator git pull origin master + yarn install yarn build pm2 stop express pm2 start npm --name "express" -- run "start:express" \ No newline at end of file diff --git a/packages/prisma/package.json b/packages/prisma/package.json index 6eece48..dcbe1aa 100644 --- a/packages/prisma/package.json +++ b/packages/prisma/package.json @@ -12,7 +12,7 @@ "prisma:push": "prisma db push --skip-generate", "prisma:seed": "prisma db seed", "prisma:deploy": "prisma migrate deploy", - "build": "esbuild ./src/index.js --bundle --platform=node --outfile=dist/index.js", + "build": "esbuild ./server/index.js --bundle --platform=node --outfile=dist/index.js", "dev": "tsc -b && node dist/index.js", "all":"yarn prisma migrate dev && yarn prisma generate && sudo docker-compose up -d && tsc -b && node dist/index.js", "start": "node dist/index.js", diff --git a/packages/ui/src/components/LandingPage.tsx b/packages/ui/src/components/LandingPage.tsx index 464cd91..ee81e70 100644 --- a/packages/ui/src/components/LandingPage.tsx +++ b/packages/ui/src/components/LandingPage.tsx @@ -4,13 +4,15 @@ export function LandingPage() { return (
-
+

Automatic Question Paper Generator

-

Upload the Question

-

Whenever needed, it will be automatically generated

+

This project is a sophisticated and practical solution designed to streamline and simplify

+

the process of creating customized question papers for educational institutions.

+

This project aims to provide a user-friendly platform for generating diverse

+

and tailored sets of questions efficiently.