feat(upgrade): changes to code to support new template

This commit is contained in:
Amruth Pillai
2022-04-08 09:37:26 +02:00
parent 9cd36fcb9b
commit 1df78100ca
14 changed files with 2810 additions and 1801 deletions

View File

@ -4,13 +4,15 @@ PUBLIC_URL=http://localhost
PUBLIC_SERVER_URL=http://localhost/api PUBLIC_SERVER_URL=http://localhost/api
PUBLIC_GOOGLE_CLIENT_ID= PUBLIC_GOOGLE_CLIENT_ID=
# Database
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
# Server # Server
SECRET_KEY= SECRET_KEY=
POSTGRES_HOST=postgres POSTGRES_HOST=postgres
POSTGRES_PORT=5432 POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DATABASE=postgres
POSTGRES_SSL_CERT= POSTGRES_SSL_CERT=
JWT_SECRET= JWT_SECRET=
JWT_EXPIRY_TIME=604800 JWT_EXPIRY_TIME=604800

View File

@ -17,13 +17,10 @@ jobs:
name: Get Version name: Get Version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
# https://github.com/docker/setup-qemu-action#usage
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0 uses: docker/setup-qemu-action@v1.2.0
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.6.0 uses: docker/setup-buildx-action@v1.6.0
- name: Login to Docker - name: Login to Docker
@ -38,8 +35,7 @@ jobs:
context: . context: .
push: true push: true
file: client/Dockerfile file: client/Dockerfile
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 platforms: linux/amd64,linux/arm/v7,linux/arm64
platforms: linux/amd64,linux/arm/v7,linux/arm/v6,linux/arm64
tags: | tags: |
amruthpillai/reactive-resume:client-latest amruthpillai/reactive-resume:client-latest
amruthpillai/reactive-resume:client-${{ steps.version.outputs.tag }} amruthpillai/reactive-resume:client-${{ steps.version.outputs.tag }}
@ -56,13 +52,10 @@ jobs:
name: Get Version name: Get Version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
# https://github.com/docker/setup-qemu-action#usage
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0 uses: docker/setup-qemu-action@v1.2.0
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.6.0 uses: docker/setup-buildx-action@v1.6.0
- name: Login to Docker - name: Login to Docker
@ -77,8 +70,7 @@ jobs:
context: . context: .
push: true push: true
file: server/Dockerfile file: server/Dockerfile
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 platforms: linux/amd64,linux/arm/v7,linux/arm64
platforms: linux/amd64,linux/arm/v7,linux/arm/v6,linux/arm64
tags: | tags: |
amruthpillai/reactive-resume:server-latest amruthpillai/reactive-resume:server-latest
amruthpillai/reactive-resume:server-${{ steps.version.outputs.tag }} amruthpillai/reactive-resume:server-${{ steps.version.outputs.tag }}
@ -95,13 +87,10 @@ jobs:
name: Get Version name: Get Version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
# https://github.com/docker/setup-qemu-action#usage
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0 uses: docker/setup-qemu-action@v1.2.0
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.6.0 uses: docker/setup-buildx-action@v1.6.0
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
@ -117,8 +106,7 @@ jobs:
context: . context: .
push: true push: true
file: client/Dockerfile file: client/Dockerfile
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 platforms: linux/amd64,linux/arm/v7,linux/arm64
platforms: linux/amd64,linux/arm/v7,linux/arm/v6,linux/arm64
tags: | tags: |
ghcr.io/amruthpillai/reactive-resume:client-latest ghcr.io/amruthpillai/reactive-resume:client-latest
ghcr.io/amruthpillai/reactive-resume:client-${{ steps.version.outputs.tag }} ghcr.io/amruthpillai/reactive-resume:client-${{ steps.version.outputs.tag }}
@ -135,13 +123,10 @@ jobs:
name: Get Version name: Get Version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
# https://github.com/docker/setup-qemu-action#usage
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0 uses: docker/setup-qemu-action@v1.2.0
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.6.0 uses: docker/setup-buildx-action@v1.6.0
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
@ -157,8 +142,7 @@ jobs:
context: . context: .
push: true push: true
file: server/Dockerfile file: server/Dockerfile
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 platforms: linux/amd64,linux/arm/v7,linux/arm64
platforms: linux/amd64,linux/arm/v7,linux/arm/v6,linux/arm64
tags: | tags: |
ghcr.io/amruthpillai/reactive-resume:server-latest ghcr.io/amruthpillai/reactive-resume:server-latest
ghcr.io/amruthpillai/reactive-resume:server-${{ steps.version.outputs.tag }} ghcr.io/amruthpillai/reactive-resume:server-${{ steps.version.outputs.tag }}

