AI Review Center
Commit Review Workspace ?
Select a commit on the left to inspect quality, security, business value, findings, and suggested code changes.
Project AI Score
?
63%
Quality Avg
?
68%
Security Avg
?
45%
Reviews
?
56
Review Result ?
jattin01/avriti · 08f22c7c
This commit adds a new shop page with dynamic fetching of categories and products, using React state and effects. The UI allows for filtering by categories through checkboxes and displays products with images, price, and add buttons. It contributes significantly to business value by enabling dynamic content loading and category filtering in the shop section. However, the hardcoded API endpoints ('http://localhost:8000/api/...') reduce portability and security, possibly exposing sensitive data. There is a lack of error handling on fetch requests, increasing potential bug risk. Security considerations like sanitizing inputs and securing API calls are unaddressed. The commit message is a merge with no details, reducing clarity.
Quality
?
75%
Security
?
30%
Business Value
?
70%
Maintainability
?
68%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Hardcoded Api Endpoint
Where
app/shop/page.tsx:34
Issue / Evidence
hardcoded API endpoint
Suggested Fix
change to environment variable or relative path for better portability and security
Hardcoded Api Endpoint
Where
app/shop/page.tsx:43
Issue / Evidence
hardcoded API endpoint
Suggested Fix
change to environment variable or relative path for better portability and security
No Fetch Error Handling
Where
app/shop/page.tsx:34
Issue / Evidence
no fetch error handling
Suggested Fix
add try-catch and error state to improve robustness and reduce bug risk
No Fetch Error Handling
Where
app/shop/page.tsx:43
Issue / Evidence
no fetch error handling
Suggested Fix
add try-catch and error state to improve robustness and reduce bug risk
Unclear Message
Where
commit message
Issue / Evidence
unclear message
Suggested Fix
provide descriptive message about implemented features to improve tracking and business value
Image Src Usage
Where
app/shop/page.tsx:126
Issue / Evidence
image src usage
Suggested Fix
validate and sanitize image URLs to prevent potential security risks
Checkbox Onchange Handler
Where
app/shop/page.tsx:78
Issue / Evidence
checkbox onChange handler
Suggested Fix
add keyboard accessibility improvements and ARIA attributes for better usability and compliance
Code Change Preview · app/shop/page.tsx
?
Removed / Before Commit
- "use client"; - - import { useState } from "react"; - import Image from "next/image"; - import Link from "next/link"; - import { PdfBrowserFrame } from "@/components/pdf-browser-frame"; - - const categories = [ - "Shop", - "Avriti All Products", - "AVRITI Vastu Salts", - "AVRITI Signature Charm", - "Crystalline by AVRITI", - "AVRITI Drishti", - "AVRITI Sacred Combos", - ]; - - const shopProducts = [
Added / After Commit
+ "use client"; + + import { useState, useEffect } from "react"; + import Image from "next/image"; + import Link from "next/link"; + import { PdfBrowserFrame } from "@/components/pdf-browser-frame"; + + interface Category { + id: number; + name: string; + slug: string; + description: string; + } + + interface Product { + id: number; + title: string; + slug: string;
Removed / Before Commit
- import type { NextConfig } from "next"; - - const nextConfig: NextConfig = { - /* config options here */ - }; - - export default nextConfig; - \ No newline at end of file
Added / After Commit
+ import type { NextConfig } from "next"; + + const nextConfig: NextConfig = { + images: { + remotePatterns: [ + { + protocol: 'http', + hostname: 'localhost', + port: '8000', + pathname: '/**', + }, + ], + unoptimized: true, // ✅ yeh add karo + }, + }; + + export default nextConfig; + \ No newline at end of file