From be83e14d81f82c95c003ee930ec9232339431be9 Mon Sep 17 00:00:00 2001 From: Ciana Date: Tue, 17 Mar 2026 19:27:42 -0400 Subject: [PATCH 01/35] pages folder --- package-lock.json | 3 +++ src/app/pages/.gitkeep | 0 2 files changed, 3 insertions(+) create mode 100644 src/app/pages/.gitkeep diff --git a/package-lock.json b/package-lock.json index f15a1ff..bf28413 100644 --- a/package-lock.json +++ b/package-lock.json @@ -952,6 +952,7 @@ "integrity": "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -1449,6 +1450,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -1458,6 +1460,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.27.0" }, diff --git a/src/app/pages/.gitkeep b/src/app/pages/.gitkeep new file mode 100644 index 0000000..e69de29 From c8ba89bf36431647490fa915664e508a50e34520 Mon Sep 17 00:00:00 2001 From: ria29973 Date: Tue, 17 Mar 2026 19:34:59 -0400 Subject: [PATCH 02/35] added folders for project structure --- webapp/.gitkeep | 0 webapp/server/mongodb/.gitkeep | 0 webapp/server/mongodb/models/actions/.gitkeep | 0 webapp/server/mongodb/models/index.js | 0 webapp/server/utils/.gitkeep | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 webapp/.gitkeep create mode 100644 webapp/server/mongodb/.gitkeep create mode 100644 webapp/server/mongodb/models/actions/.gitkeep create mode 100644 webapp/server/mongodb/models/index.js create mode 100644 webapp/server/utils/.gitkeep diff --git a/webapp/.gitkeep b/webapp/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/webapp/server/mongodb/.gitkeep b/webapp/server/mongodb/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/webapp/server/mongodb/models/actions/.gitkeep b/webapp/server/mongodb/models/actions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/webapp/server/mongodb/models/index.js b/webapp/server/mongodb/models/index.js new file mode 100644 index 0000000..e69de29 diff --git a/webapp/server/utils/.gitkeep b/webapp/server/utils/.gitkeep new file mode 100644 index 0000000..e69de29 From 5078d6b72b9719f3e81f4c8d3f35527caeb1880d Mon Sep 17 00:00:00 2001 From: vynguyen-26 Date: Tue, 17 Mar 2026 19:38:25 -0400 Subject: [PATCH 03/35] move src into webapp --- {src => webapp/src}/app/favicon.ico | Bin {src => webapp/src}/app/globals.css | 0 {src => webapp/src}/app/layout.tsx | 0 {src => webapp/src}/app/page.tsx | 0 {src => webapp/src}/app/pages/.gitkeep | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {src => webapp/src}/app/favicon.ico (100%) rename {src => webapp/src}/app/globals.css (100%) rename {src => webapp/src}/app/layout.tsx (100%) rename {src => webapp/src}/app/page.tsx (100%) rename {src => webapp/src}/app/pages/.gitkeep (100%) diff --git a/src/app/favicon.ico b/webapp/src/app/favicon.ico similarity index 100% rename from src/app/favicon.ico rename to webapp/src/app/favicon.ico diff --git a/src/app/globals.css b/webapp/src/app/globals.css similarity index 100% rename from src/app/globals.css rename to webapp/src/app/globals.css diff --git a/src/app/layout.tsx b/webapp/src/app/layout.tsx similarity index 100% rename from src/app/layout.tsx rename to webapp/src/app/layout.tsx diff --git a/src/app/page.tsx b/webapp/src/app/page.tsx similarity index 100% rename from src/app/page.tsx rename to webapp/src/app/page.tsx diff --git a/src/app/pages/.gitkeep b/webapp/src/app/pages/.gitkeep similarity index 100% rename from src/app/pages/.gitkeep rename to webapp/src/app/pages/.gitkeep From 933a5dc015429f0362664e7f6708cd2faac1be9b Mon Sep 17 00:00:00 2001 From: vynguyen-26 Date: Tue, 31 Mar 2026 17:50:13 -0400 Subject: [PATCH 04/35] move api folder into pages --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e89a20..016e186 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ export default function Page() { ## Backend Specifications - We will be incorporating all we have learned thus far such as API endpoints and database querying! -- Create all endpoints in `src/app/api` +- Create all endpoints in `src/pages/api` - Reminder that routes are created by using a `route.ts` file ### Create Operations From 3d0ff950d1472862c2bd7c8382e46087a7223d2f Mon Sep 17 00:00:00 2001 From: vynguyen-26 Date: Tue, 31 Mar 2026 17:50:13 -0400 Subject: [PATCH 05/35] move api folder into pages --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e89a20..016e186 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ export default function Page() { ## Backend Specifications - We will be incorporating all we have learned thus far such as API endpoints and database querying! -- Create all endpoints in `src/app/api` +- Create all endpoints in `src/pages/api` - Reminder that routes are created by using a `route.ts` file ### Create Operations From 87335e6bca85e28952fb0832966d69c7f31300fd Mon Sep 17 00:00:00 2001 From: Ciana Date: Sun, 5 Apr 2026 12:55:07 -0400 Subject: [PATCH 06/35] file changes --- src/app/components/.gitkeep | 0 src/styles/.gitkeep | 0 src/{app => styles}/globals.css | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/app/components/.gitkeep create mode 100644 src/styles/.gitkeep rename src/{app => styles}/globals.css (100%) diff --git a/src/app/components/.gitkeep b/src/app/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/styles/.gitkeep b/src/styles/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/app/globals.css b/src/styles/globals.css similarity index 100% rename from src/app/globals.css rename to src/styles/globals.css From ea0799573238bc22ab88fb969546cb966e289f6d Mon Sep 17 00:00:00 2001 From: clee_ Date: Sun, 5 Apr 2026 13:06:29 -0400 Subject: [PATCH 07/35] Initialize _app.tsx with global styles and App component --- webapp/src/app/pages/_app.tsx | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 webapp/src/app/pages/_app.tsx diff --git a/webapp/src/app/pages/_app.tsx b/webapp/src/app/pages/_app.tsx new file mode 100644 index 0000000..a7a790f --- /dev/null +++ b/webapp/src/app/pages/_app.tsx @@ -0,0 +1,6 @@ +import "@/styles/globals.css"; +import type { AppProps } from "next/app"; + +export default function App({ Component, pageProps }: AppProps) { + return ; +} From a50aef4f38d72648658f57a369ab7cef8faf2843 Mon Sep 17 00:00:00 2001 From: clee_ Date: Sun, 5 Apr 2026 13:06:58 -0400 Subject: [PATCH 08/35] Add custom Document component for Next.js --- webapp/src/app/pages/_document.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 webapp/src/app/pages/_document.tsx diff --git a/webapp/src/app/pages/_document.tsx b/webapp/src/app/pages/_document.tsx new file mode 100644 index 0000000..cd1cbe4 --- /dev/null +++ b/webapp/src/app/pages/_document.tsx @@ -0,0 +1,16 @@ +import { Html, Head, Main, NextScript } from "next/document"; + +export default function Document() { + return ( + + + +
+ + + + ); +} From 1369efd7836c0fc711c9262e945d0963e3787e57 Mon Sep 17 00:00:00 2001 From: clee_ Date: Sun, 5 Apr 2026 13:07:10 -0400 Subject: [PATCH 09/35] Delete webapp/src/app/pages/.gitkeep --- webapp/src/app/pages/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 webapp/src/app/pages/.gitkeep diff --git a/webapp/src/app/pages/.gitkeep b/webapp/src/app/pages/.gitkeep deleted file mode 100644 index e69de29..0000000 From 62e7184dbe73ff8f3fc3b729c4e8462bb819e4c5 Mon Sep 17 00:00:00 2001 From: clee_ Date: Sun, 5 Apr 2026 13:10:36 -0400 Subject: [PATCH 10/35] Delete webapp/src/app/layout.tsx --- webapp/src/app/layout.tsx | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 webapp/src/app/layout.tsx diff --git a/webapp/src/app/layout.tsx b/webapp/src/app/layout.tsx deleted file mode 100644 index f7fa87e..0000000 --- a/webapp/src/app/layout.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; -import "./globals.css"; - -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); - -export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", -}; - -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return ( - - - {children} - - - ); -} From 6f8d36cb2a6056522214269295ab21981698de8e Mon Sep 17 00:00:00 2001 From: Ciana Date: Sun, 5 Apr 2026 13:15:20 -0400 Subject: [PATCH 11/35] fixed src folder file structure changed to page router --- webapp/.gitkeep | 0 webapp/src/app/favicon.ico | Bin 25931 -> 0 bytes webapp/src/{app => }/pages/_app.tsx | 0 webapp/src/{app => }/pages/_document.tsx | 0 webapp/src/{app/page.tsx => pages/index.tsx} | 15 +++++++++++++-- webapp/src/{app => styles}/globals.css | 0 6 files changed, 13 insertions(+), 2 deletions(-) delete mode 100644 webapp/.gitkeep delete mode 100644 webapp/src/app/favicon.ico rename webapp/src/{app => }/pages/_app.tsx (100%) rename webapp/src/{app => }/pages/_document.tsx (100%) rename webapp/src/{app/page.tsx => pages/index.tsx} (87%) rename webapp/src/{app => styles}/globals.css (100%) diff --git a/webapp/.gitkeep b/webapp/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/webapp/src/app/favicon.ico b/webapp/src/app/favicon.ico deleted file mode 100644 index 718d6fea4835ec2d246af9800eddb7ffb276240c..0000000000000000000000000000000000000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X=Ar8W|^Ms41Fm8o6IB2_j60eOeBB1Br!boW7JnoeX6Gs)?7rW0^5psc- zjS16yb>dFn>KPOF;imD}e!enuIniFzv}n$m2#gCCv4jM#ArwlzZ$7@9&XkFxZ4n!V zj3dyiwW4Ki2QG{@i>yuZXQizw_OkZI^-3otXC{!(lUpJF33gI60ak;Uqitp74|B6I zgg{b=Iz}WkhCGj1M=hu4#Aw173YxIVbISaoc z-nLZC*6Tgivd5V`K%GxhBsp@SUU60-rfc$=wb>zdJzXS&-5(NRRodFk;Kxk!S(O(a0e7oY=E( zAyS;Ow?6Q&XA+cnkCb{28_1N8H#?J!*$MmIwLq^*T_9-z^&UE@A(z9oGYtFy6EZef LrJugUA?W`A8`#=m diff --git a/webapp/src/app/pages/_app.tsx b/webapp/src/pages/_app.tsx similarity index 100% rename from webapp/src/app/pages/_app.tsx rename to webapp/src/pages/_app.tsx diff --git a/webapp/src/app/pages/_document.tsx b/webapp/src/pages/_document.tsx similarity index 100% rename from webapp/src/app/pages/_document.tsx rename to webapp/src/pages/_document.tsx diff --git a/webapp/src/app/page.tsx b/webapp/src/pages/index.tsx similarity index 87% rename from webapp/src/app/page.tsx rename to webapp/src/pages/index.tsx index 295f8fd..b0b9981 100644 --- a/webapp/src/app/page.tsx +++ b/webapp/src/pages/index.tsx @@ -1,8 +1,19 @@ import Image from "next/image"; +import { Geist, Geist_Mono } from "next/font/google"; + +const geistSans = Geist({ + variable: "--font-geist-sans", + subsets: ["latin"], +}); + +const geistMono = Geist_Mono({ + variable: "--font-geist-mono", + subsets: ["latin"], +}); export default function Home() { return ( -
+
); -} +} \ No newline at end of file diff --git a/webapp/src/app/globals.css b/webapp/src/styles/globals.css similarity index 100% rename from webapp/src/app/globals.css rename to webapp/src/styles/globals.css From a14fc6dc2fb826d03d2f867ed538e2d2f5a593ba Mon Sep 17 00:00:00 2001 From: Ciana Date: Sun, 5 Apr 2026 13:53:02 -0400 Subject: [PATCH 12/35] create login page --- src/pages/index.tsx | 92 ++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 69 deletions(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 5fa37db..eaa2f74 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,76 +1,30 @@ -import Image from "next/image"; -import { Geist, Geist_Mono } from "next/font/google"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); export default function Home() { return ( -
-
- Next.js logo -
-

- To get started, edit the page.tsx file. -

-

- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - - Learning - {" "} - center. -

-
- -
+
+
+ +

Progress

+
+
+

Login

+
+
+
+ + +
+
+ + +
+ +
+
+

Don't have an account? Sign up

+
+
); } From 97f482f5980da8a2432e62f1db129c0531445b08 Mon Sep 17 00:00:00 2001 From: Ciana Date: Sun, 5 Apr 2026 13:55:23 -0400 Subject: [PATCH 13/35] Delete .gitkeep of wrong folders --- src/app/components/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/app/components/.gitkeep diff --git a/src/app/components/.gitkeep b/src/app/components/.gitkeep deleted file mode 100644 index e69de29..0000000 From cab76f4ae6cf1e7e3d908abbd8c311f209428bbc Mon Sep 17 00:00:00 2001 From: Ciana Date: Sun, 5 Apr 2026 14:10:07 -0400 Subject: [PATCH 14/35] removed "Webapp" folder moved src and server to root --- {webapp/server => server}/mongodb/.gitkeep | 0 {webapp/server => server}/mongodb/connectDb.ts | 0 {webapp/server => server}/mongodb/instrumentation.ts | 0 {webapp/server => server}/mongodb/models/actions/.gitkeep | 0 {webapp/server => server}/mongodb/models/index.js | 0 {webapp/server => server}/utils/.gitkeep | 0 {webapp/src => src}/pages/_app.tsx | 0 {webapp/src => src}/pages/_document.tsx | 0 {webapp/src => src}/pages/index.tsx | 0 {webapp/src => src}/styles/globals.css | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename {webapp/server => server}/mongodb/.gitkeep (100%) rename {webapp/server => server}/mongodb/connectDb.ts (100%) rename {webapp/server => server}/mongodb/instrumentation.ts (100%) rename {webapp/server => server}/mongodb/models/actions/.gitkeep (100%) rename {webapp/server => server}/mongodb/models/index.js (100%) rename {webapp/server => server}/utils/.gitkeep (100%) rename {webapp/src => src}/pages/_app.tsx (100%) rename {webapp/src => src}/pages/_document.tsx (100%) rename {webapp/src => src}/pages/index.tsx (100%) rename {webapp/src => src}/styles/globals.css (100%) diff --git a/webapp/server/mongodb/.gitkeep b/server/mongodb/.gitkeep similarity index 100% rename from webapp/server/mongodb/.gitkeep rename to server/mongodb/.gitkeep diff --git a/webapp/server/mongodb/connectDb.ts b/server/mongodb/connectDb.ts similarity index 100% rename from webapp/server/mongodb/connectDb.ts rename to server/mongodb/connectDb.ts diff --git a/webapp/server/mongodb/instrumentation.ts b/server/mongodb/instrumentation.ts similarity index 100% rename from webapp/server/mongodb/instrumentation.ts rename to server/mongodb/instrumentation.ts diff --git a/webapp/server/mongodb/models/actions/.gitkeep b/server/mongodb/models/actions/.gitkeep similarity index 100% rename from webapp/server/mongodb/models/actions/.gitkeep rename to server/mongodb/models/actions/.gitkeep diff --git a/webapp/server/mongodb/models/index.js b/server/mongodb/models/index.js similarity index 100% rename from webapp/server/mongodb/models/index.js rename to server/mongodb/models/index.js diff --git a/webapp/server/utils/.gitkeep b/server/utils/.gitkeep similarity index 100% rename from webapp/server/utils/.gitkeep rename to server/utils/.gitkeep diff --git a/webapp/src/pages/_app.tsx b/src/pages/_app.tsx similarity index 100% rename from webapp/src/pages/_app.tsx rename to src/pages/_app.tsx diff --git a/webapp/src/pages/_document.tsx b/src/pages/_document.tsx similarity index 100% rename from webapp/src/pages/_document.tsx rename to src/pages/_document.tsx diff --git a/webapp/src/pages/index.tsx b/src/pages/index.tsx similarity index 100% rename from webapp/src/pages/index.tsx rename to src/pages/index.tsx diff --git a/webapp/src/styles/globals.css b/src/styles/globals.css similarity index 100% rename from webapp/src/styles/globals.css rename to src/styles/globals.css From a273db939740b6d9e30f6a379e0a289c376e3553 Mon Sep 17 00:00:00 2001 From: Ciana Date: Sun, 5 Apr 2026 17:13:08 -0400 Subject: [PATCH 15/35] Create login page layout --- src/pages/_app.tsx | 18 +++++++++++++++++- src/pages/index.tsx | 43 ++++++++++++++++++++++++------------------ src/styles/globals.css | 2 ++ 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index a7a790f..6ee68fa 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,6 +1,22 @@ import "@/styles/globals.css"; import type { AppProps } from "next/app"; +import { Oswald , Heebo} from "next/font/google"; + +const oswald = Oswald({ + subsets: ["latin"], + variable: "--font-oswald", + weight: ["400", "500", "700"], +}); + +const heebo = Heebo({ + subsets: ["latin"], + variable: "--font-heebo", + weight: ["400", "500", "700", "800"], +}); export default function App({ Component, pageProps }: AppProps) { - return ; + return (
+ ; +
+ ) } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 72aed15..a4e02a8 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,30 +1,37 @@ - +import Link from "next/link"; export default function Home() { return ( -
-
- -

Progress

+
+
+ +

Progress

-
-

Login

-
-
-
- - +
+

Login

+
+ +
+
-
- - +
+
- +
-

Don't have an account? Sign up

+

Don't have an account? + Sign up +

+
-
+
+ +
+
+

Made with ♡ by Long Lam

+

© 2023 BOG Developer Bootcamp. All rights reserved.

+
); } \ No newline at end of file diff --git a/src/styles/globals.css b/src/styles/globals.css index a2dc41e..c991a17 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -10,6 +10,8 @@ --color-foreground: var(--foreground); --font-sans: var(--font-geist-sans); --font-mono: var(--font-geist-mono); + --font-oswald: var(--font-oswald); + --font-heebo: var(--font-heebo); } @media (prefers-color-scheme: dark) { From 1cd312939e500bcc92246750ac55df56d25a49f9 Mon Sep 17 00:00:00 2001 From: ria29973 Date: Mon, 6 Apr 2026 01:25:50 -0400 Subject: [PATCH 16/35] completed backend for login/signup pages --- package-lock.json | 159 ++++++++++++++++++++++++++++++++++ package.json | 3 + server/mongodb/models/User.ts | 11 +++ src/pages/api/login.ts | 48 ++++++++++ src/pages/api/signup.ts | 58 +++++++++++++ src/pages/dashboard.tsx | 7 ++ src/pages/index.tsx | 53 +++++++++++- src/pages/signup.tsx | 113 ++++++++++++++++++++++++ 8 files changed, 448 insertions(+), 4 deletions(-) create mode 100644 server/mongodb/models/User.ts create mode 100644 src/pages/api/login.ts create mode 100644 src/pages/api/signup.ts create mode 100644 src/pages/dashboard.tsx create mode 100644 src/pages/signup.tsx diff --git a/package-lock.json b/package-lock.json index 9e5473c..11e636e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "project2-f25", "version": "0.1.0", "dependencies": { + "argon2": "^0.44.0", + "bcrypt": "^6.0.0", + "bcryptjs": "^3.0.3", "mongoose": "^9.3.3", "next": "16.0.1", "react": "19.2.0", @@ -46,6 +49,12 @@ "tslib": "^2.4.0" } }, + "node_modules/@epic-web/invariant": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz", + "integrity": "sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==", + "license": "MIT" + }, "node_modules/@img/colour": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", @@ -667,6 +676,15 @@ "node": ">= 10" } }, + "node_modules/@phc/format": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@phc/format/-/format-1.0.0.tgz", + "integrity": "sha512-m7X9U6BG2+J+R1lSOdCiITLLrxm+cWlNI3HUFA92oLO77ObGNzaKdh8pMLqdZcshtkKuV84olNNXDfMc4FezBQ==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/@swc/helpers": { "version": "0.5.15", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", @@ -993,6 +1011,22 @@ "@types/webidl-conversions": "*" } }, + "node_modules/argon2": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/argon2/-/argon2-0.44.0.tgz", + "integrity": "sha512-zHPGN3S55sihSQo0dBbK0A5qpi2R31z7HZDZnry3ifOyj8bZZnpZND2gpmhnRGO1V/d555RwBqIK5W4Mrmv3ig==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@phc/format": "^1.0.0", + "cross-env": "^10.0.0", + "node-addon-api": "^8.5.0", + "node-gyp-build": "^4.8.4" + }, + "engines": { + "node": ">=16.17.0" + } + }, "node_modules/baseline-browser-mapping": { "version": "2.10.13", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.13.tgz", @@ -1006,6 +1040,29 @@ "node": ">=6.0.0" } }, + "node_modules/bcrypt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-6.0.0.tgz", + "integrity": "sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-addon-api": "^8.3.0", + "node-gyp-build": "^4.8.4" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/bcryptjs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-3.0.3.tgz", + "integrity": "sha512-GlF5wPWnSa/X5LKM1o0wz0suXIINz1iHRLvTS+sLyi7XPbe5ycmYI3DlZqVGZZtDgl4DmasFg7gOB3JYbphV5g==", + "license": "BSD-3-Clause", + "bin": { + "bcrypt": "bin/bcrypt" + } + }, "node_modules/bson": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/bson/-/bson-7.2.0.tgz", @@ -1041,6 +1098,37 @@ "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", "license": "MIT" }, + "node_modules/cross-env": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz", + "integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==", + "license": "MIT", + "dependencies": { + "@epic-web/invariant": "^1.0.0", + "cross-spawn": "^7.0.6" + }, + "bin": { + "cross-env": "dist/bin/cross-env.js", + "cross-env-shell": "dist/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", @@ -1079,6 +1167,12 @@ "dev": true, "license": "ISC" }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, "node_modules/jiti": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", @@ -1577,6 +1671,35 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/node-addon-api": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.7.0.tgz", + "integrity": "sha512-9MdFxmkKaOYVTV+XVRG8ArDwwQ77XIgIPyKASB1k3JPq3M8fGQQQE3YpMOrKm6g//Ktx8ivZr8xo1Qmtqub+GA==", + "license": "MIT", + "engines": { + "node": "^18 || ^20 || >= 21" + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -1706,6 +1829,27 @@ "@img/sharp-win32-x64": "0.34.4" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/sift": { "version": "17.1.3", "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", @@ -1834,6 +1978,21 @@ "engines": { "node": ">=18" } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } } } } diff --git a/package.json b/package.json index 8b704f3..30253af 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,9 @@ "start": "next start" }, "dependencies": { + "argon2": "^0.44.0", + "bcrypt": "^6.0.0", + "bcryptjs": "^3.0.3", "mongoose": "^9.3.3", "next": "16.0.1", "react": "19.2.0", diff --git a/server/mongodb/models/User.ts b/server/mongodb/models/User.ts new file mode 100644 index 0000000..c59c319 --- /dev/null +++ b/server/mongodb/models/User.ts @@ -0,0 +1,11 @@ +import mongoose from "mongoose"; + +const UserSchema = new mongoose.Schema({ + fullName : {type: String, required: true}, + email: { type: String, required: true}, + password: {type : String, required: true}, + isAdmin: {type: Boolean, default: false} +}); + +// Prevent model overwrite error in Next.js +export default mongoose.models.User || mongoose.model("User", UserSchema); \ No newline at end of file diff --git a/src/pages/api/login.ts b/src/pages/api/login.ts new file mode 100644 index 0000000..00b449e --- /dev/null +++ b/src/pages/api/login.ts @@ -0,0 +1,48 @@ +import type { NextApiRequest, NextApiResponse } from "next"; +import connectDb from "../../../server/mongodb/connectDb"; +import User from "../../../server/mongodb/models/User"; +import argon2 from "argon2"; + + +export default async function handler ( + req: NextApiRequest, + res: NextApiResponse +) { + if (req.method !== "POST") { + return res.status(405).json({ success: false, error: "Method not allowed" }); + } + const {email, password} = await req.body; + if (!email || !password) { + return res + .status(400) + .json({ success: false, error: "Please fill in all fields" }); + } + + try { + await connectDb(); + + const user = await User.findOne({ email }); + if (!user) { + return res + .status(400) + .json({ success: false, error: "User does not exist" }); + } + const isMatch = await argon2.verify(user.password, password); + if (!isMatch) { + return res + .status(400) + .json({success: false, error: "password does not match"}); + } + return res.status(200).json({success: true, userid: user._id, isAdmin: user.isAdmin, + }); + + } + catch (err) { + console.error(err); + return res + .status(500) + .json({ success: false, error: "Server error. Please try again." }); + } + + +} \ No newline at end of file diff --git a/src/pages/api/signup.ts b/src/pages/api/signup.ts new file mode 100644 index 0000000..3449fcd --- /dev/null +++ b/src/pages/api/signup.ts @@ -0,0 +1,58 @@ +import type { NextApiRequest, NextApiResponse } from "next"; +import connectDb from "../../../server/mongodb/connectDb"; +import User from "../../../server/mongodb/models/User"; +import argon2 from "argon2"; + +export default async function handler( + req: NextApiRequest, + res: NextApiResponse +) { + if (req.method !== "POST") { + return res.status(405).json({ success: false, error: "Method not allowed" }); + } + + const { fullName, email, password, confirmPassword, isAdmin } = req.body; + + if (!fullName || !email || !password || !confirmPassword) { + return res + .status(400) + .json({ success: false, error: "Please fill in all fields" }); + } + + if (password !== confirmPassword) { + return res + .status(400) + .json({ success: false, error: "Passwords do not match" }); + } + + try { + await connectDb(); + + const existingUser = await User.findOne({ email }); + if (existingUser) { + return res + .status(400) + .json({ success: false, error: "User already exists" }); + } + + + const hashedPassword = await argon2.hash(password); + + + const newUser = await User.create({ + fullName, + email, + password: hashedPassword, + isAdmin: Boolean(isAdmin), + }); + + + return res.status(200).json({success: true, userid: newUser._id, isAdmin: newUser.isAdmin, + }); + } catch (err) { + console.error(err); + return res + .status(500) + .json({ success: false, error: "Server error. Please try again." }); + } +} \ No newline at end of file diff --git a/src/pages/dashboard.tsx b/src/pages/dashboard.tsx new file mode 100644 index 0000000..5a3a87a --- /dev/null +++ b/src/pages/dashboard.tsx @@ -0,0 +1,7 @@ +"use client"; +import Link from "next/link"; +import { useState } from "react"; +import { useRouter } from "next/navigation"; + +export default function Home() { +} \ No newline at end of file diff --git a/src/pages/index.tsx b/src/pages/index.tsx index a4e02a8..004a9d3 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,6 +1,44 @@ +"use client"; import Link from "next/link"; +import { useState } from "react"; +import { useRouter } from "next/navigation"; export default function Home() { + + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [error, setError] = useState(""); + const [loading, setLoading] = useState(false); + const router = useRouter(); + + const handleLogin = async (e: React.FormEvent) => { + e.preventDefault(); + setLoading(true); + setError(""); + + try { + const res = await fetch("/api/login", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ email, password }), + }); + + const data = await res.json(); + + if (data.success) { + router.push("dashboard") + + } else { + setError(data.error); + } + } catch (err) { + console.error(err); + setError("Something went wrong"); + } finally { + setLoading(false); + } + }; + return (
@@ -10,14 +48,21 @@ export default function Home() {

Login

-
+
- + setEmail(e.target.value)} + className="w-full border-0 border-b-2 border-[#d13a2f] bg-transparent text-xl outline-none"/>
- + setPassword(e.target.value)} + className="w-full border-0 border-b-2 border-[#d13a2f] bg-transparent text-xl outline-none"/>
- + + {error && (

{error}

)}