View File

@ -9,15 +9,15 @@
}, },
"dependencies": { "dependencies": {
"@beam-australia/react-env": "^3.1.1", "@beam-australia/react-env": "^3.1.1",
"@emotion/css": "^11.7.1", "@emotion/css": "^11.9.0",
"@emotion/react": "^11.8.2", "@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1", "@emotion/styled": "^11.8.1",
"@hookform/resolvers": "2.8.8", "@hookform/resolvers": "2.8.8",
"@monaco-editor/react": "^4.3.1", "@monaco-editor/react": "^4.4.1",
"@mui/icons-material": "^5.5.1", "@mui/icons-material": "^5.6.0",
"@mui/lab": "^5.0.0-alpha.74", "@mui/lab": "^5.0.0-alpha.76",
"@mui/material": "^5.5.2", "@mui/material": "^5.6.0",
"@reduxjs/toolkit": "^1.8.0", "@reduxjs/toolkit": "^1.8.1",
"axios": "^0.26.1", "axios": "^0.26.1",
"clsx": "^1.1.1", "clsx": "^1.1.1",
"dayjs": "^1.11.0", "dayjs": "^1.11.0",
@ -26,23 +26,23 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"md5-hex": "^4.0.0", "md5-hex": "^4.0.0",
"monaco-editor": "^0.33.0", "monaco-editor": "^0.33.0",
"nanoid": "^3.3.1", "nanoid": "^3.3.2",
"next": "12.1.0", "next": "12.1.4",
"next-i18next": "^10.5.0", "next-i18next": "^11.0.0",
"react": ">=17", "react": "^17.0.0",
"react-beautiful-dnd": "^13.1.0", "react-beautiful-dnd": "^13.1.0",
"react-colorful": "^5.5.1", "react-colorful": "^5.5.1",
"react-dnd": "^15.1.1", "react-dnd": "^15.1.2",
"react-dnd-html5-backend": "^15.1.2", "react-dnd-html5-backend": "^15.1.2",
"react-dom": ">=17", "react-dom": "^17.0.0",
"react-google-login": "^5.2.2", "react-google-login": "^5.2.2",
"react-hook-form": "^7.28.1", "react-hook-form": "^7.29.0",
"react-hot-toast": "2.2.0", "react-hot-toast": "2.2.0",
"react-hotkeys-hook": "^3.4.4", "react-hotkeys-hook": "^3.4.4",
"react-icons": "^4.3.1", "react-icons": "^4.3.1",
"react-markdown": "^8.0.1", "react-markdown": "^8.0.2",
"react-query": "^3.34.16", "react-query": "^3.34.19",
"react-redux": "^7.2.6", "react-redux": "^7.2.8",
"react-zoom-pan-pinch": "^2.1.3", "react-zoom-pan-pinch": "^2.1.3",
"redux": "^4.1.2", "redux": "^4.1.2",
"redux-persist": "^6.0.0", "redux-persist": "^6.0.0",
@ -53,26 +53,27 @@
"webfontloader": "^1.6.28" "webfontloader": "^1.6.28"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.8", "@babel/core": "^7.17.9",
"@reactive-resume/schema": "workspace:*", "@reactive-resume/schema": "workspace:*",
"@tailwindcss/typography": "^0.5.2", "@tailwindcss/typography": "^0.5.2",
"@types/downloadjs": "^1.4.3", "@types/downloadjs": "^1.4.3",
"@types/lodash": "^4.14.180", "@types/lodash": "^4.14.181",
"@types/node": "17.0.23", "@types/node": "17.0.23",
"@types/react": "17.0.42", "@types/react": "18.0.0",
"@types/react-beautiful-dnd": "^13.1.2", "@types/react-beautiful-dnd": "^13.1.2",
"@types/react-redux": "^7.1.23", "@types/react-redux": "^7.1.23",
"@types/tailwindcss": "^3.0.9", "@types/tailwindcss": "^3.0.10",
"@types/uuid": "^8.3.4", "@types/uuid": "^8.3.4",
"@types/webfontloader": "^1.6.34", "@types/webfontloader": "^1.6.34",
"autoprefixer": "^10.4.4", "autoprefixer": "^10.4.4",
"eslint": "^8.11.0", "csstype": "^3.0.11",
"eslint-config-next": "12.1.0", "eslint": "^8.12.0",
"next-sitemap": "^2.5.13", "eslint-config-next": "12.1.4",
"next-sitemap": "^2.5.19",
"postcss": "^8.4.12", "postcss": "^8.4.12",
"prettier": "^2.6.0", "prettier": "^2.6.2",
"sass": "^1.49.9", "sass": "^1.50.0",
"tailwindcss": "^3.0.23", "tailwindcss": "^3.0.23",
"typescript": "<4.6.0" "typescript": "^4.6.3"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 187 KiB

View File

@ -7,14 +7,17 @@ x-env-shared: &env-shared
- PUBLIC_SERVER_URL=http://localhost/api - PUBLIC_SERVER_URL=http://localhost/api
- PUBLIC_GOOGLE_CLIENT_ID= - PUBLIC_GOOGLE_CLIENT_ID=
x-env-database: &env-database
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
x-env-server: &env-server x-env-server: &env-server
environment: environment:
- SECRET_KEY= - SECRET_KEY=
- POSTGRES_HOST=postgres - POSTGRES_HOST=postgres
- POSTGRES_PORT=5432 - POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DATABASE=postgres
- POSTGRES_SSL_CERT= - POSTGRES_SSL_CERT=
- JWT_SECRET= - JWT_SECRET=
- JWT_EXPIRY_TIME=604800 - JWT_EXPIRY_TIME=604800
@ -34,6 +37,9 @@ services:
postgres: postgres:
image: postgres:14.2-alpine image: postgres:14.2-alpine
container_name: postgres container_name: postgres
<<: *env-database
ports:
- 5432:5432
volumes: volumes:
- pgdata:/var/lib/postgresql/data - pgdata:/var/lib/postgresql/data
healthcheck: healthcheck:
@ -60,7 +66,8 @@ services:
image: amruthpillai/reactive-resume:server-latest image: amruthpillai/reactive-resume:server-latest
container_name: server container_name: server
<<: *env-shared <<: *env-shared
<<: *env-server <<: *env-server
<<: *env-database
depends_on: depends_on:
- traefik - traefik
- postgres - postgres

View File

@ -65,6 +65,12 @@ This URL is used when export PDF functionality is used within the app and has to
**Default Value:** `5432` **Default Value:** `5432`
**Description:** Port of the PostgreSQL Server **Description:** Port of the PostgreSQL Server
### `POSTGRES_DB`
**Required**: `yes`
**Default Value:** `postgres`
**Description:** Name of the Database in PostgreSQL Server
### `POSTGRES_USER` ### `POSTGRES_USER`
**Required**: `yes` **Required**: `yes`
@ -77,12 +83,6 @@ This URL is used when export PDF functionality is used within the app and has to
**Default Value:** `postgres` **Default Value:** `postgres`
**Description:** Password of the PostgreSQL Server **Description:** Password of the PostgreSQL Server
### `POSTGRES_DATABASE`
**Required**: `yes`
**Default Value:** `reactive_resume`
**Description:** Name of the Database in PostgreSQL Server
### `POSTGRES_SSL_CERT` ### `POSTGRES_SSL_CERT`
**Required**: `no` **Required**: `no`

View File

@ -15,13 +15,13 @@
}, },
"dependencies": { "dependencies": {
"@algolia/client-search": "^4.13.0", "@algolia/client-search": "^4.13.0",
"@docusaurus/core": "2.0.0-beta.17", "@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.17", "@docusaurus/preset-classic": "2.0.0-beta.18",
"@mdx-js/react": "^1.6.22", "@mdx-js/react": "^2.1.1",
"clsx": "^1.1.1", "clsx": "^1.1.1",
"prism-react-renderer": "^1.3.1", "prism-react-renderer": "^1.3.1",
"react": "^17.0.2", "react": "^17.0.0",
"react-dom": "^17.0.2" "react-dom": "^17.0.0"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [
@ -36,6 +36,6 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@types/react": "17.0.42" "@types/react": "^17.0.0"
} }
} }

