diff --git a/.github/build.yaml b/.github/build.yaml new file mode 100644 index 00000000..96f7b06a --- /dev/null +++ b/.github/build.yaml @@ -0,0 +1,25 @@ +name: Build on PR + +on: + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Install Dependencies + run: npm install + + - name: Generate prisma client + run: cd packages/db && npx prisma generate && cd ../.. + + - name: Run Build + run: npm run build diff --git a/README.md b/README.md index 12804105..4c1aa252 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,3 @@ -- Clone the repo +## readme.md -```jsx -git clone https://github.com/100xdevs-cohort-2/week-17-final-code -``` - -- npm install -- Run postgres either locally or on the cloud (neon.tech) - -```jsx -docker run -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 postgres -``` - -- Copy over all .env.example files to .env -- Update .env files everywhere with the right db url -- Go to `packages/db` - - npx prisma migrate dev - - npx prisma db seed -- Go to `apps/user-app` , run `npm run dev` -- Try logging in using phone - 1111111111 , password - alice (See `seed.ts`) \ No newline at end of file +# Hello world \ No newline at end of file diff --git a/apps/user-app/components/BalanceCard.tsx b/apps/user-app/components/BalanceCard.tsx index 59ce9e27..e84e30f0 100644 --- a/apps/user-app/components/BalanceCard.tsx +++ b/apps/user-app/components/BalanceCard.tsx @@ -7,7 +7,7 @@ export const BalanceCard = ({amount, locked}: { return
- Unlocked balance + Unlocked balance lets write code
{amount / 100} INR diff --git a/package-lock.json b/package-lock.json index c5f06ffe..44384142 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1498,7 +1498,6 @@ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, "optional": true, - "peer": true, "engines": { "node": ">=14" } @@ -1536,13 +1535,13 @@ "version": "5.11.0", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.11.0.tgz", "integrity": "sha512-N6yYr3AbQqaiUg+OgjkdPp3KPW1vMTAgtKX6+BiB/qB2i1TjLYCrweKcUjzOoRM5BriA4idrkTej9A9QqTfl3A==", - "devOptional": true + "dev": true }, "node_modules/@prisma/engines": { "version": "5.11.0", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.11.0.tgz", "integrity": "sha512-gbrpQoBTYWXDRqD+iTYMirDlF9MMlQdxskQXbhARhG6A/uFQjB7DZMYocMQLoiZXO/IskfDOZpPoZE8TBQKtEw==", - "devOptional": true, + "dev": true, "hasInstallScript": true, "dependencies": { "@prisma/debug": "5.11.0", @@ -1555,13 +1554,13 @@ "version": "5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102.tgz", "integrity": "sha512-WXCuyoymvrS4zLz4wQagSsc3/nE6CHy8znyiMv8RKazKymOMd5o9FP5RGwGHAtgoxd+aB/BWqxuP/Ckfu7/3MA==", - "devOptional": true + "dev": true }, "node_modules/@prisma/fetch-engine": { "version": "5.11.0", "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.11.0.tgz", "integrity": "sha512-994viazmHTJ1ymzvWugXod7dZ42T2ROeFuH6zHPcUfp/69+6cl5r9u3NFb6bW8lLdNjwLYEVPeu3hWzxpZeC0w==", - "devOptional": true, + "dev": true, "dependencies": { "@prisma/debug": "5.11.0", "@prisma/engines-version": "5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102", @@ -1572,7 +1571,7 @@ "version": "5.11.0", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.11.0.tgz", "integrity": "sha512-rxtHpMLxNTHxqWuGOLzR2QOyQi79rK1u1XYAVLZxDGTLz/A+uoDnjz9veBFlicrpWjwuieM4N6jcnjj/DDoidw==", - "devOptional": true, + "dev": true, "dependencies": { "@prisma/debug": "5.11.0" } @@ -8477,7 +8476,7 @@ "version": "5.11.0", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.11.0.tgz", "integrity": "sha512-KCLiug2cs0Je7kGkQBN9jDWoZ90ogE/kvZTUTgz2h94FEo8pczCkPH7fPNXkD1sGU7Yh65risGGD1HQ5DF3r3g==", - "devOptional": true, + "dev": true, "hasInstallScript": true, "dependencies": { "@prisma/engines": "5.11.0" diff --git a/package.json b/package.json index 4be5bbb6..3e22bc49 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,9 @@ "lint": "turbo lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "db:generate": "cd packages/db && npx prisma generate && cd ../..", - "start-user-app": "cd ./apps/user-app && npm run start" - + "start-user-app": "cd ./apps/user-app && npm run start", + "start-merchant-app": "cd ./apps/merchant-app && npm run start", + "start-bank-webhook": "cd ./apps/bank-webhook && npm run start" }, "devDependencies": { "@repo/eslint-config": "*", diff --git a/packages/db/index.ts b/packages/db/index.ts index 0aa97b3d..50ba2f4f 100644 --- a/packages/db/index.ts +++ b/packages/db/index.ts @@ -1,15 +1,17 @@ -import { PrismaClient } from '@prisma/client' +import { PrismaClient } from "@prisma/client"; +// lets make some comments so that we can see the diff const prismaClientSingleton = () => { - return new PrismaClient() -} + return new PrismaClient(); +}; declare global { - var prismaGlobal: undefined | ReturnType + var prismaGlobal: undefined | ReturnType; } -const prisma: ReturnType = globalThis.prismaGlobal ?? prismaClientSingleton() +const prisma: ReturnType = + globalThis.prismaGlobal ?? prismaClientSingleton(); -export default prisma +export default prisma; -if (process.env.NODE_ENV !== 'production') globalThis.prismaGlobal = prisma \ No newline at end of file +if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma; diff --git a/packages/ui/src/Appbar.tsx b/packages/ui/src/Appbar.tsx index d7879d31..369501ca 100644 --- a/packages/ui/src/Appbar.tsx +++ b/packages/ui/src/Appbar.tsx @@ -16,7 +16,7 @@ export const Appbar = ({ }: AppbarProps) => { return
- PayTM + PayTM Kro