Don't have an account? diff --git a/src/pages/signup.tsx b/src/pages/signup.tsx new file mode 100644 index 0000000..f052057 --- /dev/null +++ b/src/pages/signup.tsx @@ -0,0 +1,113 @@ +"use client"; +import Link from "next/link"; +import { useState } from "react"; +import { useRouter } from "next/navigation"; + +export default function Home() { +const [fullName, setFullName] = useState(""); +const [email, setEmail] = useState(""); +const [password, setPassword] = useState(""); +const [confirmPassword, setConfirmPassword] = useState(""); +const [isAdmin, setIsAdmin] = useState(false); +const router = useRouter(); + +const [error, setError] = useState(""); +const [loading, setLoading] = useState(false); +const handleSignup = async (e: React.FormEvent) => { + e.preventDefault(); + setLoading(true); + setError(""); + + try { + const res = await fetch("/api/signup", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + fullName, + email, + password, + confirmPassword, + isAdmin, + }), + }); + + const data = await res.json(); + + if (data.success) { + router.push("/dashboard") + } else { + setError(data.error); + } + } catch (err) { + console.error(err); + setError("Something went wrong"); + } finally { + setLoading(false); + } +}; + + + return ( +

+
+ +

Progress

+
+
+

Create Account

+
+
+
+ setFullName(e.target.value)} + className="w-full border-0 border-b-2 border-[#d13a2f] bg-transparent text-xl outline-none"/> +
+
+ setEmail(e.target.value)} + className="w-full border-0 border-b-2 border-[#d13a2f] bg-transparent text-xl outline-none"/> +
+
+ setPassword(e.target.value)} + className="w-full border-0 border-b-2 border-[#d13a2f] bg-transparent text-xl outline-none"/> +
+
+ setConfirmPassword(e.target.value)} + className="w-full border-0 border-b-2 border-[#d13a2f] bg-transparent text-xl outline-none"/> +
+ + + {error && (

{error}

)} +
+
+