View File

@ -34,22 +34,22 @@
"start": "env-cmd --silent concurrently --kill-others \"pnpm run start:*\"" "start": "env-cmd --silent concurrently --kill-others \"pnpm run start:*\""
}, },
"dependencies": { "dependencies": {
"concurrently": "^7.0.0", "concurrently": "^7.1.0",
"env-cmd": "^10.1.0" "env-cmd": "^10.1.0"
}, },
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.16.0", "@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.16.0", "@typescript-eslint/parser": "^5.18.0",
"cz-conventional-changelog": "^3.3.0", "cz-conventional-changelog": "^3.3.0",
"eslint": "^8.11.0", "eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.4", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-simple-import-sort": "^7.0.0", "eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unused-imports": "^2.0.0", "eslint-plugin-unused-imports": "^2.0.0",
"husky": "^7.0.4", "husky": "^7.0.4",
"prettier": "^2.6.0", "prettier": "^2.6.2",
"standard-version": "^9.3.2", "standard-version": "^9.3.2",
"typescript": "^4.5.5" "typescript": "^4.6.3"
} }
} }

4423
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
"lint": "eslint --fix --ext .ts ./src" "lint": "eslint --fix --ext .ts ./src"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^8.11.0", "eslint": "^8.12.0",
"typescript": "<4.6.0" "typescript": "^4.6.3"
} }
} }

