From c87ac09454a1a5748194b4b18bf6d7d41c636e9a Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Thu, 10 Oct 2024 18:43:14 +0200 Subject: [PATCH 01/25] start --- src/App.jsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index b1d9af3c..ecc34612 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,7 +1,5 @@ -const App = () => { - return ( -
Hello World
- ) +function App() { + return
Hello World
; } -export default App \ No newline at end of file +export default App; From 25f3ea53f7cc1aad0a1c0663936d487cc318046a Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Thu, 10 Oct 2024 19:50:49 +0200 Subject: [PATCH 02/25] deploy --- src/index.css | 17 +++++++++++++++++ src/routes/chatPage/ChatPage.jsx | 7 +++++++ src/routes/chatPage/chatPage.css | 0 src/routes/dashboardPage/DashboardPage.jsx | 7 +++++++ src/routes/dashboardPage/dashboardPage.css | 0 src/routes/homepage/HomePage.jsx | 7 +++++++ src/routes/homepage/homepage.css | 0 src/routes/signInPage/SignInPage.jsx | 7 +++++++ src/routes/signInPage/signInPage.css | 0 src/routes/signUpPage/SignUpPage.jsx | 7 +++++++ src/routes/signUpPage/signUpPage.css | 0 11 files changed, 52 insertions(+) create mode 100644 src/routes/chatPage/ChatPage.jsx create mode 100644 src/routes/chatPage/chatPage.css create mode 100644 src/routes/dashboardPage/DashboardPage.jsx create mode 100644 src/routes/dashboardPage/dashboardPage.css create mode 100644 src/routes/homepage/HomePage.jsx create mode 100644 src/routes/homepage/homepage.css create mode 100644 src/routes/signInPage/SignInPage.jsx create mode 100644 src/routes/signInPage/signInPage.css create mode 100644 src/routes/signUpPage/SignUpPage.jsx create mode 100644 src/routes/signUpPage/signUpPage.css diff --git a/src/index.css b/src/index.css index e69de29b..ea5b94ec 100644 --- a/src/index.css +++ b/src/index.css @@ -0,0 +1,17 @@ +* { + padding: 0; + margin: 0; + box-sizing: 0; +} + +body { + background-color: #0e0c16; + color: #ececec; + font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, + Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; +} + +a { + text-decoration: none; + color: inherit; +} diff --git a/src/routes/chatPage/ChatPage.jsx b/src/routes/chatPage/ChatPage.jsx new file mode 100644 index 00000000..39c0815a --- /dev/null +++ b/src/routes/chatPage/ChatPage.jsx @@ -0,0 +1,7 @@ +import "./chatPage.css"; + +function ChatPage() { + return
; +} + +export default ChatPage; diff --git a/src/routes/chatPage/chatPage.css b/src/routes/chatPage/chatPage.css new file mode 100644 index 00000000..e69de29b diff --git a/src/routes/dashboardPage/DashboardPage.jsx b/src/routes/dashboardPage/DashboardPage.jsx new file mode 100644 index 00000000..a7a690c3 --- /dev/null +++ b/src/routes/dashboardPage/DashboardPage.jsx @@ -0,0 +1,7 @@ +import "./dashboardPage.css"; + +function dashboardPage() { + return
; +} + +export default dashboardPage; diff --git a/src/routes/dashboardPage/dashboardPage.css b/src/routes/dashboardPage/dashboardPage.css new file mode 100644 index 00000000..e69de29b diff --git a/src/routes/homepage/HomePage.jsx b/src/routes/homepage/HomePage.jsx new file mode 100644 index 00000000..96e2f9ca --- /dev/null +++ b/src/routes/homepage/HomePage.jsx @@ -0,0 +1,7 @@ +import "./homepage.css"; + +function Homepage() { + return
Homepage
; +} + +export default Homepage; diff --git a/src/routes/homepage/homepage.css b/src/routes/homepage/homepage.css new file mode 100644 index 00000000..e69de29b diff --git a/src/routes/signInPage/SignInPage.jsx b/src/routes/signInPage/SignInPage.jsx new file mode 100644 index 00000000..f7693a3c --- /dev/null +++ b/src/routes/signInPage/SignInPage.jsx @@ -0,0 +1,7 @@ +import "./signInPage.css"; + +function SignInPage() { + return
; +} + +export default SignInPage; diff --git a/src/routes/signInPage/signInPage.css b/src/routes/signInPage/signInPage.css new file mode 100644 index 00000000..e69de29b diff --git a/src/routes/signUpPage/SignUpPage.jsx b/src/routes/signUpPage/SignUpPage.jsx new file mode 100644 index 00000000..324a2fd5 --- /dev/null +++ b/src/routes/signUpPage/SignUpPage.jsx @@ -0,0 +1,7 @@ +import "./signUpPage.css"; + +function SignUpPage() { + return
; +} + +export default SignUpPage; diff --git a/src/routes/signUpPage/signUpPage.css b/src/routes/signUpPage/signUpPage.css new file mode 100644 index 00000000..e69de29b From e49bd3080f9a10ab45e63e2cf90447354b754e14 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Fri, 11 Oct 2024 09:15:24 +0200 Subject: [PATCH 03/25] commit --- src/main.jsx | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/main.jsx b/src/main.jsx index 54b39dd1..731f7509 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,10 +1,32 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App.jsx' -import './index.css' +import * as React from "react"; +import ReactDOM from "react-dom/client"; +import "./index.css"; +import { createRoot } from "react-dom/client"; +import { + createBrowserRouter, + RouterProvider, + // Route, + // Link, +} from "react-router-dom"; +import "./index.css"; +import HomePage from "../src/routes/homepage/HomePage.jsx"; +import Dashboard from "../src/routes/dashboardPage/DashboardPage.jsx"; +import ChatPage from "./routes/chatPage/ChatPage"; -ReactDOM.createRoot(document.getElementById('root')).render( +const router = createBrowserRouter([ + { + path: "/", + element: , + }, + { + path: "/dashboard", + element: , + children: [{ path: "/dashboard/chats/:id", element: }], + }, +]); + +ReactDOM.createRoot(document.getElementById("root")).render( - - , -) + + +); From f1ae9400f5aadc5de39239b83064a0b9d2e4a6b0 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Fri, 11 Oct 2024 21:30:34 +0200 Subject: [PATCH 04/25] commit --- package-lock.json | 44 +++++++++++++++++-- package.json | 5 ++- .../dashboardLayout/DashboardLayout.jsx | 15 +++++++ .../dashboardLayout/dashboardLayout.css | 0 src/layouts/rootLayout/RootLayout.jsx | 20 +++++++++ src/layouts/rootLayout/rootLayout.css | 0 src/main.jsx | 31 ++++++++----- src/routes/dashboardPage/DashboardPage.jsx | 4 +- 8 files changed, 102 insertions(+), 17 deletions(-) create mode 100644 src/layouts/dashboardLayout/DashboardLayout.jsx create mode 100644 src/layouts/dashboardLayout/dashboardLayout.css create mode 100644 src/layouts/rootLayout/RootLayout.jsx create mode 100644 src/layouts/rootLayout/rootLayout.css diff --git a/package-lock.json b/package-lock.json index 21cb0afa..c60ef99d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,8 +8,9 @@ "name": "aichatstarter", "version": "0.0.0", "dependencies": { - "react": "19.0.0-rc-8b08e99e-20240713", - "react-dom": "19.0.0-rc-8b08e99e-20240713" + "react": "^19.0.0-rc-8b08e99e-20240713", + "react-dom": "19.0.0-rc-8b08e99e-20240713", + "react-router-dom": "^6.27.0" }, "devDependencies": { "@types/react": "^18.3.3", @@ -988,6 +989,14 @@ "node": ">= 8" } }, + "node_modules/@remix-run/router": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.20.0.tgz", + "integrity": "sha512-mUnk8rPJBI9loFDZ+YzPGdeniYK+FTmRD1TMCz7ev2SNIozyKKpnGgsxO34u6Z4z/t0ITuu7voi/AshfsGsgFg==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.18.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz", @@ -3769,7 +3778,6 @@ "version": "19.0.0-rc-8b08e99e-20240713", "resolved": "https://registry.npmjs.org/react/-/react-19.0.0-rc-8b08e99e-20240713.tgz", "integrity": "sha512-j56t3i/sMNftehdO/cA0kFeKDh9Pi1FxKba6u0sRgzZ73HVWii64oUbFxkUmf6I/C9uCmovY3HnFpT7/0UTIaw==", - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -3803,6 +3811,36 @@ "node": ">=0.10.0" } }, + "node_modules/react-router-dom": { + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.27.0.tgz", + "integrity": "sha512-+bvtFWMC0DgAFrfKXKG9Fc+BcXWRUO1aJIihbB79xaeq0v5UzfvnM5houGUm1Y461WVRcgAQ+Clh5rdb1eCx4g==", + "dependencies": { + "@remix-run/router": "1.20.0", + "react-router": "6.27.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, + "node_modules/react-router-dom/node_modules/react-router": { + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.27.0.tgz", + "integrity": "sha512-YA+HGZXz4jaAkVoYBE98VQl+nVzI+cVI2Oj/06F5ZM+0u3TgedN9Y9kmMRo2mnkSK2nCpNQn0DVob4HCsY/WLw==", + "dependencies": { + "@remix-run/router": "1.20.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", diff --git a/package.json b/package.json index 98faea3e..d02bb358 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "preview": "vite preview" }, "dependencies": { - "react": "19.0.0-rc-8b08e99e-20240713", - "react-dom": "19.0.0-rc-8b08e99e-20240713" + "react": "^19.0.0-rc-8b08e99e-20240713", + "react-dom": "19.0.0-rc-8b08e99e-20240713", + "react-router-dom": "^6.27.0" }, "devDependencies": { "@types/react": "^18.3.3", diff --git a/src/layouts/dashboardLayout/DashboardLayout.jsx b/src/layouts/dashboardLayout/DashboardLayout.jsx new file mode 100644 index 00000000..9b484a66 --- /dev/null +++ b/src/layouts/dashboardLayout/DashboardLayout.jsx @@ -0,0 +1,15 @@ +import { Outlet } from "react-router-dom"; +import "./dashboardLayout.css"; + +function DashboardLayout() { + return ( +
+
Menu
+
+ +
+
+ ); +} + +export default DashboardLayout; diff --git a/src/layouts/dashboardLayout/dashboardLayout.css b/src/layouts/dashboardLayout/dashboardLayout.css new file mode 100644 index 00000000..e69de29b diff --git a/src/layouts/rootLayout/RootLayout.jsx b/src/layouts/rootLayout/RootLayout.jsx new file mode 100644 index 00000000..b7fdbc4f --- /dev/null +++ b/src/layouts/rootLayout/RootLayout.jsx @@ -0,0 +1,20 @@ +import { Outlet, Link } from "react-router-dom"; +import "./rootLayout.css"; + +function RootLayout() { + return ( +
+
+ + logo + Lama AI + +
+
+ +
+
+ ); +} + +export default RootLayout; diff --git a/src/layouts/rootLayout/rootLayout.css b/src/layouts/rootLayout/rootLayout.css new file mode 100644 index 00000000..e69de29b diff --git a/src/main.jsx b/src/main.jsx index 731f7509..a29df0f9 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,5 +1,4 @@ import * as React from "react"; -import ReactDOM from "react-dom/client"; import "./index.css"; import { createRoot } from "react-dom/client"; import { @@ -9,23 +8,35 @@ import { // Link, } from "react-router-dom"; import "./index.css"; +import RootLayout from "../src/layouts/rootLayout/RootLayout.jsx"; import HomePage from "../src/routes/homepage/HomePage.jsx"; -import Dashboard from "../src/routes/dashboardPage/DashboardPage.jsx"; +import DashboardPage from "../src/routes/dashboardPage/DashboardPage.jsx"; import ChatPage from "./routes/chatPage/ChatPage"; +import DashboardLayout from "../src/layouts/dashboardLayout/DashboardLayout.jsx"; const router = createBrowserRouter([ { - path: "/", - element: , - }, - { - path: "/dashboard", - element: , - children: [{ path: "/dashboard/chats/:id", element: }], + element: , + children: [ + { path: "/", element: }, + { + element: , + children: [ + { + path: "/dashboard", + element: , + }, + { + path: "/dashboard/chats/:id", + element: , + }, + ], + }, + ], }, ]); -ReactDOM.createRoot(document.getElementById("root")).render( +createRoot(document.getElementById("root")).render( diff --git a/src/routes/dashboardPage/DashboardPage.jsx b/src/routes/dashboardPage/DashboardPage.jsx index a7a690c3..58e180ad 100644 --- a/src/routes/dashboardPage/DashboardPage.jsx +++ b/src/routes/dashboardPage/DashboardPage.jsx @@ -1,7 +1,7 @@ import "./dashboardPage.css"; -function dashboardPage() { +function DashboardPage() { return
; } -export default dashboardPage; +export default DashboardPage; From 3f8373c59e656c3b14c2036ee96b7724275f9d8e Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sat, 12 Oct 2024 20:27:58 +0200 Subject: [PATCH 05/25] adding style and implement clerk --- .gitignore | 1 + package-lock.json | 110 ++++++++++++++++++ package.json | 1 + .../dashboardLayout/dashboardLayout.css | 29 +++++ src/layouts/rootLayout/RootLayout.jsx | 1 + src/main.jsx | 15 +-- 6 files changed, 150 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a547bf36..438657a9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ node_modules dist dist-ssr *.local +.env # Editor directories and files .vscode/* diff --git a/package-lock.json b/package-lock.json index c60ef99d..a4746529 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "aichatstarter", "version": "0.0.0", "dependencies": { + "@clerk/clerk-react": "^5.11.0", "react": "^19.0.0-rc-8b08e99e-20240713", "react-dom": "19.0.0-rc-8b08e99e-20240713", "react-router-dom": "^6.27.0" @@ -393,6 +394,87 @@ "node": ">=6.9.0" } }, + "node_modules/@clerk/clerk-react": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@clerk/clerk-react/-/clerk-react-5.11.0.tgz", + "integrity": "sha512-JPvDxSPMV1Rrnh5k1ULxeemvUW+F5YdVUQAUhPPl/iZ6MHO6vXr5jn66xe0hM+wrw/snGlsrD9ePyy6tK8EDKw==", + "dependencies": { + "@clerk/shared": "2.9.0", + "@clerk/types": "4.25.0", + "tslib": "2.4.1" + }, + "engines": { + "node": ">=18.17.0" + }, + "peerDependencies": { + "react": ">=18 || >=19.0.0-beta", + "react-dom": ">=18 || >=19.0.0-beta" + } + }, + "node_modules/@clerk/shared": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-2.9.0.tgz", + "integrity": "sha512-DAqxJbmQ3QnQXZepG2InLC7Hdq+4T9/+A/kwtMQtAyQcsZoDwZ1TqVJkrqZ55lJIAkR97HEn3/g+g1ySspdEfA==", + "hasInstallScript": true, + "dependencies": { + "@clerk/types": "4.25.0", + "glob-to-regexp": "0.4.1", + "js-cookie": "3.0.5", + "std-env": "^3.7.0", + "swr": "^2.2.0" + }, + "engines": { + "node": ">=18.17.0" + }, + "peerDependencies": { + "react": ">=18 || >=19.0.0-beta", + "react-dom": ">=18 || >=19.0.0-beta" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/@clerk/shared/node_modules/swr": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/swr/-/swr-2.2.5.tgz", + "integrity": "sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg==", + "dependencies": { + "client-only": "^0.0.1", + "use-sync-external-store": "^1.2.0" + }, + "peerDependencies": { + "react": "^16.11.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@clerk/shared/node_modules/swr/node_modules/use-sync-external-store": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", + "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@clerk/types": { + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/@clerk/types/-/types-4.25.0.tgz", + "integrity": "sha512-p2IyJ0q5WF1e976L1pS1J6Mb5ducfkUC31DR1EvMjPwJkrlWJdAMCPc+zqRRAePVy/JBVK2gEKbUVtJ6/jrpag==", + "dependencies": { + "csstype": "3.1.1" + }, + "engines": { + "node": ">=18.17.0" + } + }, + "node_modules/@clerk/types/node_modules/csstype": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", + "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -1681,6 +1763,11 @@ "node": ">=4" } }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -2656,6 +2743,11 @@ "node": ">=10.13.0" } }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -3255,6 +3347,14 @@ "set-function-name": "^2.0.1" } }, + "node_modules/js-cookie": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", + "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==", + "engines": { + "node": ">=14" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4137,6 +4237,11 @@ "node": ">=0.10.0" } }, + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==" + }, "node_modules/string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -4296,6 +4401,11 @@ "node": ">=4" } }, + "node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index d02bb358..f1bd2340 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@clerk/clerk-react": "^5.11.0", "react": "^19.0.0-rc-8b08e99e-20240713", "react-dom": "19.0.0-rc-8b08e99e-20240713", "react-router-dom": "^6.27.0" diff --git a/src/layouts/dashboardLayout/dashboardLayout.css b/src/layouts/dashboardLayout/dashboardLayout.css index e69de29b..d23b9f91 100644 --- a/src/layouts/dashboardLayout/dashboardLayout.css +++ b/src/layouts/dashboardLayout/dashboardLayout.css @@ -0,0 +1,29 @@ +.rootLayout { + padding: 14px 64px; + height: 100vh; + display: flex; + flex-direction: column; +} + +header { + display: flex; + align-items: center; + justify-content: space-between; +} + +.logo { + display: flex; + align-items: center; + font-weight: bold; + gap: 8px; +} + +img { + width: 32px; + height: 32px; +} + +main { + flex: 1; + overflow: hidden; +} diff --git a/src/layouts/rootLayout/RootLayout.jsx b/src/layouts/rootLayout/RootLayout.jsx index b7fdbc4f..53bee79f 100644 --- a/src/layouts/rootLayout/RootLayout.jsx +++ b/src/layouts/rootLayout/RootLayout.jsx @@ -9,6 +9,7 @@ function RootLayout() { logo Lama AI +
user
diff --git a/src/main.jsx b/src/main.jsx index a29df0f9..a17f3840 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,19 +1,20 @@ import * as React from "react"; import "./index.css"; import { createRoot } from "react-dom/client"; -import { - createBrowserRouter, - RouterProvider, - // Route, - // Link, -} from "react-router-dom"; +import { createBrowserRouter, RouterProvider } from "react-router-dom"; import "./index.css"; -import RootLayout from "../src/layouts/rootLayout/RootLayout.jsx"; +import RootLayout from "./layouts/rootLayout/rootLayout.jsx"; import HomePage from "../src/routes/homepage/HomePage.jsx"; import DashboardPage from "../src/routes/dashboardPage/DashboardPage.jsx"; import ChatPage from "./routes/chatPage/ChatPage"; import DashboardLayout from "../src/layouts/dashboardLayout/DashboardLayout.jsx"; +const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY; + +if (!PUBLISHABLE_KEY) { + throw new Error("Missing Publishable Key"); +} + const router = createBrowserRouter([ { element: , From 2df21fd2f4f9b21334ddd7041329c9a6e99c6bb2 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sat, 12 Oct 2024 20:50:05 +0200 Subject: [PATCH 06/25] adding auth --- src/layouts/rootLayout/RootLayout.jsx | 46 ++++++++++++++++------ src/main.jsx | 10 ++--- src/routes/dashboardPage/DashboardPage.jsx | 24 ++++++++++- src/routes/homepage/HomePage.jsx | 7 +++- src/routes/signInPage/SignInPage.jsx | 7 +++- src/routes/signInPage/signInPage.css | 6 +++ src/routes/signUpPage/SignUpPage.jsx | 7 +++- src/routes/signUpPage/signUpPage.css | 6 +++ 8 files changed, 91 insertions(+), 22 deletions(-) diff --git a/src/layouts/rootLayout/RootLayout.jsx b/src/layouts/rootLayout/RootLayout.jsx index 53bee79f..751e2adc 100644 --- a/src/layouts/rootLayout/RootLayout.jsx +++ b/src/layouts/rootLayout/RootLayout.jsx @@ -1,20 +1,42 @@ +import { + ClerkProvider, + SignedIn, + SignedOut, + SignInButton, + UserButton, +} from "@clerk/clerk-react"; import { Outlet, Link } from "react-router-dom"; import "./rootLayout.css"; +const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY; + +if (!PUBLISHABLE_KEY) { + throw new Error("Missing Publishable Key"); +} + function RootLayout() { return ( -
-
- - logo - Lama AI - -
user
-
-
- -
-
+ +
+
+ + logo + Lama AI + +
+ + + + + + +
+
+
+ +
+
+
); } diff --git a/src/main.jsx b/src/main.jsx index a17f3840..96dc3b14 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -8,18 +8,16 @@ import HomePage from "../src/routes/homepage/HomePage.jsx"; import DashboardPage from "../src/routes/dashboardPage/DashboardPage.jsx"; import ChatPage from "./routes/chatPage/ChatPage"; import DashboardLayout from "../src/layouts/dashboardLayout/DashboardLayout.jsx"; - -const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY; - -if (!PUBLISHABLE_KEY) { - throw new Error("Missing Publishable Key"); -} +import SignInPage from "../src/routes/signInPage/SignInPage.jsx"; +import SignUpPage from "../src/routes/signUpPage/SignUpPage.jsx"; const router = createBrowserRouter([ { element: , children: [ { path: "/", element: }, + { path: "/sign-in/*", element: }, + { path: "/sign-up/*", element: }, { element: , children: [ diff --git a/src/routes/dashboardPage/DashboardPage.jsx b/src/routes/dashboardPage/DashboardPage.jsx index 58e180ad..cec65d44 100644 --- a/src/routes/dashboardPage/DashboardPage.jsx +++ b/src/routes/dashboardPage/DashboardPage.jsx @@ -1,7 +1,29 @@ +import { Outlet, useNavigate } from "react-router-dom"; import "./dashboardPage.css"; +import { useAuth } from "@clerk/clerk-react"; +import { useEffect } from "react"; function DashboardPage() { - return
; + const { userId, isLoaded } = useAuth(); + + const navigate = useNavigate(); + + useEffect(() => { + if (isLoaded && !userId) { + navigate("/sign-in"); + } + }, [isLoaded, userId, navigate]); + + if (!isLoaded) return "Loading..."; + + return ( +
+
Menu
+
+ +
+
+ ); } export default DashboardPage; diff --git a/src/routes/homepage/HomePage.jsx b/src/routes/homepage/HomePage.jsx index 96e2f9ca..462d9432 100644 --- a/src/routes/homepage/HomePage.jsx +++ b/src/routes/homepage/HomePage.jsx @@ -1,7 +1,12 @@ +import { Link } from "react-router-dom"; import "./homepage.css"; function Homepage() { - return
Homepage
; + return ( +
+ Dashboard +
+ ); } export default Homepage; diff --git a/src/routes/signInPage/SignInPage.jsx b/src/routes/signInPage/SignInPage.jsx index f7693a3c..6a1496ba 100644 --- a/src/routes/signInPage/SignInPage.jsx +++ b/src/routes/signInPage/SignInPage.jsx @@ -1,7 +1,12 @@ +import { SignIn } from "@clerk/clerk-react"; import "./signInPage.css"; function SignInPage() { - return
; + return ( +
+ +
+ ); } export default SignInPage; diff --git a/src/routes/signInPage/signInPage.css b/src/routes/signInPage/signInPage.css index e69de29b..3d53ddf8 100644 --- a/src/routes/signInPage/signInPage.css +++ b/src/routes/signInPage/signInPage.css @@ -0,0 +1,6 @@ +.signInPage { + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} diff --git a/src/routes/signUpPage/SignUpPage.jsx b/src/routes/signUpPage/SignUpPage.jsx index 324a2fd5..886cf397 100644 --- a/src/routes/signUpPage/SignUpPage.jsx +++ b/src/routes/signUpPage/SignUpPage.jsx @@ -1,7 +1,12 @@ +import { SignUp } from "@clerk/clerk-react"; import "./signUpPage.css"; function SignUpPage() { - return
; + return ( +
+ +
+ ); } export default SignUpPage; diff --git a/src/routes/signUpPage/signUpPage.css b/src/routes/signUpPage/signUpPage.css index e69de29b..2ec6c38f 100644 --- a/src/routes/signUpPage/signUpPage.css +++ b/src/routes/signUpPage/signUpPage.css @@ -0,0 +1,6 @@ +.signUpPage { + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} From 473db7626c5227b5c614e0f27a429c9789baae8f Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sat, 12 Oct 2024 20:54:48 +0200 Subject: [PATCH 07/25] sign in/up --- src/routes/signInPage/SignInPage.jsx | 2 +- src/routes/signUpPage/SignUpPage.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/signInPage/SignInPage.jsx b/src/routes/signInPage/SignInPage.jsx index 6a1496ba..dae91e2a 100644 --- a/src/routes/signInPage/SignInPage.jsx +++ b/src/routes/signInPage/SignInPage.jsx @@ -4,7 +4,7 @@ import "./signInPage.css"; function SignInPage() { return (
- +
); } diff --git a/src/routes/signUpPage/SignUpPage.jsx b/src/routes/signUpPage/SignUpPage.jsx index 886cf397..ef7e4892 100644 --- a/src/routes/signUpPage/SignUpPage.jsx +++ b/src/routes/signUpPage/SignUpPage.jsx @@ -4,7 +4,7 @@ import "./signUpPage.css"; function SignUpPage() { return (
- +
); } From 64d242241d9a15864402f951ffb797cf3de7a93c Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sat, 12 Oct 2024 21:14:19 +0200 Subject: [PATCH 08/25] style home page --- src/routes/homepage/HomePage.jsx | 23 ++++- src/routes/homepage/homepage.css | 159 +++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 3 deletions(-) diff --git a/src/routes/homepage/HomePage.jsx b/src/routes/homepage/HomePage.jsx index 462d9432..93c95227 100644 --- a/src/routes/homepage/HomePage.jsx +++ b/src/routes/homepage/HomePage.jsx @@ -1,12 +1,29 @@ import { Link } from "react-router-dom"; import "./homepage.css"; -function Homepage() { +function HomePage() { return (
- Dashboard + +
+

LAMA AI

+

Supercharge your creativity and productivity

+

+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Placeat sint + dolorem doloribus, architecto dolor. +

+ Get Started +
+
+
+
+
+
+ +
+
); } -export default Homepage; +export default HomePage; diff --git a/src/routes/homepage/homepage.css b/src/routes/homepage/homepage.css index e69de29b..a610e4e8 100644 --- a/src/routes/homepage/homepage.css +++ b/src/routes/homepage/homepage.css @@ -0,0 +1,159 @@ +.homepage { + display: flex; + align-items: center; + gap: 100px; + height: 100%; +} + +.left { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 16px; + text-align: center; +} + +h1 { + font-size: 128px; + background: linear-gradient(to right, #217bfe, #e55571); + background-clip: text; + -webkit-background-clip: text; + color: transparent; +} + +h3 { + font-weight: 400; + max-width: 70%; +} + +a { + padding: 15px 25px; + background-color: #217bfe; + color: white; + border-radius: 20px; + font-size: 14px; + margin-top: 20px; +} + +a:hover { + background-color: white; + color: #217bfe; +} + +.right { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + height: 100%; +} + +.imgContainer { + display: flex; + align-items: center; + justify-content: center; + background-color: #140e2d; + border-radius: 50px; + width: 80%; + height: 50%; + position: relative; +} + +.bgContainer { + width: 100%; + height: 100%; + overflow: hidden; + position: absolute; + top: 0; + left: 0; + border-radius: 50px; +} + +.bg { + background-image: url("/bg.png"); + opacity: 0.2; + width: 200%; + height: 100%; + background-size: auto 100%; + animation: 8s ease-in-out infinite alternate slideBg; +} + +.orbital { + position: absolute; + bottom: 0; + left: 0; + opacity: 0.05; + animation: 100s linear infinite rotateOrbital; + z-index: -1; +} + +.terms { + position: absolute; + bottom: 20px; + left: 50%; + transform: translateX(-50%); + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; +} + +img { + width: 16px; + height: 16px; +} + +.links { + display: flex; + gap: 10px; + color: #888; + font-size: 10px; +} + +@keyframes rotateOrbital { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(60deg); + } +} + +@keyframes botAnimate { + 0% { + transform: scale(1) rotate(0deg); + } + 100% { + transform: scale(1.1) rotate(-5deg); + } +} + +@keyframes slideBg { + 0% { + transform: translateX(0); + } + 100% { + transform: translateX(-50%); + } +} + +@media screen and (max-width: 1024px) { + .homepage { + flex-direction: column; + gap: 0px; + } +} + +@media screen and (max-width: 1280px) { + h1 { + font-size: 64px; + } +} + +@media screen and (max-width: 1024px) { + h3 { + max-width: 100%; + } +} From 0a51c3e312cb0f673bfd86b2dc1b7f01126f4ad8 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sun, 13 Oct 2024 10:59:22 +0200 Subject: [PATCH 09/25] finished homepage --- package-lock.json | 18 ++++++--- package.json | 3 +- src/routes/homepage/HomePage.jsx | 61 ++++++++++++++++++++++++++++-- src/routes/homepage/homepage.css | 64 +++++++++++++++++++++++++------- 4 files changed, 122 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index a4746529..9d324f2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,8 @@ "@clerk/clerk-react": "^5.11.0", "react": "^19.0.0-rc-8b08e99e-20240713", "react-dom": "19.0.0-rc-8b08e99e-20240713", - "react-router-dom": "^6.27.0" + "react-router-dom": "^6.27.0", + "react-type-animation": "^3.2.0" }, "devDependencies": { "@types/react": "^18.3.3", @@ -3359,7 +3360,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, "license": "MIT" }, "node_modules/js-yaml": { @@ -3489,7 +3489,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -3565,7 +3564,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3835,7 +3833,6 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.4.0", @@ -3898,7 +3895,6 @@ "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, "license": "MIT" }, "node_modules/react-refresh": { @@ -3941,6 +3937,16 @@ "react": ">=16.8" } }, + "node_modules/react-type-animation": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/react-type-animation/-/react-type-animation-3.2.0.tgz", + "integrity": "sha512-WXTe0i3rRNKjmggPvT5ntye1QBt0ATGbijeW6V3cQe2W0jaMABXXlPPEdtofnS9tM7wSRHchEvI9SUw+0kUohw==", + "peerDependencies": { + "prop-types": "^15.5.4", + "react": ">= 15.0.0", + "react-dom": ">= 15.0.0" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", diff --git a/package.json b/package.json index f1bd2340..6d05711b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "@clerk/clerk-react": "^5.11.0", "react": "^19.0.0-rc-8b08e99e-20240713", "react-dom": "19.0.0-rc-8b08e99e-20240713", - "react-router-dom": "^6.27.0" + "react-router-dom": "^6.27.0", + "react-type-animation": "^3.2.0" }, "devDependencies": { "@types/react": "^18.3.3", diff --git a/src/routes/homepage/HomePage.jsx b/src/routes/homepage/HomePage.jsx index 93c95227..69e8fbca 100644 --- a/src/routes/homepage/HomePage.jsx +++ b/src/routes/homepage/HomePage.jsx @@ -1,10 +1,14 @@ import { Link } from "react-router-dom"; +import { TypeAnimation } from "react-type-animation"; import "./homepage.css"; +import { useState } from "react"; function HomePage() { + const [typingStatus, setTypingStatus] = useState("human1"); + return (
- + orbital

LAMA AI

Supercharge your creativity and productivity

@@ -12,14 +16,65 @@ function HomePage() { Lorem ipsum dolor sit, amet consectetur adipisicing elit. Placeat sint dolorem doloribus, architecto dolor. - Get Started + + Get Started +
- + bot +
+ + { + setTypingStatus("bot"); + }, + "Bot: We produce food for Hamsters", + 2000, + () => { + setTypingStatus("human2"); + }, + "Human2: We produce food for Guinea Pigs", + 2000, + () => { + setTypingStatus("bot"); + }, + "Bot: We produce food for Chinchillas", + 2000, + () => { + setTypingStatus("human1"); + }, + ]} + wrapper="span" + cursor={true} + omitDeletionAnimation={true} + repeat={Infinity} + /> +
+
+
+
+ logo +
+ Terms of Service + | + Privacy Policy
diff --git a/src/routes/homepage/homepage.css b/src/routes/homepage/homepage.css index a610e4e8..3c95894a 100644 --- a/src/routes/homepage/homepage.css +++ b/src/routes/homepage/homepage.css @@ -3,6 +3,18 @@ align-items: center; gap: 100px; height: 100%; + position: relative; +} + +.orbital { + height: 100vh; + width: 100%; + position: absolute; + top: 0; + left: 0; + opacity: 0.05; + animation: 100s linear infinite rotateOrbital; + z-index: -1; } .left { @@ -28,7 +40,7 @@ h3 { max-width: 70%; } -a { +.btn-start { padding: 15px 25px; background-color: #217bfe; color: white; @@ -37,7 +49,7 @@ a { margin-top: 20px; } -a:hover { +.btn-start:hover { background-color: white; color: #217bfe; } @@ -51,6 +63,7 @@ a:hover { } .imgContainer { + padding: 20px; display: flex; align-items: center; justify-content: center; @@ -80,13 +93,30 @@ a:hover { animation: 8s ease-in-out infinite alternate slideBg; } -.orbital { +.bot { + width: 100%; + height: 100%; + object-fit: contain; + animation: 3s ease-in-out infinite alternate botAnimate; +} + +.chat { + padding: 20px; position: absolute; - bottom: 0; - left: 0; - opacity: 0.05; - animation: 100s linear infinite rotateOrbital; - z-index: -1; + bottom: -30px; + right: 30px; + display: flex; + align-items: center; + gap: 10px; + background-color: #2c2937; + border-radius: 10px; +} + +.chat-img { + width: 32px; + height: 32px; + border-radius: 50%; + object-fit: cover; } .terms { @@ -100,14 +130,14 @@ a:hover { gap: 20px; } -img { +.terms-logo { width: 16px; height: 16px; } .links { display: flex; - gap: 10px; + gap: 15px; color: #888; font-size: 10px; } @@ -144,16 +174,22 @@ img { flex-direction: column; gap: 0px; } + + h3 { + max-width: 100%; + } + + .chat { + display: none; + } } @media screen and (max-width: 1280px) { h1 { font-size: 64px; } -} -@media screen and (max-width: 1024px) { - h3 { - max-width: 100%; + .chat { + right: 0; } } From 0930b31803b927b45ff7d68aa22b031dbc6b5801 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sun, 13 Oct 2024 11:14:22 +0200 Subject: [PATCH 10/25] create chatpage --- src/components/chatList/ChatList.jsx | 33 ++++++++++++++++++++++ src/components/chatList/chatList.css | 0 src/routes/dashboardPage/DashboardPage.jsx | 5 +++- src/routes/signInPage/SignInPage.jsx | 6 +++- 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 src/components/chatList/ChatList.jsx create mode 100644 src/components/chatList/chatList.css diff --git a/src/components/chatList/ChatList.jsx b/src/components/chatList/ChatList.jsx new file mode 100644 index 00000000..4ef799ac --- /dev/null +++ b/src/components/chatList/ChatList.jsx @@ -0,0 +1,33 @@ +import { Link } from "react-router-dom"; +import "./chatList.css"; + +function ChatList() { + return ( +
+ Dashboard + Create a new Chat + Explore Lama AI + Contact +
+
+ Title chat + Title chat + Title chat + Title chat + Title chat + Title chat + Title chat +
+
+
+ logo +
+ Upgrate to Pro + Unlimited access... +
+
+
+ ); +} + +export default ChatList; diff --git a/src/components/chatList/chatList.css b/src/components/chatList/chatList.css new file mode 100644 index 00000000..e69de29b diff --git a/src/routes/dashboardPage/DashboardPage.jsx b/src/routes/dashboardPage/DashboardPage.jsx index cec65d44..79a3c7da 100644 --- a/src/routes/dashboardPage/DashboardPage.jsx +++ b/src/routes/dashboardPage/DashboardPage.jsx @@ -2,6 +2,7 @@ import { Outlet, useNavigate } from "react-router-dom"; import "./dashboardPage.css"; import { useAuth } from "@clerk/clerk-react"; import { useEffect } from "react"; +import ChatList from "../../components/chatList/ChatList"; function DashboardPage() { const { userId, isLoaded } = useAuth(); @@ -18,7 +19,9 @@ function DashboardPage() { return (
-
Menu
+
+ +
diff --git a/src/routes/signInPage/SignInPage.jsx b/src/routes/signInPage/SignInPage.jsx index dae91e2a..564c63e7 100644 --- a/src/routes/signInPage/SignInPage.jsx +++ b/src/routes/signInPage/SignInPage.jsx @@ -4,7 +4,11 @@ import "./signInPage.css"; function SignInPage() { return (
- +
); } From fd619e3bbcb60f1aca0e7acc7c8ed045d5e0fbe3 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Fri, 18 Oct 2024 19:24:49 +0200 Subject: [PATCH 11/25] styling chat --- src/components/chatList/chatList.css | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/components/chatList/chatList.css b/src/components/chatList/chatList.css index e69de29b..041c706d 100644 --- a/src/components/chatList/chatList.css +++ b/src/components/chatList/chatList.css @@ -0,0 +1,57 @@ +.chatList { + display: flex; + flex-direction: column; + height: 100%; +} + +hr { + border: none; + height: 2px; + background-color: #ddd; + opacity: 0.1; + border-radius: 5px; + margin: 20px 0; +} + +.title { + font-weight: 600; + font-size: 10px; + margin-bottom: 10px; +} + +.list { + display: flex; + flex-direction: column; + overflow: scroll; +} + +a { + padding: 10px; + border-radius: 10px; +} + +a:hover { + background-color: #2c2937; +} + +.upgrade { + margin-top: auto; + display: flex; + align-items: center; + gap: 10px; + font-size: 12px; +} + +img { + width: 24px; + height: 24px; +} + +.text { + display: flex; + flex-direction: column; +} + +span:first-child:hover { + font-size: 600; +} From d8d499715416dd12e37ed4f0b4724f035aac4779 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Fri, 18 Oct 2024 20:26:40 +0200 Subject: [PATCH 12/25] css style --- src/components/chatList/chatList.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/chatList/chatList.css b/src/components/chatList/chatList.css index 041c706d..20d25299 100644 --- a/src/components/chatList/chatList.css +++ b/src/components/chatList/chatList.css @@ -47,11 +47,15 @@ img { height: 24px; } -.text { +.texts { display: flex; flex-direction: column; } -span:first-child:hover { +span:first-child { font-size: 600; } + +span:last-child { + color: #888; +} From 2b54dc73f2e249da3da685fdd9c4e9580c0151fb Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sat, 19 Oct 2024 21:05:55 +0200 Subject: [PATCH 13/25] commit --- .../dashboardLayout/DashboardLayout.jsx | 23 +++++++++++-- .../dashboardLayout/dashboardLayout.css | 32 ++++++------------- src/layouts/rootLayout/rootLayout.css | 29 +++++++++++++++++ src/routes/dashboardPage/DashboardPage.jsx | 32 ------------------- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/layouts/dashboardLayout/DashboardLayout.jsx b/src/layouts/dashboardLayout/DashboardLayout.jsx index 9b484a66..e13cd026 100644 --- a/src/layouts/dashboardLayout/DashboardLayout.jsx +++ b/src/layouts/dashboardLayout/DashboardLayout.jsx @@ -1,10 +1,27 @@ -import { Outlet } from "react-router-dom"; +import { Outlet, useNavigate } from "react-router-dom"; import "./dashboardLayout.css"; +import { useAuth } from "@clerk/clerk-react"; +import { useEffect } from "react"; +import ChatList from "../../components/chatList/ChatList"; function DashboardLayout() { + const { userId, isLoaded } = useAuth(); + + const navigate = useNavigate(); + + useEffect(() => { + if (isLoaded && !userId) { + navigate("/sign-in"); + } + }, [isLoaded, userId, navigate]); + + if (!isLoaded) return "Loading..."; + return ( -
-
Menu
+
+
+ +
diff --git a/src/layouts/dashboardLayout/dashboardLayout.css b/src/layouts/dashboardLayout/dashboardLayout.css index d23b9f91..cc8d6e33 100644 --- a/src/layouts/dashboardLayout/dashboardLayout.css +++ b/src/layouts/dashboardLayout/dashboardLayout.css @@ -1,29 +1,15 @@ -.rootLayout { - padding: 14px 64px; - height: 100vh; +.dashboardLayout { display: flex; - flex-direction: column; + gap: 50px; + padding-top: 20px; + height: 100%; } -header { - display: flex; - align-items: center; - justify-content: space-between; -} - -.logo { - display: flex; - align-items: center; - font-weight: bold; - gap: 8px; -} - -img { - width: 32px; - height: 32px; +.menu { + flex: 1; } -main { - flex: 1; - overflow: hidden; +.content { + flex: 4; + background-color: #12101b; } diff --git a/src/layouts/rootLayout/rootLayout.css b/src/layouts/rootLayout/rootLayout.css index e69de29b..d23b9f91 100644 --- a/src/layouts/rootLayout/rootLayout.css +++ b/src/layouts/rootLayout/rootLayout.css @@ -0,0 +1,29 @@ +.rootLayout { + padding: 14px 64px; + height: 100vh; + display: flex; + flex-direction: column; +} + +header { + display: flex; + align-items: center; + justify-content: space-between; +} + +.logo { + display: flex; + align-items: center; + font-weight: bold; + gap: 8px; +} + +img { + width: 32px; + height: 32px; +} + +main { + flex: 1; + overflow: hidden; +} diff --git a/src/routes/dashboardPage/DashboardPage.jsx b/src/routes/dashboardPage/DashboardPage.jsx index 79a3c7da..e69de29b 100644 --- a/src/routes/dashboardPage/DashboardPage.jsx +++ b/src/routes/dashboardPage/DashboardPage.jsx @@ -1,32 +0,0 @@ -import { Outlet, useNavigate } from "react-router-dom"; -import "./dashboardPage.css"; -import { useAuth } from "@clerk/clerk-react"; -import { useEffect } from "react"; -import ChatList from "../../components/chatList/ChatList"; - -function DashboardPage() { - const { userId, isLoaded } = useAuth(); - - const navigate = useNavigate(); - - useEffect(() => { - if (isLoaded && !userId) { - navigate("/sign-in"); - } - }, [isLoaded, userId, navigate]); - - if (!isLoaded) return "Loading..."; - - return ( -
-
- -
-
- -
-
- ); -} - -export default DashboardPage; From 42688cb65fbc5baa0057417ee890d2f662a0fca0 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sun, 20 Oct 2024 21:29:48 +0200 Subject: [PATCH 14/25] dashborad construction --- src/routes/dashboardPage/DashboardPage.jsx | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/routes/dashboardPage/DashboardPage.jsx b/src/routes/dashboardPage/DashboardPage.jsx index e69de29b..7bd8774f 100644 --- a/src/routes/dashboardPage/DashboardPage.jsx +++ b/src/routes/dashboardPage/DashboardPage.jsx @@ -0,0 +1,37 @@ +import "./dashboardPage.css"; + +function DashboardPage() { + return ( +
+
+
+ logo +
+
+ img + Create a New Chat +
+
+ img + Analyze Images +
+
+ img + Help me with my code +
+
+
+
+
+
+ + +
+
+
+ ); +} + +export default DashboardPage; From ce5e15814a62786f59b63858ecbcbfb65cdaec48 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sun, 20 Oct 2024 21:38:55 +0200 Subject: [PATCH 15/25] styling dashboardpage --- src/routes/dashboardPage/dashboardPage.css | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/src/routes/dashboardPage/dashboardPage.css b/src/routes/dashboardPage/dashboardPage.css index e69de29b..e890e5fb 100644 --- a/src/routes/dashboardPage/dashboardPage.css +++ b/src/routes/dashboardPage/dashboardPage.css @@ -0,0 +1,106 @@ +.dashboardPage { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; +} + +.texts { + display: flex; + flex: 1; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 50px; + width: 50%; +} + +.logo { + display: flex; + align-items: center; + gap: 20px; + opacity: 0.2; +} + +.logo img { + width: 64px; + height: 64px; +} + +h1 { + font-size: 64px; + background: linear-gradient(to right, #217bfe, #e55571); + background-clip: text; + -webkit-background-clip: text; + color: transparent; +} + +.options { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + gap: 50px; +} + +.option { + flex: 1; + display: flex; + flex-direction: column; + gap: 10px; + font-weight: 300; + font-size: 14px; + padding: 20px; + border: 1px solid #555; + border-radius: 20px; +} + +.option img { + width: 40px; + height: 40px; + object-fit: cover; +} + +.formContainer { + margin-top: auto; + width: 50%; + background-color: #2c2937; + border-radius: 20px; + display: flex; +} + +form { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: space-between; + gap: 20px; + margin-bottom: 10px; +} + +form input { + flex: 1; + padding: 20px; + background-color: transparent; + border: none; + outline: none; + color: #ececec; +} + +form button { + background-color: #605e68; + border-radius: 50%; + border: none; + cursor: pointer; + padding: 10px; + display: flex; + align-items: center; + justify-content: center; + margin-right: 20px; +} + +form img { + width: 16px; + height: 16px; +} From 3bb1930ad009a974f662776cdf309ff15ec4afb5 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Mon, 21 Oct 2024 22:13:58 +0200 Subject: [PATCH 16/25] dashboard refactor --- src/routes/dashboardPage/DashboardPage.jsx | 35 +++++++++++----------- src/routes/dashboardPage/dashboardPage.css | 1 + 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/routes/dashboardPage/DashboardPage.jsx b/src/routes/dashboardPage/DashboardPage.jsx index 7bd8774f..f93ba037 100644 --- a/src/routes/dashboardPage/DashboardPage.jsx +++ b/src/routes/dashboardPage/DashboardPage.jsx @@ -3,30 +3,31 @@ import "./dashboardPage.css"; function DashboardPage() { return (
-
+
- logo -
-
- img - Create a New Chat -
-
- img - Analyze Images -
-
- img - Help me with my code -
+ +

LAMA AI

+
+
+
+ + Create a New Chat +
+
+ + Analyze Images +
+
+ + Help me with my Code
- +
diff --git a/src/routes/dashboardPage/dashboardPage.css b/src/routes/dashboardPage/dashboardPage.css index e890e5fb..4c0e0f18 100644 --- a/src/routes/dashboardPage/dashboardPage.css +++ b/src/routes/dashboardPage/dashboardPage.css @@ -62,6 +62,7 @@ h1 { } .formContainer { + margin-bottom: 50px; margin-top: auto; width: 50%; background-color: #2c2937; From 17aaf354d38aad9a1d56250e3b4406cec0a4ff15 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Tue, 22 Oct 2024 22:17:52 +0200 Subject: [PATCH 17/25] commit --- src/components/newPrompt/NewPrompt.jsx | 7 +++++ src/components/newPrompt/newPrompt.css | 0 src/routes/chatPage/ChatPage.jsx | 40 +++++++++++++++++++++++++- src/routes/chatPage/chatPage.css | 37 ++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 src/components/newPrompt/NewPrompt.jsx create mode 100644 src/components/newPrompt/newPrompt.css diff --git a/src/components/newPrompt/NewPrompt.jsx b/src/components/newPrompt/NewPrompt.jsx new file mode 100644 index 00000000..16f036a7 --- /dev/null +++ b/src/components/newPrompt/NewPrompt.jsx @@ -0,0 +1,7 @@ +import "./newPrompt.css"; + +function NewPrompt() { + return
; +} + +export default NewPrompt; diff --git a/src/components/newPrompt/newPrompt.css b/src/components/newPrompt/newPrompt.css new file mode 100644 index 00000000..e69de29b diff --git a/src/routes/chatPage/ChatPage.jsx b/src/routes/chatPage/ChatPage.jsx index 39c0815a..4415e5ae 100644 --- a/src/routes/chatPage/ChatPage.jsx +++ b/src/routes/chatPage/ChatPage.jsx @@ -1,7 +1,45 @@ +import { useRef } from "react"; import "./chatPage.css"; +import { useEffect } from "react"; +import NewPrompt from "../../components/newPrompt/NewPrompt"; function ChatPage() { - return
; + const endRef = useRef(null); + + useEffect(() => { + endRef.current.scrollIntoView({ behavior: "smooth" }); + }, []); + + return ( +
+
+
+
Test message
+
Lorem ipsum dolor sit amet.
+
Test message
+
Test message from user.
+
Test message
+
Test message from user.
+
Test message
+
Test message from user.
+
Test message
+
Test message from user.
+
Test message
+
Test message from user.
+
Test message
+
Test message from user.
+
Test message
+
Test message from user.
+
Test message
+
Test message from user.
+
Test message
+
Test message from user.
+ +
+
+
+
+ ); } export default ChatPage; diff --git a/src/routes/chatPage/chatPage.css b/src/routes/chatPage/chatPage.css index e69de29b..6127a7b5 100644 --- a/src/routes/chatPage/chatPage.css +++ b/src/routes/chatPage/chatPage.css @@ -0,0 +1,37 @@ +.chatPage { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; +} + +.wrapper { + flex: 1; + overflow: scroll; + width: 100%; + display: flex; + justify-content: center; +} + +.chat { + width: 50%; + display: flex; + flex-direction: column; + gap: 20px; +} + +p, +li { + margin: 10px 0px; +} + +.message { + padding: 20px; +} + +.user:hover { + background-color: #2c2937; + border-radius: 20px; + max-width: 80%; + align-self: flex-end; +} From 1c605eca4afd574dba9e01256499647406fb3d96 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Wed, 23 Oct 2024 10:41:24 +0200 Subject: [PATCH 18/25] commit --- src/components/chatList/ChatList.jsx | 36 ++++++++++++++++--------- src/components/newPrompt/NewPrompt.jsx | 15 ++++++++++- src/components/newPrompt/newPrompt.css | 37 ++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 13 deletions(-) diff --git a/src/components/chatList/ChatList.jsx b/src/components/chatList/ChatList.jsx index 4ef799ac..b1f21190 100644 --- a/src/components/chatList/ChatList.jsx +++ b/src/components/chatList/ChatList.jsx @@ -1,29 +1,41 @@ import { Link } from "react-router-dom"; import "./chatList.css"; +import { useQuery } from "@tanstack/react-query"; function ChatList() { + const { isPending, error, data } = useQuery({ + queryKey: ["userChats"], + queryFn: () => + fetch(`${import.meta.env.VITE_API_URL}/api/userchats`, { + credentials: "include", + }).then((res) => res.json()), + }); + return (
- Dashboard - Create a new Chat + DASHBOARD + Create a new Chat Explore Lama AI Contact
+ RECENT CHATS
- Title chat - Title chat - Title chat - Title chat - Title chat - Title chat - Title chat + {isPending + ? "Loading..." + : error + ? "Something went wrong!" + : data?.map((chat) => ( + + {chat.title} + + ))}

- logo +
- Upgrate to Pro - Unlimited access... + Upgrade to Lama AI Pro + Get unlimited access to all features
diff --git a/src/components/newPrompt/NewPrompt.jsx b/src/components/newPrompt/NewPrompt.jsx index 16f036a7..db23726e 100644 --- a/src/components/newPrompt/NewPrompt.jsx +++ b/src/components/newPrompt/NewPrompt.jsx @@ -1,7 +1,20 @@ import "./newPrompt.css"; function NewPrompt() { - return
; + return ( +
+
+ + + + +
+
+ ); } export default NewPrompt; diff --git a/src/components/newPrompt/newPrompt.css b/src/components/newPrompt/newPrompt.css index e69de29b..7814e3eb 100644 --- a/src/components/newPrompt/newPrompt.css +++ b/src/components/newPrompt/newPrompt.css @@ -0,0 +1,37 @@ +.newForm { + width: 50%; + position: absolute; + bottom: 0; + background-color: #2c2937; + border-radius: 20px; + display: flex; + align-items: center; + gap: 20px; + padding: 0px 20px; +} + +input { + flex: 1; + padding: 20px; + border: none; + outline: none; + background-color: transparent; + color: #ececec; +} + +button, +label { + border-radius: 50%; + background-color: #605e68; + border: none; + padding: 10px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; +} + +img { + width: 16px; + height: 16px; +} From 6fdc59903a354dd08cb34a4cbcad75d8194cbfd7 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Thu, 24 Oct 2024 22:49:13 +0200 Subject: [PATCH 19/25] commit --- src/components/chatList/chatList.css | 1 + src/components/newPrompt/NewPrompt.jsx | 14 ++++++++++++-- src/components/newPrompt/newPrompt.css | 4 ++++ src/routes/chatPage/ChatPage.jsx | 9 --------- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/components/chatList/chatList.css b/src/components/chatList/chatList.css index 20d25299..32d9421d 100644 --- a/src/components/chatList/chatList.css +++ b/src/components/chatList/chatList.css @@ -2,6 +2,7 @@ display: flex; flex-direction: column; height: 100%; + position: relative; } hr { diff --git a/src/components/newPrompt/NewPrompt.jsx b/src/components/newPrompt/NewPrompt.jsx index db23726e..67821c84 100644 --- a/src/components/newPrompt/NewPrompt.jsx +++ b/src/components/newPrompt/NewPrompt.jsx @@ -1,8 +1,17 @@ +import { useRef } from "react"; import "./newPrompt.css"; function NewPrompt() { + const endRef = useRef(null); + + useEffect(() => { + endRef.current.scrollIntoView({ behavior: "smooth" }); + }, []); + return ( -
+ <> + {/* add new chat */} +
+
+ ); } diff --git a/src/components/newPrompt/newPrompt.css b/src/components/newPrompt/newPrompt.css index 7814e3eb..70488dce 100644 --- a/src/components/newPrompt/newPrompt.css +++ b/src/components/newPrompt/newPrompt.css @@ -1,3 +1,7 @@ +.endChat { + padding-bottom: 100px; +} + .newForm { width: 50%; position: absolute; diff --git a/src/routes/chatPage/ChatPage.jsx b/src/routes/chatPage/ChatPage.jsx index 4415e5ae..2b816d19 100644 --- a/src/routes/chatPage/ChatPage.jsx +++ b/src/routes/chatPage/ChatPage.jsx @@ -1,15 +1,7 @@ -import { useRef } from "react"; import "./chatPage.css"; -import { useEffect } from "react"; import NewPrompt from "../../components/newPrompt/NewPrompt"; function ChatPage() { - const endRef = useRef(null); - - useEffect(() => { - endRef.current.scrollIntoView({ behavior: "smooth" }); - }, []); - return (
@@ -35,7 +27,6 @@ function ChatPage() {
Test message
Test message from user.
-
From 79ae819d10c9da806f4e5fd72c89f26a44e34114 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Fri, 25 Oct 2024 18:09:48 +0200 Subject: [PATCH 20/25] imagekit --- package-lock.json | 19 +++++++++++++++++++ package.json | 1 + 2 files changed, 20 insertions(+) diff --git a/package-lock.json b/package-lock.json index 9d324f2d..0b770129 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "@clerk/clerk-react": "^5.11.0", + "imagekitio-react": "^4.2.0", "react": "^19.0.0-rc-8b08e99e-20240713", "react-dom": "19.0.0-rc-8b08e99e-20240713", "react-router-dom": "^6.27.0", @@ -2894,6 +2895,24 @@ "node": ">= 4" } }, + "node_modules/imagekit-javascript": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/imagekit-javascript/-/imagekit-javascript-3.0.2.tgz", + "integrity": "sha512-lTlLBrb+96eDy20zz3AIZtSs4nhozoa+kRcz3Yhl/TLAvciMmKXQe2kFOWM/j8KurvG5jLeDuMI6sCp+w7y2IA==" + }, + "node_modules/imagekitio-react": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/imagekitio-react/-/imagekitio-react-4.2.0.tgz", + "integrity": "sha512-g6aBeOPXnU7WNjCAKx82tevSKKWoKlg8xS+BITOZn+Mk2MoyDbj8jLbyP5aiMCtMWzduabgf72wPcMaeEq++lw==", + "dependencies": { + "imagekit-javascript": "^3.0.2", + "prop-types": "^15.7.2" + }, + "peerDependencies": { + "react": "^16.13.1 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", diff --git a/package.json b/package.json index 6d05711b..61c580ae 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@clerk/clerk-react": "^5.11.0", + "imagekitio-react": "^4.2.0", "react": "^19.0.0-rc-8b08e99e-20240713", "react-dom": "19.0.0-rc-8b08e99e-20240713", "react-router-dom": "^6.27.0", From 664a2816c805df44c257eb9de4204acf2abfed19 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Fri, 25 Oct 2024 18:14:26 +0200 Subject: [PATCH 21/25] refactor --- .eslintrc.cjs => client/.eslintrc.cjs | 0 .gitignore => client/.gitignore | 0 README.md => client/README.md | 0 index.html => client/index.html | 0 package-lock.json => client/package-lock.json | 0 package.json => client/package.json | 0 {public => client/public}/arrow.png | Bin {public => client/public}/attachment.png | Bin {public => client/public}/bg.png | Bin {public => client/public}/bot.png | Bin {public => client/public}/chat.png | Bin {public => client/public}/code.png | Bin {public => client/public}/favicon.ico | Bin {public => client/public}/human1.jpeg | Bin {public => client/public}/human2.jpeg | Bin {public => client/public}/image.png | Bin {public => client/public}/logo.png | Bin {public => client/public}/orbital.png | Bin {src => client/src}/App.jsx | 0 .../src}/components/chatList/ChatList.jsx | 0 .../src}/components/chatList/chatList.css | 0 .../src}/components/newPrompt/NewPrompt.jsx | 0 .../src}/components/newPrompt/newPrompt.css | 0 {src => client/src}/index.css | 0 .../layouts/dashboardLayout/DashboardLayout.jsx | 0 .../layouts/dashboardLayout/dashboardLayout.css | 0 .../src}/layouts/rootLayout/rootLayout.css | 0 .../src/layouts/rootLayout/rootLayout.jsx | 0 {src => client/src}/main.jsx | 12 ++++++------ {src => client/src}/routes/chatPage/ChatPage.jsx | 0 {src => client/src}/routes/chatPage/chatPage.css | 0 .../src}/routes/dashboardPage/DashboardPage.jsx | 0 .../src}/routes/dashboardPage/dashboardPage.css | 0 {src => client/src}/routes/homepage/HomePage.jsx | 0 {src => client/src}/routes/homepage/homepage.css | 0 .../src}/routes/signInPage/SignInPage.jsx | 0 .../src}/routes/signInPage/signInPage.css | 0 .../src}/routes/signUpPage/SignUpPage.jsx | 0 .../src}/routes/signUpPage/signUpPage.css | 0 vite.config.js => client/vite.config.js | 0 40 files changed, 6 insertions(+), 6 deletions(-) rename .eslintrc.cjs => client/.eslintrc.cjs (100%) rename .gitignore => client/.gitignore (100%) rename README.md => client/README.md (100%) rename index.html => client/index.html (100%) rename package-lock.json => client/package-lock.json (100%) rename package.json => client/package.json (100%) rename {public => client/public}/arrow.png (100%) rename {public => client/public}/attachment.png (100%) rename {public => client/public}/bg.png (100%) rename {public => client/public}/bot.png (100%) rename {public => client/public}/chat.png (100%) rename {public => client/public}/code.png (100%) rename {public => client/public}/favicon.ico (100%) rename {public => client/public}/human1.jpeg (100%) rename {public => client/public}/human2.jpeg (100%) rename {public => client/public}/image.png (100%) rename {public => client/public}/logo.png (100%) rename {public => client/public}/orbital.png (100%) rename {src => client/src}/App.jsx (100%) rename {src => client/src}/components/chatList/ChatList.jsx (100%) rename {src => client/src}/components/chatList/chatList.css (100%) rename {src => client/src}/components/newPrompt/NewPrompt.jsx (100%) rename {src => client/src}/components/newPrompt/newPrompt.css (100%) rename {src => client/src}/index.css (100%) rename {src => client/src}/layouts/dashboardLayout/DashboardLayout.jsx (100%) rename {src => client/src}/layouts/dashboardLayout/dashboardLayout.css (100%) rename {src => client/src}/layouts/rootLayout/rootLayout.css (100%) rename src/layouts/rootLayout/RootLayout.jsx => client/src/layouts/rootLayout/rootLayout.jsx (100%) rename {src => client/src}/main.jsx (70%) rename {src => client/src}/routes/chatPage/ChatPage.jsx (100%) rename {src => client/src}/routes/chatPage/chatPage.css (100%) rename {src => client/src}/routes/dashboardPage/DashboardPage.jsx (100%) rename {src => client/src}/routes/dashboardPage/dashboardPage.css (100%) rename {src => client/src}/routes/homepage/HomePage.jsx (100%) rename {src => client/src}/routes/homepage/homepage.css (100%) rename {src => client/src}/routes/signInPage/SignInPage.jsx (100%) rename {src => client/src}/routes/signInPage/signInPage.css (100%) rename {src => client/src}/routes/signUpPage/SignUpPage.jsx (100%) rename {src => client/src}/routes/signUpPage/signUpPage.css (100%) rename vite.config.js => client/vite.config.js (100%) diff --git a/.eslintrc.cjs b/client/.eslintrc.cjs similarity index 100% rename from .eslintrc.cjs rename to client/.eslintrc.cjs diff --git a/.gitignore b/client/.gitignore similarity index 100% rename from .gitignore rename to client/.gitignore diff --git a/README.md b/client/README.md similarity index 100% rename from README.md rename to client/README.md diff --git a/index.html b/client/index.html similarity index 100% rename from index.html rename to client/index.html diff --git a/package-lock.json b/client/package-lock.json similarity index 100% rename from package-lock.json rename to client/package-lock.json diff --git a/package.json b/client/package.json similarity index 100% rename from package.json rename to client/package.json diff --git a/public/arrow.png b/client/public/arrow.png similarity index 100% rename from public/arrow.png rename to client/public/arrow.png diff --git a/public/attachment.png b/client/public/attachment.png similarity index 100% rename from public/attachment.png rename to client/public/attachment.png diff --git a/public/bg.png b/client/public/bg.png similarity index 100% rename from public/bg.png rename to client/public/bg.png diff --git a/public/bot.png b/client/public/bot.png similarity index 100% rename from public/bot.png rename to client/public/bot.png diff --git a/public/chat.png b/client/public/chat.png similarity index 100% rename from public/chat.png rename to client/public/chat.png diff --git a/public/code.png b/client/public/code.png similarity index 100% rename from public/code.png rename to client/public/code.png diff --git a/public/favicon.ico b/client/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to client/public/favicon.ico diff --git a/public/human1.jpeg b/client/public/human1.jpeg similarity index 100% rename from public/human1.jpeg rename to client/public/human1.jpeg diff --git a/public/human2.jpeg b/client/public/human2.jpeg similarity index 100% rename from public/human2.jpeg rename to client/public/human2.jpeg diff --git a/public/image.png b/client/public/image.png similarity index 100% rename from public/image.png rename to client/public/image.png diff --git a/public/logo.png b/client/public/logo.png similarity index 100% rename from public/logo.png rename to client/public/logo.png diff --git a/public/orbital.png b/client/public/orbital.png similarity index 100% rename from public/orbital.png rename to client/public/orbital.png diff --git a/src/App.jsx b/client/src/App.jsx similarity index 100% rename from src/App.jsx rename to client/src/App.jsx diff --git a/src/components/chatList/ChatList.jsx b/client/src/components/chatList/ChatList.jsx similarity index 100% rename from src/components/chatList/ChatList.jsx rename to client/src/components/chatList/ChatList.jsx diff --git a/src/components/chatList/chatList.css b/client/src/components/chatList/chatList.css similarity index 100% rename from src/components/chatList/chatList.css rename to client/src/components/chatList/chatList.css diff --git a/src/components/newPrompt/NewPrompt.jsx b/client/src/components/newPrompt/NewPrompt.jsx similarity index 100% rename from src/components/newPrompt/NewPrompt.jsx rename to client/src/components/newPrompt/NewPrompt.jsx diff --git a/src/components/newPrompt/newPrompt.css b/client/src/components/newPrompt/newPrompt.css similarity index 100% rename from src/components/newPrompt/newPrompt.css rename to client/src/components/newPrompt/newPrompt.css diff --git a/src/index.css b/client/src/index.css similarity index 100% rename from src/index.css rename to client/src/index.css diff --git a/src/layouts/dashboardLayout/DashboardLayout.jsx b/client/src/layouts/dashboardLayout/DashboardLayout.jsx similarity index 100% rename from src/layouts/dashboardLayout/DashboardLayout.jsx rename to client/src/layouts/dashboardLayout/DashboardLayout.jsx diff --git a/src/layouts/dashboardLayout/dashboardLayout.css b/client/src/layouts/dashboardLayout/dashboardLayout.css similarity index 100% rename from src/layouts/dashboardLayout/dashboardLayout.css rename to client/src/layouts/dashboardLayout/dashboardLayout.css diff --git a/src/layouts/rootLayout/rootLayout.css b/client/src/layouts/rootLayout/rootLayout.css similarity index 100% rename from src/layouts/rootLayout/rootLayout.css rename to client/src/layouts/rootLayout/rootLayout.css diff --git a/src/layouts/rootLayout/RootLayout.jsx b/client/src/layouts/rootLayout/rootLayout.jsx similarity index 100% rename from src/layouts/rootLayout/RootLayout.jsx rename to client/src/layouts/rootLayout/rootLayout.jsx diff --git a/src/main.jsx b/client/src/main.jsx similarity index 70% rename from src/main.jsx rename to client/src/main.jsx index 96dc3b14..b35217fb 100644 --- a/src/main.jsx +++ b/client/src/main.jsx @@ -4,12 +4,12 @@ import { createRoot } from "react-dom/client"; import { createBrowserRouter, RouterProvider } from "react-router-dom"; import "./index.css"; import RootLayout from "./layouts/rootLayout/rootLayout.jsx"; -import HomePage from "../src/routes/homepage/HomePage.jsx"; -import DashboardPage from "../src/routes/dashboardPage/DashboardPage.jsx"; -import ChatPage from "./routes/chatPage/ChatPage"; -import DashboardLayout from "../src/layouts/dashboardLayout/DashboardLayout.jsx"; -import SignInPage from "../src/routes/signInPage/SignInPage.jsx"; -import SignUpPage from "../src/routes/signUpPage/SignUpPage.jsx"; +import HomePage from "./routes/homepage/HomePage.jsx"; +import DashboardPage from "./routes/dashboardPage/DashboardPage.jsx"; +import ChatPage from "./routes/chatPage/ChatPage.jsx"; +import DashboardLayout from "./layouts/dashboardLayout/DashboardLayout.jsx"; +import SignInPage from "./routes/signInPage/SignInPage.jsx"; +import SignUpPage from "./routes/signUpPage/SignUpPage.jsx"; const router = createBrowserRouter([ { diff --git a/src/routes/chatPage/ChatPage.jsx b/client/src/routes/chatPage/ChatPage.jsx similarity index 100% rename from src/routes/chatPage/ChatPage.jsx rename to client/src/routes/chatPage/ChatPage.jsx diff --git a/src/routes/chatPage/chatPage.css b/client/src/routes/chatPage/chatPage.css similarity index 100% rename from src/routes/chatPage/chatPage.css rename to client/src/routes/chatPage/chatPage.css diff --git a/src/routes/dashboardPage/DashboardPage.jsx b/client/src/routes/dashboardPage/DashboardPage.jsx similarity index 100% rename from src/routes/dashboardPage/DashboardPage.jsx rename to client/src/routes/dashboardPage/DashboardPage.jsx diff --git a/src/routes/dashboardPage/dashboardPage.css b/client/src/routes/dashboardPage/dashboardPage.css similarity index 100% rename from src/routes/dashboardPage/dashboardPage.css rename to client/src/routes/dashboardPage/dashboardPage.css diff --git a/src/routes/homepage/HomePage.jsx b/client/src/routes/homepage/HomePage.jsx similarity index 100% rename from src/routes/homepage/HomePage.jsx rename to client/src/routes/homepage/HomePage.jsx diff --git a/src/routes/homepage/homepage.css b/client/src/routes/homepage/homepage.css similarity index 100% rename from src/routes/homepage/homepage.css rename to client/src/routes/homepage/homepage.css diff --git a/src/routes/signInPage/SignInPage.jsx b/client/src/routes/signInPage/SignInPage.jsx similarity index 100% rename from src/routes/signInPage/SignInPage.jsx rename to client/src/routes/signInPage/SignInPage.jsx diff --git a/src/routes/signInPage/signInPage.css b/client/src/routes/signInPage/signInPage.css similarity index 100% rename from src/routes/signInPage/signInPage.css rename to client/src/routes/signInPage/signInPage.css diff --git a/src/routes/signUpPage/SignUpPage.jsx b/client/src/routes/signUpPage/SignUpPage.jsx similarity index 100% rename from src/routes/signUpPage/SignUpPage.jsx rename to client/src/routes/signUpPage/SignUpPage.jsx diff --git a/src/routes/signUpPage/signUpPage.css b/client/src/routes/signUpPage/signUpPage.css similarity index 100% rename from src/routes/signUpPage/signUpPage.css rename to client/src/routes/signUpPage/signUpPage.css diff --git a/vite.config.js b/client/vite.config.js similarity index 100% rename from vite.config.js rename to client/vite.config.js From 11f6ea0fa58a0658adfbafc16dc295a00d9b5ca6 Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Fri, 25 Oct 2024 18:27:49 +0200 Subject: [PATCH 22/25] create server --- backend/.gitignore | 1 + backend/index.js | 12 + backend/package-lock.json | 1056 +++++++++++++++++++++++++++++++++++++ backend/package.json | 18 + 4 files changed, 1087 insertions(+) create mode 100644 backend/.gitignore create mode 100644 backend/index.js create mode 100644 backend/package-lock.json create mode 100644 backend/package.json diff --git a/backend/.gitignore b/backend/.gitignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/backend/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/backend/index.js b/backend/index.js new file mode 100644 index 00000000..d88ca4a0 --- /dev/null +++ b/backend/index.js @@ -0,0 +1,12 @@ +import express from "express"; + +const port = process.env.PORT || 3000; +const app = express(); + +app.get("/test", (req, res) => { + res.send("it works!"); +}); + +app.listen(port, () => { + console.log("Server running on 3000"); +}); diff --git a/backend/package-lock.json b/backend/package-lock.json new file mode 100644 index 00000000..f98fd263 --- /dev/null +++ b/backend/package-lock.json @@ -0,0 +1,1056 @@ +{ + "name": "backend", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "backend", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "express": "^4.21.1", + "nodemon": "^3.1.7" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.10", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.7.tgz", + "integrity": "sha512-hLj7fuMow6f0lbB0cD14Lz2xNjwsyruH251Pk4t/yIitCFJbmY1myuLlHm/q06aST4jg6EgAh74PIBBrRqpVAQ==", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/backend/package.json b/backend/package.json new file mode 100644 index 00000000..a9802090 --- /dev/null +++ b/backend/package.json @@ -0,0 +1,18 @@ +{ + "name": "backend", + "version": "1.0.0", + "description": "", + "main": "index.js", + "type": "module", + "scripts": { + "start": "node index.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.21.1", + "nodemon": "^3.1.7" + } +} From 118bfa95991821812b3c33bef1c402b14307167c Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sat, 26 Oct 2024 21:18:00 +0200 Subject: [PATCH 23/25] upload imagekit --- backend/.env | 3 ++ backend/index.js | 8 ++- backend/package-lock.json | 111 ++++++++++++++++++++++++++++++++++++++ backend/package.json | 1 + 4 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 backend/.env diff --git a/backend/.env b/backend/.env new file mode 100644 index 00000000..6ed52726 --- /dev/null +++ b/backend/.env @@ -0,0 +1,3 @@ +IMAGE_KIT_ENDPOINT = https://ik.imagekit.io/rm4xafy4n +IMAGE_KIT_PUBLIC_KEY = public_i8BCEItAkh0yBCc7U696zl/pYcs= +IMAGE_KIT_PRIVATE_KEY = private_Tt7ocQuHzg6RMRrXqHXYne4G6Ls= \ No newline at end of file diff --git a/backend/index.js b/backend/index.js index d88ca4a0..425d84a6 100644 --- a/backend/index.js +++ b/backend/index.js @@ -3,7 +3,13 @@ import express from "express"; const port = process.env.PORT || 3000; const app = express(); -app.get("/test", (req, res) => { +const imagekit = new ImageKit({ + urlEndpoint: process.env.IMAGE_KIT_ENDPOINT, + publicKey: process.env.IMAGE_KIT_PUBLIC_KEY, + privateKey: process.env.IMAGE_KIT_PRIVATE_KEY, +}); + +app.get("/api/upload", (req, res) => { res.send("it works!"); }); diff --git a/backend/package-lock.json b/backend/package-lock.json index f98fd263..2d7bd756 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -10,6 +10,7 @@ "license": "ISC", "dependencies": { "express": "^4.21.1", + "imagekit": "^5.2.0", "nodemon": "^3.1.7" } }, @@ -42,6 +43,21 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -163,6 +179,17 @@ "fsevents": "~2.3.2" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -232,6 +259,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -389,6 +424,38 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -466,6 +533,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hamming-distance": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hamming-distance/-/hamming-distance-1.0.0.tgz", + "integrity": "sha512-hYz2IIKtyuZGfOqCs7skNiFEATf+v9IUNSOaQSr6Ll4JOxxWhOvXvc3mIdCW82Z3xW+zUoto7N/ssD4bDxAWoA==" + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -549,6 +621,22 @@ "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" }, + "node_modules/imagekit": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/imagekit/-/imagekit-5.2.0.tgz", + "integrity": "sha512-gq3tJ/pdO/LyaDtNmROERm7DE6oVOI9u7UOBFnoNA0JAEKnQzGh31/LKlFgho2BYonVViw7mZMo2H0KLO68Rww==", + "dependencies": { + "axios": "^1.6.5", + "form-data": "^4.0.0", + "hamming-distance": "^1.0.0", + "lodash": "^4.17.15", + "tslib": "^2.4.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -600,6 +688,11 @@ "node": ">=0.12.0" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -771,6 +864,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", @@ -1011,6 +1109,11 @@ "nodetouch": "bin/nodetouch.js" } }, + "node_modules/tslib": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz", + "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==" + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1044,6 +1147,14 @@ "node": ">= 0.4.0" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/backend/package.json b/backend/package.json index a9802090..7e87e586 100644 --- a/backend/package.json +++ b/backend/package.json @@ -13,6 +13,7 @@ "license": "ISC", "dependencies": { "express": "^4.21.1", + "imagekit": "^5.2.0", "nodemon": "^3.1.7" } } From 1d3e9778598cf94c0481b1cc660d8ce271e0c91e Mon Sep 17 00:00:00 2001 From: mkpage1337 Date: Sat, 26 Oct 2024 21:51:40 +0200 Subject: [PATCH 24/25] upload img --- backend/.env | 4 +- backend/index.js | 11 +++- backend/package-lock.json | 21 +++++++ backend/package.json | 3 +- client/src/components/newPrompt/NewPrompt.jsx | 24 +++++-- client/src/components/upload/Upload.jsx | 62 +++++++++++++++++++ 6 files changed, 117 insertions(+), 8 deletions(-) create mode 100644 client/src/components/upload/Upload.jsx diff --git a/backend/.env b/backend/.env index 6ed52726..7514bbbe 100644 --- a/backend/.env +++ b/backend/.env @@ -1,3 +1,5 @@ IMAGE_KIT_ENDPOINT = https://ik.imagekit.io/rm4xafy4n IMAGE_KIT_PUBLIC_KEY = public_i8BCEItAkh0yBCc7U696zl/pYcs= -IMAGE_KIT_PRIVATE_KEY = private_Tt7ocQuHzg6RMRrXqHXYne4G6Ls= \ No newline at end of file +IMAGE_KIT_PRIVATE_KEY = private_Tt7ocQuHzg6RMRrXqHXYne4G6Ls= + +CLIENT_URL = http://localhost:5173 \ No newline at end of file diff --git a/backend/index.js b/backend/index.js index 425d84a6..08658698 100644 --- a/backend/index.js +++ b/backend/index.js @@ -1,8 +1,16 @@ import express from "express"; +import cors from "cors"; +import ImageKit from "imagekit"; const port = process.env.PORT || 3000; const app = express(); +app.use( + cors({ + origin: process.env.CLIENT_URL, + }) +); + const imagekit = new ImageKit({ urlEndpoint: process.env.IMAGE_KIT_ENDPOINT, publicKey: process.env.IMAGE_KIT_PUBLIC_KEY, @@ -10,7 +18,8 @@ const imagekit = new ImageKit({ }); app.get("/api/upload", (req, res) => { - res.send("it works!"); + const result = imagekit.getAuthenticationParameters(); + res.send(result); }); app.listen(port, () => { diff --git a/backend/package-lock.json b/backend/package-lock.json index 2d7bd756..9afe783d 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "cors": "^2.8.5", "express": "^4.21.1", "imagekit": "^5.2.0", "nodemon": "^3.1.7" @@ -227,6 +228,18 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/debug": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", @@ -806,6 +819,14 @@ "node": ">=0.10.0" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", diff --git a/backend/package.json b/backend/package.json index 7e87e586..4f632acf 100644 --- a/backend/package.json +++ b/backend/package.json @@ -5,13 +5,14 @@ "main": "index.js", "type": "module", "scripts": { - "start": "node index.js", + "start": "node --env-file .env index.js", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { + "cors": "^2.8.5", "express": "^4.21.1", "imagekit": "^5.2.0", "nodemon": "^3.1.7" diff --git a/client/src/components/newPrompt/NewPrompt.jsx b/client/src/components/newPrompt/NewPrompt.jsx index 67821c84..c25eb222 100644 --- a/client/src/components/newPrompt/NewPrompt.jsx +++ b/client/src/components/newPrompt/NewPrompt.jsx @@ -1,7 +1,15 @@ -import { useRef } from "react"; +import { useRef, useState } from "react"; +import { IKImage } from "imagekitio-react"; +import Upload from "../upload/Upload"; import "./newPrompt.css"; function NewPrompt() { + const [img, setImg] = useState({ + isLoading: false, + error: "", + dbData: {}, + }); + const endRef = useRef(null); useEffect(() => { @@ -10,12 +18,18 @@ function NewPrompt() { return ( <> - {/* add new chat */} + {img.isLoading &&

Loading..

} + {img.dbData?.filePath && ( + + )}
- +