From 7b60192620a4b6913a5335f994d79c711b8aea8e Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Tue, 9 Jul 2024 11:52:35 +0400 Subject: [PATCH 01/31] refactor(oauth): link use url --- src/oauth/components/oauth-login-link.component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oauth/components/oauth-login-link.component.tsx b/src/oauth/components/oauth-login-link.component.tsx index 9fcff42..5e995f1 100644 --- a/src/oauth/components/oauth-login-link.component.tsx +++ b/src/oauth/components/oauth-login-link.component.tsx @@ -25,7 +25,7 @@ const OauthLoginLink: FC = ({ oauthUrl.searchParams.append('uuid', uuid()); return ( - + {children} ); From d0f322463d2cb038a0f449534acfaf2328efde94 Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Mon, 13 Jan 2025 11:54:18 +0400 Subject: [PATCH 02/31] refactor: db connection --- package-lock.json | 281 +++++++++++++++++++++++------------- package.json | 5 +- src/db/database.constant.ts | 13 +- 3 files changed, 194 insertions(+), 105 deletions(-) diff --git a/package-lock.json b/package-lock.json index fcbd292..c932f3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,14 +10,12 @@ "dependencies": { "@ducanh2912/next-pwa": "^10.2.7", "@hookform/resolvers": "^3.7.0", - "@vercel/analytics": "^1.3.1", - "@vercel/postgres-kysely": "^0.7.1", - "@vercel/speed-insights": "^1.0.12", "clsx": "^2.1.1", "date-fns": "^3.6.0", "jose": "^5.6.3", "kysely": "^0.26.3", "next": "14.2.4", + "pg": "^8.13.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-hook-form": "^7.52.1", @@ -42,6 +40,7 @@ "@types/jest": "^29.5.12", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^20.14.9", + "@types/pg": "^8.11.10", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@types/uuid": "^10.0.0", @@ -3909,14 +3908,6 @@ "tar-fs": "^2.1.1" } }, - "node_modules/@neondatabase/serverless": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@neondatabase/serverless/-/serverless-0.7.2.tgz", - "integrity": "sha512-wU3WA2uTyNO7wjPs3Mg0G01jztAxUxzd9/mskMmtPwPTjf7JKWi9AW5/puOGXLxmZ9PVgRFeBVRVYq5nBPhsCg==", - "dependencies": { - "@types/pg": "8.6.6" - } - }, "node_modules/@next/env": { "version": "14.2.4", "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.4.tgz", @@ -7268,13 +7259,77 @@ "dev": true }, "node_modules/@types/pg": { - "version": "8.6.6", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.6.tgz", - "integrity": "sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==", + "version": "8.11.10", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.11.10.tgz", + "integrity": "sha512-LczQUW4dbOQzsH2RQ5qoeJ6qJPdrcM/DcMLoqWQkMLMsq83J5lAX3LXjdkWdpscFy67JSOWDnh7Ny/sPFykmkg==", + "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "pg-protocol": "*", - "pg-types": "^2.2.0" + "pg-types": "^4.0.1" + } + }, + "node_modules/@types/pg/node_modules/pg-types": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.2.tgz", + "integrity": "sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==", + "dev": true, + "license": "MIT", + "dependencies": { + "pg-int8": "1.0.1", + "pg-numeric": "1.0.2", + "postgres-array": "~3.0.1", + "postgres-bytea": "~3.0.0", + "postgres-date": "~2.1.0", + "postgres-interval": "^3.0.0", + "postgres-range": "^1.1.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@types/pg/node_modules/postgres-array": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz", + "integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/@types/pg/node_modules/postgres-bytea": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz", + "integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "obuf": "~1.1.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/pg/node_modules/postgres-date": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.1.0.tgz", + "integrity": "sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/@types/pg/node_modules/postgres-interval": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz", + "integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" } }, "node_modules/@types/pretty-hrtime": { @@ -7772,88 +7827,6 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, - "node_modules/@vercel/analytics": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-1.3.1.tgz", - "integrity": "sha512-xhSlYgAuJ6Q4WQGkzYTLmXwhYl39sWjoMA3nHxfkvG+WdBT25c563a7QhwwKivEOZtPJXifYHR1m2ihoisbWyA==", - "dependencies": { - "server-only": "^0.0.1" - }, - "peerDependencies": { - "next": ">= 13", - "react": "^18 || ^19" - }, - "peerDependenciesMeta": { - "next": { - "optional": true - }, - "react": { - "optional": true - } - } - }, - "node_modules/@vercel/postgres": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@vercel/postgres/-/postgres-0.7.1.tgz", - "integrity": "sha512-QTOQrzxkB+H37HrQ8n7uxuXQb9Q4/L8sibMuO98dNvkIv79iDmiy/jJ1rAcwn+D/6In3LnXAoH6S+XL6rpi8tQ==", - "dependencies": { - "@neondatabase/serverless": "0.7.2", - "bufferutil": "4.0.8", - "utf-8-validate": "6.0.3", - "ws": "8.14.2" - }, - "engines": { - "node": ">=14.6" - } - }, - "node_modules/@vercel/postgres-kysely": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@vercel/postgres-kysely/-/postgres-kysely-0.7.1.tgz", - "integrity": "sha512-HjWRWwreJTLfOP8Kio/naflXCqXY9mL7adn/Tv62XCjBwE6DNutU8LoDH072vt2A2Xqv0nmT794ORTidFLnvCg==", - "dependencies": { - "@vercel/postgres": "0.7.1" - }, - "engines": { - "node": ">=14.6" - }, - "peerDependencies": { - "kysely": "^0.24.2 || ^0.25.0 || ^0.26.0" - } - }, - "node_modules/@vercel/speed-insights": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@vercel/speed-insights/-/speed-insights-1.0.12.tgz", - "integrity": "sha512-ZGQ+a7bcfWJD2VYEp2R1LHvRAMyyaFBYytZXsfnbOMkeOvzGNVxUL7aVUvisIrTZjXTSsxG45DKX7yiw6nq2Jw==", - "hasInstallScript": true, - "peerDependencies": { - "@sveltejs/kit": "^1 || ^2", - "next": ">= 13", - "react": "^18 || ^19", - "svelte": "^4", - "vue": "^3", - "vue-router": "^4" - }, - "peerDependenciesMeta": { - "@sveltejs/kit": { - "optional": true - }, - "next": { - "optional": true - }, - "react": { - "optional": true - }, - "svelte": { - "optional": true - }, - "vue": { - "optional": true - }, - "vue-router": { - "optional": true - } - } - }, "node_modules/@vitest/expect": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", @@ -9524,7 +9497,10 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", + "dev": true, "hasInstallScript": true, + "optional": true, + "peer": true, "dependencies": { "node-gyp-build": "^4.3.0" }, @@ -16472,6 +16448,9 @@ "version": "4.8.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz", "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==", + "dev": true, + "optional": true, + "peer": true, "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -16909,6 +16888,13 @@ "integrity": "sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==", "dev": true }, + "node_modules/obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true, + "license": "MIT" + }, "node_modules/ohash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.3.tgz", @@ -17296,23 +17282,85 @@ "through2": "^2.0.3" } }, + "node_modules/pg": { + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.13.1.tgz", + "integrity": "sha512-OUir1A0rPNZlX//c7ksiu7crsGZTKSOXJPgtNiHGIlC9H0lO+NC6ZDYksSgBYY/thSWhnSRBv8w1lieNNGATNQ==", + "license": "MIT", + "dependencies": { + "pg-connection-string": "^2.7.0", + "pg-pool": "^3.7.0", + "pg-protocol": "^1.7.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + }, + "engines": { + "node": ">= 8.0.0" + }, + "optionalDependencies": { + "pg-cloudflare": "^1.1.1" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-cloudflare": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", + "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "license": "MIT", + "optional": true + }, + "node_modules/pg-connection-string": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.7.0.tgz", + "integrity": "sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==", + "license": "MIT" + }, "node_modules/pg-int8": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "license": "ISC", "engines": { "node": ">=4.0.0" } }, + "node_modules/pg-numeric": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz", + "integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=4" + } + }, + "node_modules/pg-pool": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.7.0.tgz", + "integrity": "sha512-ZOBQForurqh4zZWjrgSwwAtzJ7QiRX0ovFkZr2klsen3Nm0aoh33Ls0fzfv3imeH/nw/O27cjdz5kzYJfeGp/g==", + "license": "MIT", + "peerDependencies": { + "pg": ">=8.0" + } + }, "node_modules/pg-protocol": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", - "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.7.0.tgz", + "integrity": "sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ==", + "license": "MIT" }, "node_modules/pg-types": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "license": "MIT", "dependencies": { "pg-int8": "1.0.1", "postgres-array": "~2.0.0", @@ -17324,6 +17372,15 @@ "node": ">=4" } }, + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "license": "MIT", + "dependencies": { + "split2": "^4.1.0" + } + }, "node_modules/picocolors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", @@ -17723,6 +17780,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "license": "MIT", "engines": { "node": ">=4" } @@ -17731,6 +17789,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -17739,6 +17798,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -17747,6 +17807,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "license": "MIT", "dependencies": { "xtend": "^4.0.0" }, @@ -17754,6 +17815,13 @@ "node": ">=0.10.0" } }, + "node_modules/postgres-range": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.4.tgz", + "integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==", + "dev": true, + "license": "MIT" + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -19402,6 +19470,15 @@ "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", "dev": true }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -21366,7 +21443,10 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.3.tgz", "integrity": "sha512-uIuGf9TWQ/y+0Lp+KGZCMuJWc3N9BHA+l/UmHd/oUHwJJDeysyTRxNQVkbzsIWfGFbRe3OcgML/i0mvVRPOyDA==", + "dev": true, "hasInstallScript": true, + "optional": true, + "peer": true, "dependencies": { "node-gyp-build": "^4.3.0" }, @@ -22140,6 +22220,7 @@ "version": "8.14.2", "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "dev": true, "engines": { "node": ">=10.0.0" }, diff --git a/package.json b/package.json index 2f35986..6e22dbb 100644 --- a/package.json +++ b/package.json @@ -30,14 +30,12 @@ "dependencies": { "@ducanh2912/next-pwa": "^10.2.7", "@hookform/resolvers": "^3.7.0", - "@vercel/analytics": "^1.3.1", - "@vercel/postgres-kysely": "^0.7.1", - "@vercel/speed-insights": "^1.0.12", "clsx": "^2.1.1", "date-fns": "^3.6.0", "jose": "^5.6.3", "kysely": "^0.26.3", "next": "14.2.4", + "pg": "^8.13.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-hook-form": "^7.52.1", @@ -62,6 +60,7 @@ "@types/jest": "^29.5.12", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^20.14.9", + "@types/pg": "^8.11.10", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@types/uuid": "^10.0.0", diff --git a/src/db/database.constant.ts b/src/db/database.constant.ts index f3cc98c..18be890 100644 --- a/src/db/database.constant.ts +++ b/src/db/database.constant.ts @@ -1,4 +1,13 @@ -import { createKysely } from '@vercel/postgres-kysely'; import type { Database } from '@/db/database.types'; +import { Kysely, PostgresDialect } from 'kysely'; +import pg from 'pg'; -export const db = createKysely(); +export const db = new Kysely({ + log: ['query', 'error'], + dialect: new PostgresDialect({ + pool: new pg.Pool({ + connectionString: process.env.POSTGRES_URL, + max: 10, + }), + }), +}); From 826b8464e501143d6b1d7a4ec35405cce5b5e622 Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Mon, 13 Jan 2025 12:33:28 +0400 Subject: [PATCH 03/31] ci: local db --- docker-compose.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..89765e4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +services: + postgres: + image: "postgres:latest" + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + ports: + - "5432:5432" + healthcheck: + test: [ "CMD-SHELL", "sh -c 'pg_isready -U postgres -d postgres'" ] + interval: 10s + timeout: 3s + retries: 3 + + pgadmin: + image: adminer + ports: + - "80:8080" + depends_on: + - postgres From 42268b042aec22b1910633cd99535c721f5f443f Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Mon, 13 Jan 2025 12:34:01 +0400 Subject: [PATCH 04/31] refactor: remove edge route config --- src/app/api/account/login/route.ts | 2 -- src/app/apple-icon.tsx | 2 -- src/app/icon.tsx | 2 -- 3 files changed, 6 deletions(-) diff --git a/src/app/api/account/login/route.ts b/src/app/api/account/login/route.ts index b02c63f..611a67c 100644 --- a/src/app/api/account/login/route.ts +++ b/src/app/api/account/login/route.ts @@ -24,6 +24,4 @@ const AccountLogin = async (req: NextRequest) => { } }; -export const runtime = 'edge'; - export { AccountLogin as GET }; diff --git a/src/app/apple-icon.tsx b/src/app/apple-icon.tsx index 49f70ab..a1a23f2 100644 --- a/src/app/apple-icon.tsx +++ b/src/app/apple-icon.tsx @@ -18,7 +18,5 @@ const IconResponse = ({ id }: { id: string }) => { }); }; -export const runtime = 'edge'; - export default IconResponse; export { generateImageMetadata }; diff --git a/src/app/icon.tsx b/src/app/icon.tsx index de14c20..29f1556 100644 --- a/src/app/icon.tsx +++ b/src/app/icon.tsx @@ -18,7 +18,5 @@ const IconResponse = ({ id }: { id: string }) => { }); }; -export const runtime = 'edge'; - export default IconResponse; export { generateImageMetadata }; From 238eb11132a7aa07a84bb8b989d5c56004b69955 Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Mon, 13 Jan 2025 12:34:20 +0400 Subject: [PATCH 05/31] refactor: remove vercel analytics --- src/app/layout.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index d3c1554..4f8ab71 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -4,8 +4,6 @@ import type { FC, PropsWithChildren } from 'react'; import { Roboto } from 'next/font/google'; import { clsx } from 'clsx'; import metaConfig from '@/meta-config.cjs'; -import { Analytics } from '@vercel/analytics/react'; -import { SpeedInsights } from '@vercel/speed-insights/next'; import { configFactory } from '@/config'; const roboto = Roboto({ @@ -17,11 +15,7 @@ const roboto = Roboto({ const RootLayout: FC = ({ children }) => ( - - {children} - - - + {children} ); @@ -51,7 +45,5 @@ const viewport: Viewport = { ], }; -// export const runtime = 'edge'; - export default RootLayout; export { metadata, viewport }; From 0774f17557429916f116b282bb2fe8e2826f0938 Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Mon, 13 Jan 2025 12:34:29 +0400 Subject: [PATCH 06/31] refactor: remove edge route config --- src/app/api/account/logout/route.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/api/account/logout/route.ts b/src/app/api/account/logout/route.ts index e7c5524..08decf3 100644 --- a/src/app/api/account/logout/route.ts +++ b/src/app/api/account/logout/route.ts @@ -14,6 +14,4 @@ const AccountLogout = async (req: NextRequest) => { } }; -export const runtime = 'edge'; - export { AccountLogout as GET }; From b9e63bf2949af487b51dc980b05699f5658dce38 Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Mon, 13 Jan 2025 12:34:42 +0400 Subject: [PATCH 07/31] fix: url href to link --- src/oauth/components/oauth-login-link.component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oauth/components/oauth-login-link.component.tsx b/src/oauth/components/oauth-login-link.component.tsx index 5e995f1..9fcff42 100644 --- a/src/oauth/components/oauth-login-link.component.tsx +++ b/src/oauth/components/oauth-login-link.component.tsx @@ -25,7 +25,7 @@ const OauthLoginLink: FC = ({ oauthUrl.searchParams.append('uuid', uuid()); return ( - + {children} ); From 39bdd79d34c638a1c26964f2ac4b98af4cfaf14d Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Mon, 13 Jan 2025 12:34:54 +0400 Subject: [PATCH 08/31] refactor: env --- .env | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.env b/.env index 32ffe1d..f7f02cb 100644 --- a/.env +++ b/.env @@ -1,14 +1,16 @@ CANONICAL_BASE_URL=http://localhost:3000 -VK_ID_API_URL= -VK_ID_APP_ID= -VK_ID_SERVICE_TOKEN= -VK_ID_REDIRECT_URL= +VK_ID_API_URL=https://id.vk.com +VK_ID_APP_ID='secret to be replaced' +VK_ID_SERVICE_TOKEN='secret to be replaced' +VK_ID_REDIRECT_URL=http://localhost:3000 -VK_API_URL= -VK_API_VERSION= +VK_API_URL=https://api.vk.com +VK_API_VERSION=5.199 JWT_SECRET='secret to be replaced' # storybook prevent to open new browser window on startup BROWSER=none + +REACT_EDITOR=webstorm From d7487eb9d1faa5f2250afc34fabddf181d0b0d6e Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Mon, 13 Jan 2025 12:35:06 +0400 Subject: [PATCH 09/31] ci: self hosted mod --- next.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/next.config.js b/next.config.js index 5846e94..6a4f36e 100644 --- a/next.config.js +++ b/next.config.js @@ -8,6 +8,7 @@ const pwaConfig = withPWA({ /** @type {import('next').NextConfig} */ const nextConfig = { + output: 'standalone', images: { remotePatterns: [ { From 55196f7032a84cdca29469e136a191dea7e46503 Mon Sep 17 00:00:00 2001 From: Marcus-Rise Date: Mon, 13 Jan 2025 14:09:41 +0400 Subject: [PATCH 10/31] refactor: oauth via vk id --- .env | 5 +- docker-compose.yml | 4 +- package-lock.json | 130 +++++++++-------- package.json | 6 +- scripts/migrate.ts | 3 +- src/app/account/login/page.tsx | 17 +-- src/app/api/account/login/route.ts | 10 +- src/auth/jwt/jwt.service.ts | 2 - src/auth/service/auth.service.ts | 4 +- src/config/config.interface.ts | 2 - src/config/config.ts | 2 - .../components/oauth-login-link.component.tsx | 34 ----- src/oauth/config/oauth-config.interface.ts | 7 +- src/oauth/config/oauth.config.ts | 19 +-- src/oauth/oauth-credentials-dto.factory.ts | 8 +- src/oauth/oauth.helper.ts | 26 ++++ src/oauth/oauth.types.ts | 81 ++++------ src/oauth/service/index.ts | 2 - src/oauth/service/oauth-service.interface.ts | 12 +- src/oauth/service/oauth.service.ts | 138 +++++++++++------- .../profile/user-profile.component.tsx | 7 +- src/user/service/index.ts | 7 +- src/user/service/user.service.ts | 34 ++--- src/user/user.types.ts | 12 +- 24 files changed, 275 insertions(+), 297 deletions(-) delete mode 100644 src/oauth/components/oauth-login-link.component.tsx create mode 100644 src/oauth/oauth.helper.ts diff --git a/.env b/.env index f7f02cb..eb85828 100644 --- a/.env +++ b/.env @@ -1,12 +1,9 @@ CANONICAL_BASE_URL=http://localhost:3000 +VK_ID_REDIRECT_URL=http://localhost VK_ID_API_URL=https://id.vk.com VK_ID_APP_ID='secret to be replaced' VK_ID_SERVICE_TOKEN='secret to be replaced' -VK_ID_REDIRECT_URL=http://localhost:3000 - -VK_API_URL=https://api.vk.com -VK_API_VERSION=5.199 JWT_SECRET='secret to be replaced' diff --git a/docker-compose.yml b/docker-compose.yml index 89765e4..738996e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,13 +9,13 @@ services: - "5432:5432" healthcheck: test: [ "CMD-SHELL", "sh -c 'pg_isready -U postgres -d postgres'" ] - interval: 10s + interval: 5s timeout: 3s retries: 3 pgadmin: image: adminer ports: - - "80:8080" + - "8080:8080" depends_on: - postgres diff --git a/package-lock.json b/package-lock.json index c932f3c..1c54450 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,8 +13,8 @@ "clsx": "^2.1.1", "date-fns": "^3.6.0", "jose": "^5.6.3", - "kysely": "^0.26.3", - "next": "14.2.4", + "kysely": "^0.27.5", + "next": "~14.2.23", "pg": "^8.13.1", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -49,7 +49,7 @@ "dotenv-expand": "^10.0.0", "dotenv-flow": "^4.1.0", "eslint": "^8.57.0", - "eslint-config-next": "14.2.4", + "eslint-config-next": "~14.2.23", "eslint-config-prettier": "^9.1.0", "eslint-plugin-storybook": "^0.8.0", "jest": "^29.7.0", @@ -3909,15 +3909,17 @@ } }, "node_modules/@next/env": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.4.tgz", - "integrity": "sha512-3EtkY5VDkuV2+lNmKlbkibIJxcO4oIHEhBWne6PaAp+76J9KoSsGvNikp6ivzAT8dhhBMYrm6op2pS1ApG0Hzg==" + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.23.tgz", + "integrity": "sha512-CysUC9IO+2Bh0omJ3qrb47S8DtsTKbFidGm6ow4gXIG6reZybqxbkH2nhdEm1tC8SmgzDdpq3BIML0PWsmyUYA==", + "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.4.tgz", - "integrity": "sha512-svSFxW9f3xDaZA3idQmlFw7SusOuWTpDTAeBlO3AEPDltrraV+lqs7mAc6A27YdnpQVVIA3sODqUAAHdWhVWsA==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.23.tgz", + "integrity": "sha512-efRC7m39GoiU1fXZRgGySqYbQi6ZyLkuGlvGst7IwkTTczehQTJA/7PoMg4MMjUZvZEGpiSEu+oJBAjPawiC3Q==", "dev": true, + "license": "MIT", "dependencies": { "glob": "10.3.10" } @@ -3927,6 +3929,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "dev": true, + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.3.5", @@ -3945,12 +3948,13 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.4.tgz", - "integrity": "sha512-AH3mO4JlFUqsYcwFUHb1wAKlebHU/Hv2u2kb1pAuRanDZ7pD/A/KPD98RHZmwsJpdHQwfEc/06mgpSzwrJYnNg==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.23.tgz", + "integrity": "sha512-WhtEntt6NcbABA8ypEoFd3uzq5iAnrl9AnZt9dXdO+PZLACE32z3a3qA5OoV20JrbJfSJ6Sd6EqGZTrlRnGxQQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -3960,12 +3964,13 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.4.tgz", - "integrity": "sha512-QVadW73sWIO6E2VroyUjuAxhWLZWEpiFqHdZdoQ/AMpN9YWGuHV8t2rChr0ahy+irKX5mlDU7OY68k3n4tAZTg==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.23.tgz", + "integrity": "sha512-vwLw0HN2gVclT/ikO6EcE+LcIN+0mddJ53yG4eZd0rXkuEr/RnOaMH8wg/sYl5iz5AYYRo/l6XX7FIo6kwbw1Q==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -3975,12 +3980,13 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.4.tgz", - "integrity": "sha512-KT6GUrb3oyCfcfJ+WliXuJnD6pCpZiosx2X3k66HLR+DMoilRb76LpWPGb4tZprawTtcnyrv75ElD6VncVamUQ==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.23.tgz", + "integrity": "sha512-uuAYwD3At2fu5CH1wD7FpP87mnjAv4+DNvLaR9kiIi8DLStWSW304kF09p1EQfhcbUI1Py2vZlBO2VaVqMRtpg==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -3990,12 +3996,13 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.4.tgz", - "integrity": "sha512-Alv8/XGSs/ytwQcbCHwze1HmiIkIVhDHYLjczSVrf0Wi2MvKn/blt7+S6FJitj3yTlMwMxII1gIJ9WepI4aZ/A==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.23.tgz", + "integrity": "sha512-Mm5KHd7nGgeJ4EETvVgFuqKOyDh+UMXHXxye6wRRFDr4FdVRI6YTxajoV2aHE8jqC14xeAMVZvLqYqS7isHL+g==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -4005,12 +4012,13 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.4.tgz", - "integrity": "sha512-ze0ShQDBPCqxLImzw4sCdfnB3lRmN3qGMB2GWDRlq5Wqy4G36pxtNOo2usu/Nm9+V2Rh/QQnrRc2l94kYFXO6Q==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.23.tgz", + "integrity": "sha512-Ybfqlyzm4sMSEQO6lDksggAIxnvWSG2cDWnG2jgd+MLbHYn2pvFA8DQ4pT2Vjk3Cwrv+HIg7vXJ8lCiLz79qoQ==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -4020,12 +4028,13 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.4.tgz", - "integrity": "sha512-8dwC0UJoc6fC7PX70csdaznVMNr16hQrTDAMPvLPloazlcaWfdPogq+UpZX6Drqb1OBlwowz8iG7WR0Tzk/diQ==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.23.tgz", + "integrity": "sha512-OSQX94sxd1gOUz3jhhdocnKsy4/peG8zV1HVaW6DLEbEmRRtUCUQZcKxUD9atLYa3RZA+YJx+WZdOnTkDuNDNA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -4035,12 +4044,13 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.4.tgz", - "integrity": "sha512-jxyg67NbEWkDyvM+O8UDbPAyYRZqGLQDTPwvrBBeOSyVWW/jFQkQKQ70JDqDSYg1ZDdl+E3nkbFbq8xM8E9x8A==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.23.tgz", + "integrity": "sha512-ezmbgZy++XpIMTcTNd0L4k7+cNI4ET5vMv/oqNfTuSXkZtSA9BURElPFyarjjGtRgZ9/zuKDHoMdZwDZIY3ehQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -4050,12 +4060,13 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.4.tgz", - "integrity": "sha512-twrmN753hjXRdcrZmZttb/m5xaCBFa48Dt3FbeEItpJArxriYDunWxJn+QFXdJ3hPkm4u7CKxncVvnmgQMY1ag==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.23.tgz", + "integrity": "sha512-zfHZOGguFCqAJ7zldTKg4tJHPJyJCOFhpoJcVxKL9BSUHScVDnMdDuOU1zPPGdOzr/GWxbhYTjyiEgLEpAoFPA==", "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -4065,12 +4076,13 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.4.tgz", - "integrity": "sha512-tkLrjBzqFTP8DVrAAQmZelEahfR9OxWpFR++vAI9FBhCiIxtwHwBHC23SBHCTURBtwB4kc/x44imVOnkKGNVGg==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.23.tgz", + "integrity": "sha512-xCtq5BD553SzOgSZ7UH5LH+OATQihydObTrCTvVzOro8QiWYKdBVwcB2Mn2MLMo6DGW9yH1LSPw7jS7HhgJgjw==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -11443,14 +11455,16 @@ } }, "node_modules/eslint-config-next": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.2.4.tgz", - "integrity": "sha512-Qr0wMgG9m6m4uYy2jrYJmyuNlYZzPRQq5Kvb9IDlYwn+7yq6W6sfMNFgb+9guM1KYwuIo6TIaiFhZJ6SnQ/Efw==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.2.23.tgz", + "integrity": "sha512-qtWJzOsDZxnLtXLNtnVjbutHmnEp6QTTSZBTlTCge/Wy0AsUaq8nwR91dBcZZvFg3eY3zKFPBhUkLMHu3Qpauw==", "dev": true, + "license": "MIT", "dependencies": { - "@next/eslint-plugin-next": "14.2.4", + "@next/eslint-plugin-next": "14.2.23", "@rushstack/eslint-patch": "^1.3.3", - "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0", + "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.28.1", @@ -15706,9 +15720,10 @@ } }, "node_modules/kysely": { - "version": "0.26.3", - "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.26.3.tgz", - "integrity": "sha512-yWSgGi9bY13b/W06DD2OCDDHQmq1kwTGYlQ4wpZkMOJqMGCstVCFIvxCCVG4KfY1/3G0MhDAcZsip/Lw8/vJWw==", + "version": "0.27.5", + "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.27.5.tgz", + "integrity": "sha512-s7hZHcQeSNKpzCkHRm8yA+0JPLjncSWnjb+2TIElwS2JAqYr+Kv3Ess+9KFfJS0C1xcQ1i9NkNHpWwCYpHMWsA==", + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -16271,11 +16286,12 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, "node_modules/next": { - "version": "14.2.4", - "resolved": "https://registry.npmjs.org/next/-/next-14.2.4.tgz", - "integrity": "sha512-R8/V7vugY+822rsQGQCjoLhMuC9oFj9SOi4Cl4b2wjDrseD0LRZ10W7R6Czo4w9ZznVSshKjuIomsRjvm9EKJQ==", + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.23.tgz", + "integrity": "sha512-mjN3fE6u/tynneLiEg56XnthzuYw+kD7mCujgVqioxyPqbmiotUCGJpIZGS/VaPg3ZDT1tvWxiVyRzeqJFm/kw==", + "license": "MIT", "dependencies": { - "@next/env": "14.2.4", + "@next/env": "14.2.23", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", @@ -16290,15 +16306,15 @@ "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.2.4", - "@next/swc-darwin-x64": "14.2.4", - "@next/swc-linux-arm64-gnu": "14.2.4", - "@next/swc-linux-arm64-musl": "14.2.4", - "@next/swc-linux-x64-gnu": "14.2.4", - "@next/swc-linux-x64-musl": "14.2.4", - "@next/swc-win32-arm64-msvc": "14.2.4", - "@next/swc-win32-ia32-msvc": "14.2.4", - "@next/swc-win32-x64-msvc": "14.2.4" + "@next/swc-darwin-arm64": "14.2.23", + "@next/swc-darwin-x64": "14.2.23", + "@next/swc-linux-arm64-gnu": "14.2.23", + "@next/swc-linux-arm64-musl": "14.2.23", + "@next/swc-linux-x64-gnu": "14.2.23", + "@next/swc-linux-x64-musl": "14.2.23", + "@next/swc-win32-arm64-msvc": "14.2.23", + "@next/swc-win32-ia32-msvc": "14.2.23", + "@next/swc-win32-x64-msvc": "14.2.23" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", diff --git a/package.json b/package.json index 6e22dbb..0947188 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "clsx": "^2.1.1", "date-fns": "^3.6.0", "jose": "^5.6.3", - "kysely": "^0.26.3", - "next": "14.2.4", + "kysely": "^0.27.5", + "next": "~14.2.23", "pg": "^8.13.1", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -69,7 +69,7 @@ "dotenv-expand": "^10.0.0", "dotenv-flow": "^4.1.0", "eslint": "^8.57.0", - "eslint-config-next": "14.2.4", + "eslint-config-next": "~14.2.23", "eslint-config-prettier": "^9.1.0", "eslint-plugin-storybook": "^0.8.0", "jest": "^29.7.0", diff --git a/scripts/migrate.ts b/scripts/migrate.ts index efe0e80..41480ed 100644 --- a/scripts/migrate.ts +++ b/scripts/migrate.ts @@ -35,8 +35,7 @@ async function migrateToLatest() { }); if (error) { - console.error('failed to migrate'); - console.error(error); + console.error('failed to migrate', error); process.exit(1); } diff --git a/src/app/account/login/page.tsx b/src/app/account/login/page.tsx index 3de2636..5325887 100644 --- a/src/app/account/login/page.tsx +++ b/src/app/account/login/page.tsx @@ -1,16 +1,15 @@ import type { FC } from 'react'; import { OauthVkLoginButton } from '@/oauth/components/vk-login-button'; -import { oauthConfigFactory } from '@/oauth/config'; -import { OauthLoginLink } from '@/oauth/components/oauth-login-link.component'; import Link from 'next/link'; import metaConfig from '@/meta-config.cjs'; import { Footer } from '@/components/footer.component'; import { LogoImage } from '@/components/logo-image.component'; +import { oauthService } from '@/oauth/service'; const LogoSize = 128; -const Login: FC = () => { - const { appId, redirectUrl, idApiUrl } = oauthConfigFactory(); +const Login: FC = async () => { + const loginUrl = await oauthService.getLoginUrl(); return (
@@ -24,15 +23,9 @@ const Login: FC = () => {

Добро пожаловать!

- + - +