View File

@ -1,2 +0,0 @@
create database reactive_resume;
grant all privileges on database reactive_resume to postgres;

View File

@ -11,60 +11,60 @@
}, },
"dependencies": { "dependencies": {
"@nestjs/axios": "^0.0.7", "@nestjs/axios": "^0.0.7",
"@nestjs/common": "^8.4.2", "@nestjs/common": "^8.4.4",
"@nestjs/config": "^2.0.0", "@nestjs/config": "^2.0.0",
"@nestjs/core": "^8.4.2", "@nestjs/core": "^8.4.4",
"@nestjs/jwt": "^8.0.0", "@nestjs/jwt": "^8.0.0",
"@nestjs/mapped-types": "^1.0.1", "@nestjs/mapped-types": "^1.0.1",
"@nestjs/passport": "^8.2.1", "@nestjs/passport": "^8.2.1",
"@nestjs/platform-express": "^8.4.2", "@nestjs/platform-express": "^8.4.4",
"@nestjs/schedule": "^1.0.2", "@nestjs/schedule": "^1.1.0",
"@nestjs/serve-static": "^2.2.2", "@nestjs/serve-static": "^2.2.2",
"@nestjs/terminus": "^8.0.6", "@nestjs/terminus": "^8.0.6",
"@nestjs/typeorm": "^8.0.3", "@nestjs/typeorm": "^8.0.3",
"@sendgrid/mail": "^7.6.2", "@sendgrid/mail": "^7.6.2",
"@types/passport": "^1.0.7", "@types/passport": "^1.0.7",
"bcrypt": "^5.0.1", "bcrypt": "^5.0.1",
"cache-manager": "^3.6.0", "cache-manager": "^3.6.1",
"class-transformer": "^0.5.1", "class-transformer": "^0.5.1",
"class-validator": "^0.13.2", "class-validator": "^0.13.2",
"cookie-parser": "^1.4.6", "cookie-parser": "^1.4.6",
"csvtojson": "^2.0.10", "csvtojson": "^2.0.10",
"dayjs": "^1.11.0", "dayjs": "^1.11.0",
"googleapis": "^98.0.0", "googleapis": "^100.0.0",
"joi": "^17.6.0", "joi": "^17.6.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"multer": "^1.4.4", "multer": "^1.4.4",
"nanoid": "^3.3.1", "nanoid": "^3.3.2",
"node-stream-zip": "^1.15.0", "node-stream-zip": "^1.15.0",
"passport": "^0.5.2", "passport": "^0.5.2",
"passport-jwt": "^4.0.0", "passport-jwt": "^4.0.0",
"passport-local": "^1.0.0", "passport-local": "^1.0.0",
"pdf-lib": "^1.17.1", "pdf-lib": "^1.17.1",
"pg": "^8.7.3", "pg": "^8.7.3",
"playwright-chromium": "^1.20.1", "playwright-chromium": "^1.20.2",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rxjs": "^7.5.5", "rxjs": "^7.5.5",
"typeorm": "^0.2.45", "typeorm": "^0.2.34",
"uuid": "^8.3.2" "uuid": "^8.3.2"
}, },
"devDependencies": { "devDependencies": {
"@nestjs/cli": "^8.2.4", "@nestjs/cli": "^8.2.5",
"@nestjs/schematics": "^8.0.8", "@nestjs/schematics": "^8.0.10",
"@reactive-resume/schema": "workspace:*", "@reactive-resume/schema": "workspace:*",
"@types/bcrypt": "^5.0.0", "@types/bcrypt": "^5.0.0",
"@types/cookie-parser": "^1.4.2", "@types/cookie-parser": "^1.4.2",
"@types/express": "^4.17.13", "@types/express": "^4.17.13",
"@types/multer": "^1.4.7", "@types/multer": "^1.4.7",
"@types/node": "^17.0.23", "@types/node": "^17.0.23",
"eslint": "^8.11.0", "eslint": "^8.12.0",
"prettier": "^2.6.0", "prettier": "^2.6.2",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"ts-loader": "^9.2.8", "ts-loader": "^9.2.8",
"ts-node": "^10.7.0", "ts-node": "^10.7.0",
"tsconfig-paths": "^3.14.1", "tsconfig-paths": "^3.14.1",
"typescript": "<4.6.0", "typescript": "^4.6.3",
"webpack": "^5.70.0" "webpack": "^5.72.0"
} }
} }