Already have an account? + Sign in +

+ +
+
+ +
+
+

Made with ♡ by Long Lam

+

© 2023 BOG Developer Bootcamp. All rights reserved.

+
+
+ ); +} \ No newline at end of file From 27ffb7dc3d980914b51caa5c7b0cbf4a2424e9a8 Mon Sep 17 00:00:00 2001 From: Ciana Date: Tue, 7 Apr 2026 10:59:51 -0400 Subject: [PATCH 17/35] Create sidebar & Relinked to Training Logs after login/signup The dashboard component will hold the sidebar and be returned in the different pages of the sidebar --- src/component/dashboard.tsx | 11 +++++++ src/component/sidebar.tsx | 66 +++++++++++++++++++++++++++++++++++++ src/pages/_app.tsx | 2 +- src/pages/animals.tsx | 0 src/pages/dashboard.tsx | 7 ---- src/pages/index.tsx | 6 ++-- src/pages/signup.tsx | 4 +-- src/pages/trainingLogs.tsx | 11 +++++++ 8 files changed, 94 insertions(+), 13 deletions(-) create mode 100644 src/component/dashboard.tsx create mode 100644 src/component/sidebar.tsx create mode 100644 src/pages/animals.tsx delete mode 100644 src/pages/dashboard.tsx create mode 100644 src/pages/trainingLogs.tsx diff --git a/src/component/dashboard.tsx b/src/component/dashboard.tsx new file mode 100644 index 0000000..c85f270 --- /dev/null +++ b/src/component/dashboard.tsx @@ -0,0 +1,11 @@ +"use client"; +import Link from "next/link"; +import { useState } from "react"; +import { useRouter } from "next/router"; +import Sidebar from "./sidebar"; + +export default function Dashboard() { + return ( + + ) +} \ No newline at end of file diff --git a/src/component/sidebar.tsx b/src/component/sidebar.tsx new file mode 100644 index 0000000..c7e6784 --- /dev/null +++ b/src/component/sidebar.tsx @@ -0,0 +1,66 @@ +import Link from "next/link"; +import { useRouter } from "next/router"; + +export default function Sidebar() { + const router = useRouter(); + + const isTrainingLogsActive = router.pathname === "/training-logs"; + const isAnimalsActive = router.pathname === "/animals"; + const isAllTrainingActive = router.pathname === "/all-training"; + const isAllAnimalsActive = router.pathname === "/all-animals"; + const isAllUsersActive = router.pathname === "/all-users"; + + return ( +
+
+ + Training Logs icon + Training Logs + + + Animals icon + Animals + +
+
+ + All Training Logs icon + All training + + + All Animals icon + All Animals + + + + All Users icon + All Users + +
+
+ ) +} \ No newline at end of file diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 6ee68fa..8792c4e 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -16,7 +16,7 @@ const heebo = Heebo({ export default function App({ Component, pageProps }: AppProps) { return (
- ; +
) } diff --git a/src/pages/animals.tsx b/src/pages/animals.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/dashboard.tsx b/src/pages/dashboard.tsx deleted file mode 100644 index 5a3a87a..0000000 --- a/src/pages/dashboard.tsx +++ /dev/null @@ -1,7 +0,0 @@ -"use client"; -import Link from "next/link"; -import { useState } from "react"; -import { useRouter } from "next/navigation"; - -export default function Home() { -} \ No newline at end of file diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 004a9d3..d2444a7 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,11 +1,11 @@ "use client"; import Link from "next/link"; import { useState } from "react"; -import { useRouter } from "next/navigation"; +import { useRouter } from "next/router"; export default function Home() { - const [email, setEmail] = useState(""); + const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [loading, setLoading] = useState(false); @@ -26,7 +26,7 @@ export default function Home() { const data = await res.json(); if (data.success) { - router.push("dashboard") + router.push("/trainingLogs") } else { setError(data.error); diff --git a/src/pages/signup.tsx b/src/pages/signup.tsx index f052057..bca6494 100644 --- a/src/pages/signup.tsx +++ b/src/pages/signup.tsx @@ -1,7 +1,7 @@ "use client"; import Link from "next/link"; import { useState } from "react"; -import { useRouter } from "next/navigation"; +import { useRouter } from "next/router"; export default function Home() { const [fullName, setFullName] = useState(""); @@ -34,7 +34,7 @@ const handleSignup = async (e: React.FormEvent) => { const data = await res.json(); if (data.success) { - router.push("/dashboard") + router.push("/trainingLogs") } else { setError(data.error); } diff --git a/src/pages/trainingLogs.tsx b/src/pages/trainingLogs.tsx new file mode 100644 index 0000000..ad86d79 --- /dev/null +++ b/src/pages/trainingLogs.tsx @@ -0,0 +1,11 @@ +"use client"; +import Link from "next/link"; +import { useState } from "react"; +import { useRouter } from "next/router"; +import Dashboard from "@/component/dashboard"; + +export default function trainingLogs() { + return ( + + ) +} \ No newline at end of file From 2276ce1bcb4d8c9dc21a75d5070620aed57fd651 Mon Sep 17 00:00:00 2001 From: Ciana Date: Tue, 7 Apr 2026 11:28:13 -0400 Subject: [PATCH 18/35] Style sidebar --- src/component/sidebar.tsx | 25 ++++++++++--------- src/pages/animals.tsx | 11 ++++++++ src/pages/index.tsx | 2 +- src/pages/signup.tsx | 2 +- .../{trainingLogs.tsx => training-logs.tsx} | 0 5 files changed, 26 insertions(+), 14 deletions(-) rename src/pages/{trainingLogs.tsx => training-logs.tsx} (100%) diff --git a/src/component/sidebar.tsx b/src/component/sidebar.tsx index c7e6784..ea21e64 100644 --- a/src/component/sidebar.tsx +++ b/src/component/sidebar.tsx @@ -11,26 +11,27 @@ export default function Sidebar() { const isAllUsersActive = router.pathname === "/all-users"; return ( -
-
- - Training Logs icon +
+
+ + Training Logs icon Training Logs - - Animals icon + + Animals icon Animals
-
- +
+

Admin Access

+ All Training Logs icon All training + ) +} \ No newline at end of file diff --git a/src/pages/index.tsx b/src/pages/index.tsx index d2444a7..f2b7b01 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -26,7 +26,7 @@ export default function Home() { const data = await res.json(); if (data.success) { - router.push("/trainingLogs") + router.push("/training-logs") } else { setError(data.error); diff --git a/src/pages/signup.tsx b/src/pages/signup.tsx index bca6494..1d3b00b 100644 --- a/src/pages/signup.tsx +++ b/src/pages/signup.tsx @@ -34,7 +34,7 @@ const handleSignup = async (e: React.FormEvent) => { const data = await res.json(); if (data.success) { - router.push("/trainingLogs") + router.push("/training-logs") } else { setError(data.error); } diff --git a/src/pages/trainingLogs.tsx b/src/pages/training-logs.tsx similarity index 100% rename from src/pages/trainingLogs.tsx rename to src/pages/training-logs.tsx From a81a08d1bf4a4b91b857a36959cc8f6f79436427 Mon Sep 17 00:00:00 2001 From: ria29973 Date: Wed, 8 Apr 2026 00:30:29 -0400 Subject: [PATCH 19/35] fixed side bar and added components --- src/AuthContext.tsx | 63 +++++++++++++++++++++++++++ src/component/sidebar.tsx | 34 +++++++++++++-- src/pages/_app.tsx | 8 +++- src/pages/api/{signup.ts => user.ts} | 4 +- src/pages/api/{login.ts => verify.ts} | 8 ++-- src/pages/index.tsx | 7 ++- src/pages/signup.tsx | 7 ++- 7 files changed, 116 insertions(+), 15 deletions(-) create mode 100644 src/AuthContext.tsx rename src/pages/api/{signup.ts => user.ts} (91%) rename src/pages/api/{login.ts => verify.ts} (88%) diff --git a/src/AuthContext.tsx b/src/AuthContext.tsx new file mode 100644 index 0000000..cbfdef7 --- /dev/null +++ b/src/AuthContext.tsx @@ -0,0 +1,63 @@ +import { createContext, useContext, useState, useEffect, ReactNode } from "react"; + +type User = { + id: string; + isAdmin: boolean; + fullName: string, +} | null; + + +type AuthContextType = { + user: User; + login: (data: { userid: string; isAdmin: boolean, fullName: string }) => void; + logout: () => void; +}; + + +const AuthContext = createContext(undefined); + + +type AuthProviderProps = { + children: ReactNode; +}; + +export function AuthProvider({ children }: AuthProviderProps) { + const [user, setUser] = useState(null); + + + useEffect(() => { + const stored = localStorage.getItem("user"); + if (stored) setUser(JSON.parse(stored)); + }, []); + + const login = (data: { userid: string; isAdmin: boolean, fullName: string }) => { + const newUser = { + id: data.userid, + isAdmin: data.isAdmin, + fullName: data.fullName, + }; + + setUser(newUser); + localStorage.setItem("user", JSON.stringify(newUser)); + }; + + const logout = () => { + setUser(null); + localStorage.removeItem("user"); + }; + + return ( + + {children} + + ); +} + + +export function useAuth() { + const context = useContext(AuthContext); + if (!context) { + throw new Error("useAuth must be used within an AuthProvider"); + } + return context; +} \ No newline at end of file diff --git a/src/component/sidebar.tsx b/src/component/sidebar.tsx index d2a516e..a0eb982 100644 --- a/src/component/sidebar.tsx +++ b/src/component/sidebar.tsx @@ -1,5 +1,6 @@ import Link from "next/link"; import { useRouter } from "next/router"; +import { useAuth } from "@/AuthContext"; export default function Sidebar() { const router = useRouter(); @@ -9,9 +10,12 @@ export default function Sidebar() { const isAllTrainingActive = router.pathname === "/all-training"; const isAllAnimalsActive = router.pathname === "/all-animals"; const isAllUsersActive = router.pathname === "/all-users"; + const logout = router.pathname === "/index"; + const { user } = useAuth(); + return ( -
+
Training Logs icon @@ -22,7 +26,8 @@ export default function Sidebar() { Animals
-
+ <> + { user?.isAdmin &&

Admin Access

All Training Logs icon @@ -62,6 +67,29 @@ export default function Sidebar() { All Users
+ } + + {user && ( +
+
+ + {user.fullName.charAt(0).toUpperCase()} + +
+
+

{user.fullName}

+

{user.isAdmin ? "Admin" : "User"}

+ +
+ + Logout icon { + localStorage.removeItem("user"); + }}/> + +
+ )}
- ) + ); } \ No newline at end of file diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 8792c4e..bf36ac4 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,6 +1,7 @@ import "@/styles/globals.css"; import type { AppProps } from "next/app"; import { Oswald , Heebo} from "next/font/google"; +import { AuthProvider } from "@/AuthContext"; const oswald = Oswald({ subsets: ["latin"], @@ -15,8 +16,11 @@ const heebo = Heebo({ }); export default function App({ Component, pageProps }: AppProps) { - return (
+ return ( + +
- ) +
+ ); } diff --git a/src/pages/api/signup.ts b/src/pages/api/user.ts similarity index 91% rename from src/pages/api/signup.ts rename to src/pages/api/user.ts index 3449fcd..f6e4337 100644 --- a/src/pages/api/signup.ts +++ b/src/pages/api/user.ts @@ -8,7 +8,7 @@ export default async function handler( res: NextApiResponse ) { if (req.method !== "POST") { - return res.status(405).json({ success: false, error: "Method not allowed" }); + return res.status(500).json({ success: false, error: "Method not allowed" }); } const { fullName, email, password, confirmPassword, isAdmin } = req.body; @@ -47,7 +47,7 @@ export default async function handler( }); - return res.status(200).json({success: true, userid: newUser._id, isAdmin: newUser.isAdmin, + return res.status(200).json({success: true, userid: newUser._id, isAdmin: newUser.isAdmin, fullName: newUser.fullName, }); } catch (err) { console.error(err); diff --git a/src/pages/api/login.ts b/src/pages/api/verify.ts similarity index 88% rename from src/pages/api/login.ts rename to src/pages/api/verify.ts index 00b449e..31a3184 100644 --- a/src/pages/api/login.ts +++ b/src/pages/api/verify.ts @@ -9,12 +9,12 @@ export default async function handler ( res: NextApiResponse ) { if (req.method !== "POST") { - return res.status(405).json({ success: false, error: "Method not allowed" }); + return res.status(500).json({ success: false, error: "Method not allowed" }); } const {email, password} = await req.body; if (!email || !password) { return res - .status(400) + .status(500) .json({ success: false, error: "Please fill in all fields" }); } @@ -24,7 +24,7 @@ export default async function handler ( const user = await User.findOne({ email }); if (!user) { return res - .status(400) + .status(500) .json({ success: false, error: "User does not exist" }); } const isMatch = await argon2.verify(user.password, password); @@ -33,7 +33,7 @@ export default async function handler ( .status(400) .json({success: false, error: "password does not match"}); } - return res.status(200).json({success: true, userid: user._id, isAdmin: user.isAdmin, + return res.status(200).json({success: true, userid: user._id, isAdmin: user.isAdmin, fullName: user.fullName, }); } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index f2b7b01..fc85cbe 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -2,7 +2,8 @@ import Link from "next/link"; import { useState } from "react"; import { useRouter } from "next/router"; - +import { useAuth } from "@/AuthContext"; + export default function Home() { const [email, setEmail] = useState(""); @@ -10,6 +11,7 @@ export default function Home() { const [error, setError] = useState(""); const [loading, setLoading] = useState(false); const router = useRouter(); + const { login } = useAuth(); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); @@ -17,7 +19,7 @@ export default function Home() { setError(""); try { - const res = await fetch("/api/login", { + const res = await fetch("/api/verify", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email, password }), @@ -26,6 +28,7 @@ export default function Home() { const data = await res.json(); if (data.success) { + login(data); router.push("/training-logs") } else { diff --git a/src/pages/signup.tsx b/src/pages/signup.tsx index 1d3b00b..a57fedb 100644 --- a/src/pages/signup.tsx +++ b/src/pages/signup.tsx @@ -2,6 +2,7 @@ import Link from "next/link"; import { useState } from "react"; import { useRouter } from "next/router"; +import { useAuth } from "@/AuthContext"; export default function Home() { const [fullName, setFullName] = useState(""); @@ -10,7 +11,8 @@ const [password, setPassword] = useState(""); const [confirmPassword, setConfirmPassword] = useState(""); const [isAdmin, setIsAdmin] = useState(false); const router = useRouter(); - +const { login } = useAuth(); + const [error, setError] = useState(""); const [loading, setLoading] = useState(false); const handleSignup = async (e: React.FormEvent) => { @@ -19,7 +21,7 @@ const handleSignup = async (e: React.FormEvent) => { setError(""); try { - const res = await fetch("/api/signup", { + const res = await fetch("/api/user", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ @@ -34,6 +36,7 @@ const handleSignup = async (e: React.FormEvent) => { const data = await res.json(); if (data.success) { + login(data); router.push("/training-logs") } else { setError(data.error); From 97b26d977def1471255024fe52ad2099c6158ebc Mon Sep 17 00:00:00 2001 From: ria29973 Date: Wed, 8 Apr 2026 00:40:26 -0400 Subject: [PATCH 20/35] small change in logout --- src/component/sidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/component/sidebar.tsx b/src/component/sidebar.tsx index a0eb982..cf2a333 100644 --- a/src/component/sidebar.tsx +++ b/src/component/sidebar.tsx @@ -10,8 +10,8 @@ export default function Sidebar() { const isAllTrainingActive = router.pathname === "/all-training"; const isAllAnimalsActive = router.pathname === "/all-animals"; const isAllUsersActive = router.pathname === "/all-users"; - const logout = router.pathname === "/index"; const { user } = useAuth(); + const { logout } = useAuth(); return ( @@ -85,7 +85,7 @@ export default function Sidebar() { href = "/" > Logout icon { - localStorage.removeItem("user"); + logout; }}/>
From de88d23de3968067dc2821e524f7fad25ec59e2d Mon Sep 17 00:00:00 2001 From: Ciana Date: Wed, 8 Apr 2026 12:14:31 -0400 Subject: [PATCH 21/35] Fixed sidebar format issue --- src/component/progressbar.tsx | 10 ++++++++++ src/component/sidebar.tsx | 12 ++++++------ src/pages/animal_dashboard.tsx | 10 +++------- src/pages/training-logs.tsx | 14 ++++++++++++-- 4 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 src/component/progressbar.tsx diff --git a/src/component/progressbar.tsx b/src/component/progressbar.tsx new file mode 100644 index 0000000..67f0b70 --- /dev/null +++ b/src/component/progressbar.tsx @@ -0,0 +1,10 @@ +export default function progressBar() { + return ( +
+
+ +

Progress

+
+
+ ) +} \ No newline at end of file diff --git a/src/component/sidebar.tsx b/src/component/sidebar.tsx index cf2a333..ff427c0 100644 --- a/src/component/sidebar.tsx +++ b/src/component/sidebar.tsx @@ -15,7 +15,7 @@ export default function Sidebar() { return ( -
+
Training Logs icon @@ -82,11 +82,11 @@ export default function Sidebar() {
- Logout icon { - logout; - }}/> + href = "/" + > + Logout icon { + logout; + }}/>
)} diff --git a/src/pages/animal_dashboard.tsx b/src/pages/animal_dashboard.tsx index 687c79b..d0d75f3 100644 --- a/src/pages/animal_dashboard.tsx +++ b/src/pages/animal_dashboard.tsx @@ -4,6 +4,7 @@ import { AnimalCard } from "./animal_card"; import { Animal } from "../types/animal"; import { useEffect } from "react"; import Sidebar from "@/component/sidebar"; +import ProgressBar from "@/component/progressbar"; async function getAnimals(): Promise { try { @@ -29,13 +30,8 @@ export default function Home() { }, []); return ( -
-
-
- -

Progress

-
-
+
+
{/* Sidebar */} diff --git a/src/pages/training-logs.tsx b/src/pages/training-logs.tsx index ad86d79..1d2d50b 100644 --- a/src/pages/training-logs.tsx +++ b/src/pages/training-logs.tsx @@ -2,10 +2,20 @@ import Link from "next/link"; import { useState } from "react"; import { useRouter } from "next/router"; -import Dashboard from "@/component/dashboard"; +import Sidebar from "@/component/sidebar"; +import ProgressBar from "@/component/progressbar"; export default function trainingLogs() { return ( - +
+ + +
+ {/* Sidebar */} + +
+
) } \ No newline at end of file From f4c69a528348c48d32b7c21f9bbdeeded8086ab6 Mon Sep 17 00:00:00 2001 From: Ciana Date: Thu, 9 Apr 2026 18:15:38 -0400 Subject: [PATCH 22/35] Created training logs card --- src/component/sidebar.tsx | 2 +- src/pages/training-logs.tsx | 44 ++++++++++++++++++++++++++----- src/pages/training-logs_card.tsx | 45 ++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 7 deletions(-) create mode 100644 src/pages/training-logs_card.tsx diff --git a/src/component/sidebar.tsx b/src/component/sidebar.tsx index ff427c0..de1cdf6 100644 --- a/src/component/sidebar.tsx +++ b/src/component/sidebar.tsx @@ -15,7 +15,7 @@ export default function Sidebar() { return ( -
+
Training Logs icon diff --git a/src/pages/training-logs.tsx b/src/pages/training-logs.tsx index 1d2d50b..ca6a89d 100644 --- a/src/pages/training-logs.tsx +++ b/src/pages/training-logs.tsx @@ -4,17 +4,49 @@ import { useState } from "react"; import { useRouter } from "next/router"; import Sidebar from "@/component/sidebar"; import ProgressBar from "@/component/progressbar"; +import TrainingLogsCard from "./training-logs_card"; -export default function trainingLogs() { + +export default function TrainingLogs() { return ( -
+
- {/* Sidebar */} - + + +
+
+

+ Training Logs +

+ + +
+ + {/* Training Logs Card */} +
+ +
+
) diff --git a/src/pages/training-logs_card.tsx b/src/pages/training-logs_card.tsx new file mode 100644 index 0000000..ac9ea8a --- /dev/null +++ b/src/pages/training-logs_card.tsx @@ -0,0 +1,45 @@ +type TrainingLogsCardProps = { + title: string; + date: string; + month: string; + year: string; + userName: string; + animalName: string; + animalBreed: string; + hours: number; + description: string; +}; + +export default function trainingLogsCard( {title, date, month, year, userName, animalName, animalBreed, hours, + description}: TrainingLogsCardProps ) { + + return ( +
+
+
{date}
+
+ {month} - {year} +
+
+
+ + +
+ {userName} - {animalBreed} - {animalName} +
+ +
+ {description} +
+ +
+ +
+ +
+
+ ) +} \ No newline at end of file From b3e8181d5f004cdd9aee79fb962f6a2907cb127f Mon Sep 17 00:00:00 2001 From: Ciana Date: Mon, 13 Apr 2026 20:47:07 -0400 Subject: [PATCH 23/35] Continue training logs --- src/component/sidebar.tsx | 5 +- src/pages/api/training-log.ts | 55 +++++++++++++ src/pages/create_training-log.tsx | 132 ++++++++++++++++++++++++++++++ src/pages/training-logs.tsx | 78 ++++++++++++++---- src/pages/training-logs_card.tsx | 6 +- 5 files changed, 254 insertions(+), 22 deletions(-) create mode 100644 src/pages/api/training-log.ts create mode 100644 src/pages/create_training-log.tsx diff --git a/src/component/sidebar.tsx b/src/component/sidebar.tsx index de1cdf6..6c732e5 100644 --- a/src/component/sidebar.tsx +++ b/src/component/sidebar.tsx @@ -10,6 +10,7 @@ export default function Sidebar() { const isAllTrainingActive = router.pathname === "/all-training"; const isAllAnimalsActive = router.pathname === "/all-animals"; const isAllUsersActive = router.pathname === "/all-users"; + const isCreateTrainingLogsActive = router.pathname === "/create_training-log"; const { user } = useAuth(); const { logout } = useAuth(); @@ -17,8 +18,8 @@ export default function Sidebar() { return (
- - Training Logs icon + + Training Logs icon Training Logs diff --git a/src/pages/api/training-log.ts b/src/pages/api/training-log.ts new file mode 100644 index 0000000..06c691c --- /dev/null +++ b/src/pages/api/training-log.ts @@ -0,0 +1,55 @@ +import type { NextApiRequest, NextApiResponse } from "next"; + +export default function handler(req: NextApiRequest, res: NextApiResponse) { + if (req.method === "GET") { + const trainingLogs = [ + { + id: "1", + title: "Complete sit lessons", + date: "2023-10-20", + userName: "Long Lam", + animalName: "Lucy", + animalBreed: "Golden Retriever", + hours: 20, + description: "Lucy finishes the sit lessons very well today. Should give her a treat" + }, + { + id: "2", + title: "Practice recall", + date: "2023-10-21", + userName: "Long Lam", + animalName: "Lucy", + animalBreed: "Golden Retriever", + hours: 12, + description: "Worked on recall and she improved a lot today" + } + ]; + + return res.status(200).json({data : trainingLogs}); + } + + if (req.method === "POST") { + const {title, date, animalId, hours, description} = req.body; + + if (!title || !date || !animalId || !hours || !description) { + return res.status(400).json({messgae : "Missing required field"}) + } + + const newTrainingLog = { + id: Date.now().toString(), + title, + date, + animalId, + hours, + description, + }; + + console.log("New training log: ", newTrainingLog); + return res.status(200).json({ + message: "Training log created successfully", + data: newTrainingLog + }); + } + + return res.status(405).json({message : "Method not allowed"}); +} \ No newline at end of file diff --git a/src/pages/create_training-log.tsx b/src/pages/create_training-log.tsx new file mode 100644 index 0000000..e9879b6 --- /dev/null +++ b/src/pages/create_training-log.tsx @@ -0,0 +1,132 @@ +import Sidebar from "@/component/sidebar"; +import ProgressBar from "@/component/progressbar"; +import { useState } from "react"; +import { useRouter } from "next/router"; + +export default function CreateTrainingLog() { + const [title, setTitle] = useState(""); + const [animalId, setAnimalId] = useState(""); + const [hours, setHours] = useState(""); + const [description, setDescription] = useState(""); + const [error, setError] = useState(""); + const [loading, setLoading] = useState(false); + + const router = useRouter(); + + const handleCreateTrainingLog = async (e: React.FormEvent) => { + e.preventDefault(); + setLoading(true); + setError(""); + + try { + const newTrainingLog = { + title, + animalId, + hours: Number(hours), + description, + date: new Date().toISOString() + }; + + const res = await fetch ("/api/training-log", { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(newTrainingLog) + }); + + if (!res.ok) { + const data = await res.json(); + throw new Error(data.message || "Failed to create training log"); + } + + router.push("/training-logs"); + + } catch (error) { + setError("Failed to create training log"); + } finally { + setLoading(false); + } + } + + return ( +
+ + +
+ + +
+
+

+ Training Logs +

+
+ +
+
+ + setTitle(e.target.value)} + placeholder="Title" + className="h-[64px] rounded-[10px] border border-[#BDBDBD] bg-white px-6 text-[18px] text-[#555555] outline-none" + /> +
+ +
+ + +
+ +
+ + setHours(e.target.value)} + placeholder="20" + className="h-[64px] rounded-[10px] border border-[#BDBDBD] bg-white px-6 text-[18px] text-[#555555] outline-none" + /> +
+ +
+ +