Showing AI reviews for avriti
Project AI Score ?
63%
Quality Avg ?
68%
Security Avg ?
45%
Reviews ?
56

Review Result ?

jattin01/avriti · cdc09151
The commit adds dashboard pages with static user data and basic navigation tabs for profile and orders. The implementation is visually structured and uses React components properly but lacks integration with a backend or real authentication, uses localStorage insecurely, and hardcoded user data limits business value. The UI lacks handlers for editing or deleting, raising bug risk. The commit message is generic and vague.
Quality ?
70%
Security ?
30%
Business Value ?
60%
Maintainability ?
65%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Issue
Where commit message
Issue / Evidence issue
Suggested Fix improve commit message to clearly describe changes and their purpose
Security Issue
Where app/login/page.tsx:20
Issue / Evidence security issue
Suggested Fix avoid storing user data like email in localStorage without encryption or tokenization
Quality Issue
Where app/login/page.tsx:25
Issue / Evidence quality issue
Suggested Fix avoid full window reload, implement state management or context to update header after login
Business Value Issue
Where app/profile/page.tsx:11
Issue / Evidence business value issue
Suggested Fix replace hardcoded user data with dynamic data from backend or authentication context
Functionality Issue
Where app/profile/page.tsx:56
Issue / Evidence functionality issue
Suggested Fix add onClick handlers and functionality to edit and delete buttons
Functionality Issue
Where app/profile/page.tsx:156
Issue / Evidence functionality issue
Suggested Fix implement logic to add new addresses rather than just UI button
Quality Issue
Where app/profile/page.tsx:72
Issue / Evidence quality issue
Suggested Fix consider persist or restore 'active' tab state on page reload for better UX
Code Change Preview · app/login/page.tsx ?
Removed / Before Commit
- 
- import { useState } from "react";
- import Link from "next/link";
- // ... rest of your code
- 
- export default function LoginPage() {
- const [email, setEmail] = useState("");
- 
- const handleSubmit = () => {
- setLoading(true);
-     setTimeout(() => setLoading(false), 2000);
- };
- 
- return (
Added / After Commit
+ 
+ import { useState } from "react";
+ import Link from "next/link";
+ 
+ export default function LoginPage() {
+ const [email, setEmail] = useState("");
+ 
+ const handleSubmit = () => {
+ setLoading(true);
+     // Simulate authentication and persist a simple user object
+     setTimeout(() => {
+       setLoading(false);
+       const username = email ? email.split("@")[0] : "user";
+       try {
+         localStorage.setItem("avriti_user", JSON.stringify({ name: username, email }));
+       } catch (e) {
+         // ignore storage errors
+       }
Removed / Before Commit

                                                
Added / After Commit
+ "use client";
+ 
+ import { useState } from "react";
+ import Link from "next/link";
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+ import {
+   faUser, faBoxOpen, faMapMarkerAlt, faSignOutAlt,
+   faPen, faTrash, faPlus, faShieldAlt,
+ } from "@fortawesome/free-solid-svg-icons";
+ 
+ const user = {
+   name: "Varinder Kaur",
+   email: "vkaur20@gmail.com",
+   phone: "+919501711002",
+   daysSinceJoining: 26,
+   totalOrders: 1,
+   initials: "VK",
+ };
Removed / Before Commit

                                                
Added / After Commit
+ export default function TrackOrderPage() {
+   return (
+     <section className="flex min-h-[360px] items-start justify-center bg-white px-4 py-10 sm:py-16">
+       <div className="w-full max-w-[640px] rounded-[8px] border border-[#e7e0da] bg-[#fffdfa] px-5 py-7 shadow-[0_2px_16px_rgba(0,0,0,0.16)] sm:px-7">
+         <h1 className="mb-7 text-[24px] font-semibold leading-none text-[#151521]">
+           Track Your Order
+         </h1>
+ 
+         <form className="flex flex-col gap-4 sm:flex-row sm:items-center">
+           <label className="sr-only" htmlFor="order-id">
+             Order ID
+           </label>
+           <div className="flex sm:flex-row flex-col gap-2 w-full">
+           <input
+             id="order-id"
+             name="orderId"
+             type="text"
+             placeholder="Order ID"
Removed / Before Commit
- import { Card } from "@/components/ui/card";
- import { Button } from "@/components/ui/button";
- import Image from "next/image";
- 
- interface Order {
- id: string;
- orderNumber: string;
- <div className="text-right">
- <p className="text-[20px] font-bold text-gray-900">₹{order.price}</p>
- </div>
-        
-         <button className="inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-semibold transition focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-primary-600)] disabled:pointer-events-none disabled:opacity-50 border-[var(--color-primary-300)] bg-white text-[var(--color-primary-700)] hover:bg-[var(--color-primary-100)]/35 min-h-11 pl-[10px] pr-[0px] rounded-[10px] border-[1px]">TRACK ORDER <span className="buttonArrow ml-[15px]"></span></button>
- </div>
- </Card>
- );
- }
Added / After Commit
+ import { Card } from "@/components/ui/card";
+ import { Button } from "@/components/ui/button";
+ import Image from "next/image";
+ import Link from "next/link";
+ interface Order {
+ id: string;
+ orderNumber: string;
+ <div className="text-right">
+ <p className="text-[20px] font-bold text-gray-900">₹{order.price}</p>
+ </div>
+        <Link href="/track-order">
+         <button className="inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-semibold transition focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-primary-600)] disabled:pointer-events-none disabled:opacity-50 border-[var(--color-primary-300)] bg-white text-[var(--color-primary-700)] hover:bg-[var(--color-primary-100)]/35 min-h-11 pl-[10px] pr-[0px] rounded-[10px] border-[1px]">TRACK ORDER <span className="buttonArrow ml-[15px]"></span></button> </Link>
+ </div>
+      
+ </Card>
+ );
+ }
Removed / Before Commit
- import Image from "next/image";
- import Link from "next/link";
- import { cn } from "@/lib/utils";
- 
- const pdfNav = [
- ["SHOP", "/shop"],
Added / After Commit
+ import Image from "next/image";
+ import Link from "next/link";
+ import { cn } from "@/lib/utils";
+ import { config } from "@fortawesome/fontawesome-svg-core";
+ import "@fortawesome/fontawesome-svg-core/styles.css";
+ config.autoAddCss = false;
+ 
+ const pdfNav = [
+ ["SHOP", "/shop"],
Removed / Before Commit
- import Image from "next/image";
- import Link from "next/link";
- import { Menu, X } from "lucide-react";
- import { useState } from "react";
- import { CartButton } from "@/components/ui/cart-button";
- import { cn } from "@/lib/utils";
- 
- const leftNav = [
- { href: "/shop", label: "Shop" },
- 
- export function SiteHeader() {
- const [open, setOpen] = useState(false);
- 
- return (
- <header className="sticky top-0 z-40">
- </div>
- </nav>
- 
Added / After Commit
+ import Image from "next/image";
+ import Link from "next/link";
+ import { Menu, X } from "lucide-react";
+ import { useState, useEffect, useRef } from "react";
+ import { CartButton } from "@/components/ui/cart-button";
+ import { cn } from "@/lib/utils";
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+ import { faUser } from "@fortawesome/free-solid-svg-icons";
+ 
+ const leftNav = [
+ { href: "/shop", label: "Shop" },
+ 
+ export function SiteHeader() {
+ const [open, setOpen] = useState(false);
+   const [user, setUser] = useState<{ name?: string; email?: string } | null>(null);
+   const [acctOpen, setAcctOpen] = useState(false);
+   const accountMenuRef = useRef<HTMLDivElement>(null);
+ 
Removed / Before Commit
- "name": "frontend",
- "version": "0.1.0",
- "dependencies": {
- "class-variance-authority": "^0.7.1",
- "clsx": "^2.1.1",
- "framer-motion": "^12.39.0",
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- }
- },
- "node_modules/@humanfs/core": {
- "version": "0.19.2",
- "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz",
Added / After Commit
+ "name": "frontend",
+ "version": "0.1.0",
+ "dependencies": {
+         "@fortawesome/fontawesome-svg-core": "^7.2.0",
+         "@fortawesome/free-regular-svg-icons": "^7.2.0",
+         "@fortawesome/free-solid-svg-icons": "^7.2.0",
+         "@fortawesome/react-fontawesome": "^3.3.1",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
+ "framer-motion": "^12.39.0",
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+     "node_modules/@fortawesome/fontawesome-common-types": {
+       "version": "7.2.0",
+       "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-7.2.0.tgz",
+       "integrity": "sha512-IpR0bER9FY25p+e7BmFH25MZKEwFHTfRAfhOyJubgiDnoJNsSvJ7nigLraHtp4VOG/cy8D7uiV0dLkHOne5Fhw==",
+       "license": "MIT",
Removed / Before Commit
- "lint": "eslint"
- },
- "dependencies": {
- "class-variance-authority": "^0.7.1",
- "clsx": "^2.1.1",
- "framer-motion": "^12.39.0",
Added / After Commit
+ "lint": "eslint"
+ },
+ "dependencies": {
+     "@fortawesome/fontawesome-svg-core": "^7.2.0",
+     "@fortawesome/free-regular-svg-icons": "^7.2.0",
+     "@fortawesome/free-solid-svg-icons": "^7.2.0",
+     "@fortawesome/react-fontawesome": "^3.3.1",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
+ "framer-motion": "^12.39.0",