diff --git a/.env.example b/.env.example index 2343cae..48453f2 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,5 @@ GOOGLE_SECRET_ID= GOOGLE_CLIENT_ID= NEXTAUTH_SECRET= NEXTAUTH_URL= -MONGODB_URI= \ No newline at end of file +MONGODB_URI= +GOOGLE_SITE_VERIFICATION_ID= \ No newline at end of file diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml new file mode 100644 index 0000000..583984d --- /dev/null +++ b/.github/workflows/preview.yaml @@ -0,0 +1,60 @@ +name: AWS R/Start Labs Preview Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches-ignore: + - main +jobs: + Format: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 18.17.0 + - name: Install Dependencies + run: npm install + - name: Code Format + run: npm run format + + Tests: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 18.17.0 + - name: Clear npm cache + run: npm cache clean -f + - name: Delete node_modules and package-lock.json + run: | + rm -rf node_modules + rm package-lock.json + # - name: Install Dependencies + # run: npm install + # - name: Cypress e2e tests ๐งช + # uses: cypress-io/github-action@v6.4.0 + # with: + # start: npm run dev + # wait-on: "http://localhost:3000" + # browser: electron + # config-file: cypress.config.ts + + Deploy-Preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml new file mode 100644 index 0000000..02014ff --- /dev/null +++ b/.github/workflows/production.yaml @@ -0,0 +1,60 @@ +name: AWS R/Start Labs Production Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches: + - main +jobs: + Format: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 18.17.0 + - name: Install Dependencies + run: npm install + - name: Code Format + run: npm run format + + Tests: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 18.17.0 + - name: Clear npm cache + run: npm cache clean -f + - name: Delete node_modules and package-lock.json + run: | + rm -rf node_modules + rm package-lock.json + # - name: Install Dependencies + # run: npm install + # - name: Cypress e2e tests ๐งช + # uses: cypress-io/github-action@v6.4.0 + # with: + # start: npm run dev + # wait-on: "http://localhost:3000" + # browser: electron + # config-file: cypress.config.ts + + Deploy-Production: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.gitignore b/.gitignore index fd3dbb5..e995c1b 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ yarn-error.log* # local env files .env*.local +*.env*.json # vercel .vercel diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..190bea8 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "plugins": [ + "prettier-plugin-organize-imports", + "prettier-plugin-tailwindcss" + ], + "trailingComma": "all", + "semi": false, + "singleQuote": false, + "useTabs": false, + "tabWidth": 2 +} diff --git a/app/api/labs/[id]/route.ts b/app/api/labs/[id]/route.ts index 11e1621..d5085b3 100644 --- a/app/api/labs/[id]/route.ts +++ b/app/api/labs/[id]/route.ts @@ -1,6 +1,6 @@ -import { NextResponse } from "next/server" import Lab from "@/models/Lab" import { LabRequestType } from "@/types/Requests" +import { NextResponse } from "next/server" export async function PUT( req: Request, diff --git a/app/globals.css b/app/globals.css index 3c93daf..753a5fc 100644 --- a/app/globals.css +++ b/app/globals.css @@ -33,9 +33,9 @@ body { } h1 { - @apply text-2xl sm:text-4xl font-bold mt-4 mb-4 dark:text-white text-gray-500; + @apply mb-4 mt-4 text-2xl font-bold text-gray-500 sm:text-4xl dark:text-white; } h2 { - @apply sm:text-xl text-lg mt-2 mb-2; + @apply mb-2 mt-2 text-lg sm:text-xl; } diff --git a/app/home/page.tsx b/app/home/page.tsx index cbfe36d..9379961 100644 --- a/app/home/page.tsx +++ b/app/home/page.tsx @@ -1,10 +1,10 @@ "use client" +import { UserLabs } from "@/components" +import { useUserLabsData } from "@/hooks" +import { ButtonStatusType } from "@/types/Common" import { signOut, useSession } from "next-auth/react" import { useState } from "react" -import { ButtonStatusType } from "@/types/Common" -import { useUserLabsData } from "@/hooks" -import { UserLabs } from "@/components" const HomePage = () => { const { data: userData } = useSession() @@ -32,14 +32,15 @@ const HomePage = () => { } return ( -