From c4086c8072991cc35ae1427dbf2e1d4b428dfc62 Mon Sep 17 00:00:00 2001 From: Harkamal Randhawa Date: Mon, 20 Apr 2026 22:00:29 -0600 Subject: [PATCH] add web file headers --- web/app/about/page.js | 7 +++++++ web/app/adopt/[id]/page.js | 7 +++++++ web/app/adopt/page.js | 7 +++++++ web/app/ai-chat/page.js | 7 +++++++ web/app/api/[...path]/route.js | 7 +++++++ web/app/appointments/page.js | 7 +++++++ web/app/cart/page.js | 7 +++++++ web/app/chat/page.js | 7 +++++++ web/app/contact/page.js | 7 +++++++ web/app/forgot-password/page.js | 7 +++++++ web/app/layout.js | 7 +++++++ web/app/login/page.js | 7 +++++++ web/app/page.js | 7 +++++++ web/app/products/[id]/page.js | 7 +++++++ web/app/products/page.js | 7 +++++++ web/app/profile/page.js | 7 +++++++ web/app/register/page.js | 7 +++++++ web/app/reset-password/page.js | 7 +++++++ web/components/ClientProviders.js | 7 +++++++ web/components/FloatingChat.js | 7 +++++++ web/components/Footer.js | 7 +++++++ web/components/Navigation.js | 7 +++++++ web/components/PetCard.js | 7 +++++++ web/components/PetProfile.js | 7 +++++++ web/components/ProductCard.js | 7 +++++++ web/components/ProductProfile.js | 7 +++++++ web/components/petUtils.js | 7 +++++++ web/context/AuthContext.js | 7 +++++++ web/context/CartContext.js | 7 +++++++ web/context/ChatWidgetContext.js | 7 +++++++ web/lib/cartApi.js | 7 +++++++ web/lib/chatSocket.js | 7 +++++++ web/lib/fetchAllPages.js | 7 +++++++ 33 files changed, 231 insertions(+) diff --git a/web/app/about/page.js b/web/app/about/page.js index 7695e81d..f5af8c9d 100644 --- a/web/app/about/page.js +++ b/web/app/about/page.js @@ -1,3 +1,10 @@ +/* + * Page that shows information about the pet store and what it offers. + * + * Author: Shiv + * Date: April 2026 + */ + //About page //Three info cards covering what the store does, its focus, and how to visit export default function AboutPage() { diff --git a/web/app/adopt/[id]/page.js b/web/app/adopt/[id]/page.js index ad31e4c5..c8a8b81d 100644 --- a/web/app/adopt/[id]/page.js +++ b/web/app/adopt/[id]/page.js @@ -1,3 +1,10 @@ +/* + * Shows the full details for a single pet available for adoption. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import Link from "next/link"; diff --git a/web/app/adopt/page.js b/web/app/adopt/page.js index 472c9d90..3b79d5e8 100644 --- a/web/app/adopt/page.js +++ b/web/app/adopt/page.js @@ -1,3 +1,10 @@ +/* + * Browsing page for all adoptable pets with filters and search. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { useState, useEffect, useMemo } from "react"; diff --git a/web/app/ai-chat/page.js b/web/app/ai-chat/page.js index 3e96fdc3..dbfac752 100644 --- a/web/app/ai-chat/page.js +++ b/web/app/ai-chat/page.js @@ -1,3 +1,10 @@ +/* + * Full-page AI chat where users can ask questions and get help. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import dynamic from "next/dynamic"; diff --git a/web/app/api/[...path]/route.js b/web/app/api/[...path]/route.js index f943a8cd..df897cb6 100644 --- a/web/app/api/[...path]/route.js +++ b/web/app/api/[...path]/route.js @@ -1,3 +1,10 @@ +/* + * Proxy that forwards all API requests to the backend server. + * + * Author: Shiv + * Date: April 2026 + */ + //Backend URL, falls back to localhost for local development const BACKEND = process.env.BACKEND_URL || 'http://localhost:8080' diff --git a/web/app/appointments/page.js b/web/app/appointments/page.js index 1573373d..2996cd2e 100644 --- a/web/app/appointments/page.js +++ b/web/app/appointments/page.js @@ -1,3 +1,10 @@ +/* + * Page for booking and managing pet service appointments. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import dynamic from "next/dynamic"; diff --git a/web/app/cart/page.js b/web/app/cart/page.js index b3e102b3..58de7152 100644 --- a/web/app/cart/page.js +++ b/web/app/cart/page.js @@ -1,3 +1,10 @@ +/* + * Shopping cart page with Stripe checkout for purchasing products. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { useState, useEffect } from "react"; diff --git a/web/app/chat/page.js b/web/app/chat/page.js index 3fcb2c80..e2d2104b 100644 --- a/web/app/chat/page.js +++ b/web/app/chat/page.js @@ -1,3 +1,10 @@ +/* + * Live chat page for real-time messaging with store staff. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import dynamic from "next/dynamic"; diff --git a/web/app/contact/page.js b/web/app/contact/page.js index da7e6bd2..df90af13 100644 --- a/web/app/contact/page.js +++ b/web/app/contact/page.js @@ -1,3 +1,10 @@ +/* + * Contact page with a message form and store location cards. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { useState, useEffect } from "react"; diff --git a/web/app/forgot-password/page.js b/web/app/forgot-password/page.js index 4664a2cb..fb569709 100644 --- a/web/app/forgot-password/page.js +++ b/web/app/forgot-password/page.js @@ -1,3 +1,10 @@ +/* + * Forgot password page that sends a reset link to the user's email. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import dynamic from "next/dynamic"; diff --git a/web/app/layout.js b/web/app/layout.js index 4e867680..26fe87f4 100644 --- a/web/app/layout.js +++ b/web/app/layout.js @@ -1,3 +1,10 @@ +/* + * Root layout that wraps every page with the nav bar, footer, and providers. + * + * Author: Shiv + * Date: April 2026 + */ + import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; import DisplayNav from "@/components/Navigation"; diff --git a/web/app/login/page.js b/web/app/login/page.js index 4bdeba2a..79fa6a22 100644 --- a/web/app/login/page.js +++ b/web/app/login/page.js @@ -1,3 +1,10 @@ +/* + * Login page with username and password form. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import dynamic from "next/dynamic"; diff --git a/web/app/page.js b/web/app/page.js index 00d80362..7980bc43 100644 --- a/web/app/page.js +++ b/web/app/page.js @@ -1,3 +1,10 @@ +/* + * Home page with a slideshow, navigation cards, and an about section. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import Image from "next/image"; diff --git a/web/app/products/[id]/page.js b/web/app/products/[id]/page.js index 5808c51e..21adc7ad 100644 --- a/web/app/products/[id]/page.js +++ b/web/app/products/[id]/page.js @@ -1,3 +1,10 @@ +/* + * Shows the full details for a single product from the store. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import Link from "next/link"; diff --git a/web/app/products/page.js b/web/app/products/page.js index d1222a18..0430ef61 100644 --- a/web/app/products/page.js +++ b/web/app/products/page.js @@ -1,3 +1,10 @@ +/* + * Browsing page for all store products with search and pagination. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { useState, useEffect } from "react"; diff --git a/web/app/profile/page.js b/web/app/profile/page.js index 591d5c6e..d38d6c83 100644 --- a/web/app/profile/page.js +++ b/web/app/profile/page.js @@ -1,3 +1,10 @@ +/* + * Profile page where users can edit their info, pets, and see orders. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { useEffect, useState, useCallback, useRef } from "react"; diff --git a/web/app/register/page.js b/web/app/register/page.js index 1948ea57..6ab457bc 100644 --- a/web/app/register/page.js +++ b/web/app/register/page.js @@ -1,3 +1,10 @@ +/* + * Registration page for creating a new user account. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import dynamic from "next/dynamic"; diff --git a/web/app/reset-password/page.js b/web/app/reset-password/page.js index 6cfaeb7a..5300c15b 100644 --- a/web/app/reset-password/page.js +++ b/web/app/reset-password/page.js @@ -1,3 +1,10 @@ +/* + * Reset password page that lets the user set a new password with a token. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import dynamic from "next/dynamic"; diff --git a/web/components/ClientProviders.js b/web/components/ClientProviders.js index 73c7bb66..e48b615f 100644 --- a/web/components/ClientProviders.js +++ b/web/components/ClientProviders.js @@ -1,3 +1,10 @@ +/* + * Wraps the app in all the context providers and the floating chat. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { AuthProvider } from "@/context/AuthContext"; diff --git a/web/components/FloatingChat.js b/web/components/FloatingChat.js index 505c46ed..c3983a6d 100644 --- a/web/components/FloatingChat.js +++ b/web/components/FloatingChat.js @@ -1,3 +1,10 @@ +/* + * Floating chat button and popup for AI help and live support. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { useState, useRef, useEffect } from "react"; diff --git a/web/components/Footer.js b/web/components/Footer.js index 20b1f640..608d6d36 100644 --- a/web/components/Footer.js +++ b/web/components/Footer.js @@ -1,3 +1,10 @@ +/* + * Site footer with quick links, company info, and contact details. + * + * Author: Shiv + * Date: April 2026 + */ + import Link from "next/link"; import Image from "next/image"; diff --git a/web/components/Navigation.js b/web/components/Navigation.js index 42dab3ad..c1da8394 100644 --- a/web/components/Navigation.js +++ b/web/components/Navigation.js @@ -1,3 +1,10 @@ +/* + * Top navigation bar with links, cart icon, and mobile drawer menu. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import Image from "next/image"; diff --git a/web/components/PetCard.js b/web/components/PetCard.js index 69ab43fb..c495f274 100644 --- a/web/components/PetCard.js +++ b/web/components/PetCard.js @@ -1,3 +1,10 @@ +/* + * Small card component for showing a pet in the adoption grid. + * + * Author: Shiv + * Date: April 2026 + */ + import Link from "next/link"; import { getStatusClass } from "@/components/petUtils"; diff --git a/web/components/PetProfile.js b/web/components/PetProfile.js index c3398367..258e52e3 100644 --- a/web/components/PetProfile.js +++ b/web/components/PetProfile.js @@ -1,3 +1,10 @@ +/* + * Full detail view for a single pet on the adoption detail page. + * + * Author: Shiv + * Date: April 2026 + */ + import Link from "next/link"; import { getStatusClass } from "@/components/petUtils"; diff --git a/web/components/ProductCard.js b/web/components/ProductCard.js index f10d7910..a7be2dcd 100644 --- a/web/components/ProductCard.js +++ b/web/components/ProductCard.js @@ -1,3 +1,10 @@ +/* + * Card component for showing a product in the store grid. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import Link from "next/link"; diff --git a/web/components/ProductProfile.js b/web/components/ProductProfile.js index 95d7cfe5..85e44fba 100644 --- a/web/components/ProductProfile.js +++ b/web/components/ProductProfile.js @@ -1,3 +1,10 @@ +/* + * Full detail view for a single product on the product detail page. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { useState } from "react"; diff --git a/web/components/petUtils.js b/web/components/petUtils.js index abcfd6f2..d6c12ceb 100644 --- a/web/components/petUtils.js +++ b/web/components/petUtils.js @@ -1,3 +1,10 @@ +/* + * Shared helper functions for pet species emojis and status styling. + * + * Author: Shiv + * Date: April 2026 + */ + //Temporary, until image support is added export const SPECIES_EMOJI = { diff --git a/web/context/AuthContext.js b/web/context/AuthContext.js index b912538a..bddc4e82 100644 --- a/web/context/AuthContext.js +++ b/web/context/AuthContext.js @@ -1,3 +1,10 @@ +/* + * Provides login state, user info, and auth actions to the whole app. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { createContext, useContext, useState, useEffect, useCallback } from "react"; diff --git a/web/context/CartContext.js b/web/context/CartContext.js index 1315c213..79313072 100644 --- a/web/context/CartContext.js +++ b/web/context/CartContext.js @@ -1,3 +1,10 @@ +/* + * Provides shopping cart state and actions like add, remove, and checkout. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { createContext, useContext, useState, useEffect, useCallback } from "react"; diff --git a/web/context/ChatWidgetContext.js b/web/context/ChatWidgetContext.js index 3fdf1868..272456f3 100644 --- a/web/context/ChatWidgetContext.js +++ b/web/context/ChatWidgetContext.js @@ -1,3 +1,10 @@ +/* + * Provides state and actions for both AI chat and live support chat. + * + * Author: Shiv + * Date: April 2026 + */ + "use client"; import { createContext, useContext, useState, useRef, useCallback, useEffect } from "react"; diff --git a/web/lib/cartApi.js b/web/lib/cartApi.js index fc240117..fdacb71c 100644 --- a/web/lib/cartApi.js +++ b/web/lib/cartApi.js @@ -1,3 +1,10 @@ +/* + * Functions for calling the cart API endpoints on the backend. + * + * Author: Shiv + * Date: April 2026 + */ + //Base path for all cart API calls const BASE = "/api/v1/cart"; diff --git a/web/lib/chatSocket.js b/web/lib/chatSocket.js index d7ee0192..9502e5ab 100644 --- a/web/lib/chatSocket.js +++ b/web/lib/chatSocket.js @@ -1,3 +1,10 @@ +/* + * Creates a STOMP WebSocket client for the live chat feature. + * + * Author: Shiv + * Date: April 2026 + */ + import { Client } from "@stomp/stompjs"; //Backend URL for the WebSocket connection, empty string means same origin diff --git a/web/lib/fetchAllPages.js b/web/lib/fetchAllPages.js index 6361d78f..e73f9f5c 100644 --- a/web/lib/fetchAllPages.js +++ b/web/lib/fetchAllPages.js @@ -1,3 +1,10 @@ +/* + * Helper that fetches every page from a paginated API into one array. + * + * Author: Shiv + * Date: April 2026 + */ + //Fetches every page from a paginated API and returns all items in one array export async function fetchAllPages(urlBuilder) { const items = [];