View File

@ -21,9 +21,9 @@ const validationSchema = Joi.object({
// Database // Database
POSTGRES_HOST: Joi.string().required(), POSTGRES_HOST: Joi.string().required(),
POSTGRES_PORT: Joi.number().default(5432), POSTGRES_PORT: Joi.number().default(5432),
POSTGRES_DB: Joi.string().required(),
POSTGRES_USER: Joi.string().required(), POSTGRES_USER: Joi.string().required(),
POSTGRES_PASSWORD: Joi.string().required(), POSTGRES_PASSWORD: Joi.string().required(),
POSTGRES_DATABASE: Joi.string().required(),
POSTGRES_SSL_CERT: Joi.string().allow(''), POSTGRES_SSL_CERT: Joi.string().allow(''),
// Auth // Auth

View File

@ -3,8 +3,8 @@ import { registerAs } from '@nestjs/config';
export default registerAs('postgres', () => ({ export default registerAs('postgres', () => ({
host: process.env.POSTGRES_HOST, host: process.env.POSTGRES_HOST,
port: parseInt(process.env.POSTGRES_PORT, 10) || 5432, port: parseInt(process.env.POSTGRES_PORT, 10) || 5432,
database: process.env.POSTGRES_DB,
username: process.env.POSTGRES_USER, username: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD, password: process.env.POSTGRES_PASSWORD,
database: process.env.POSTGRES_DATABASE,
certificate: process.env.POSTGRES_SSL_CERT, certificate: process.env.POSTGRES_SSL_CERT,
})); }));