Skip to content

Commit 644c098

Browse files
committed
fix: address Copilot review feedback
Signed-off-by: Gauarv Chaudhary <chaudharygaurav2004@gmail.com>
1 parent fae4a46 commit 644c098

7 files changed

Lines changed: 56 additions & 37 deletions

File tree

src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function Home() {
3434
/>
3535
</div>
3636
<p className="text-sm text-gray-500 text-center">
37-
Copyright © 2025 Keploy Inc. • Developer experience for e2e testing
37+
Copyright © {new Date().getFullYear()} Keploy Inc. • Developer experience for e2e testing
3838
</p>
3939
<div className="flex items-center gap-5">
4040
<a href="https://keploy.slack.com/" target="_blank" rel="noopener noreferrer" className="text-gray-400 hover:text-[#F89559] transition-colors" aria-label="Slack">

src/app/writers/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function WritersPage() {
5959
</svg>
6060
</a>
6161
<a
62-
href="https://twitter.com/keaboratory"
62+
href="https://twitter.com/Keployio"
6363
target="_blank"
6464
rel="noopener noreferrer"
6565
className="text-gray-400 hover:text-[#F89559] transition-colors"

src/components/Header.tsx

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,28 @@ function formatStarCount(count: number): string {
2121
return count.toString();
2222
}
2323

24-
// Custom hook to fetch GitHub stars
24+
// Custom hook to fetch GitHub stars with caching and rate limit handling
2525
function useGitHubStars(owner: string, repo: string): string {
2626
const [stars, setStars] = useState<string>(DEFAULT_GITHUB_STARS);
27+
const cacheKey = `github_stars_${owner}_${repo}`;
28+
const cacheExpiry = 60 * 60 * 1000; // 1 hour cache
2729

2830
useEffect(() => {
2931
const fetchStars = async () => {
32+
// Check cache first
33+
try {
34+
const cached = localStorage.getItem(cacheKey);
35+
if (cached) {
36+
const { value, timestamp } = JSON.parse(cached);
37+
if (Date.now() - timestamp < cacheExpiry) {
38+
setStars(value);
39+
return;
40+
}
41+
}
42+
} catch {
43+
// Ignore cache errors
44+
}
45+
3046
try {
3147
const response = await fetch(
3248
`https://api.github.com/repos/${owner}/${repo}`,
@@ -37,20 +53,40 @@ function useGitHubStars(owner: string, repo: string): string {
3753
}
3854
);
3955

56+
// Handle rate limiting
57+
if (response.status === 403) {
58+
const rateLimitRemaining = response.headers.get('X-RateLimit-Remaining');
59+
if (rateLimitRemaining === '0') {
60+
console.warn('GitHub API rate limit exceeded, using cached/default value');
61+
return;
62+
}
63+
}
64+
4065
if (!response.ok) {
4166
throw new Error('Failed to fetch GitHub stars');
4267
}
4368

4469
const data = await response.json();
45-
setStars(formatStarCount(data.stargazers_count));
70+
const formattedStars = formatStarCount(data.stargazers_count);
71+
setStars(formattedStars);
72+
73+
// Cache the result
74+
try {
75+
localStorage.setItem(cacheKey, JSON.stringify({
76+
value: formattedStars,
77+
timestamp: Date.now()
78+
}));
79+
} catch {
80+
// Ignore storage errors
81+
}
4682
} catch (error) {
4783
console.error('Error fetching GitHub stars:', error);
4884
// Keep default value on error
4985
}
5086
};
5187

5288
fetchStars();
53-
}, [owner, repo]);
89+
}, [owner, repo, cacheKey, cacheExpiry]);
5490

5591
return stars;
5692
}

src/components/sections/AboutSection.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"use client";
22

3-
import Image from "next/image";
4-
53
export function AboutSection() {
64
return (
75
<section

src/components/sections/CommunitySection.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

3-
import Image from "next/image";
4-
import { Users, MessageCircle, Heart } from "lucide-react";
3+
import { Users } from "lucide-react";
54

65
export function CommunitySection() {
76
return (

src/components/sections/WritersSection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export function WritersSection() {
140140
for your contributions to the developer community.
141141
</p>
142142
<a
143-
href="/#apply"
143+
href="https://forms.gle/R7RbuL39sc1TFW449"
144+
target="_blank"
145+
rel="noopener noreferrer"
144146
className="inline-flex items-center gap-3 px-10 py-4 bg-gradient-to-r from-[#F89559] to-[#E87B3A] text-[#00163D] font-bold rounded-full transition-all duration-300 hover:scale-105 hover:shadow-2xl hover:shadow-[#F89559]/40 focus:outline-none focus:ring-4 focus:ring-[#F89559]/50"
145147
>
146148
Join the Program

src/lib/writersData.ts

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ export interface Writer {
2222
/**
2323
* Array of writers - easily extendable by adding new Writer objects
2424
*
25-
* Note: Currently using placeholder images. Replace with actual writer photos.
26-
* Images should be placed in /public/images/writers/ directory.
25+
* NOTE: This is SAMPLE DATA for demonstration purposes.
26+
* When adding real writers, replace the placeholder values with actual data:
27+
* 1. Add their photo to /public/images/writers/
28+
* 2. Update the image path
29+
* 3. Replace social links with their actual profile URLs
2730
*/
2831
export const writers: Writer[] = [
2932
{
@@ -32,65 +35,46 @@ export const writers: Writer[] = [
3235
role: "Senior Technical Writer",
3336
bio: "Passionate about making complex testing concepts accessible to developers. Specializes in API testing and documentation best practices.",
3437
image: "/images/writers/placeholder-1.svg",
35-
socialLinks: {
36-
twitter: "https://twitter.com",
37-
github: "https://github.com",
38-
linkedin: "https://linkedin.com"
39-
}
38+
// Social links omitted - add real URLs when replacing with actual writer
4039
},
4140
{
4241
id: "writer-2",
4342
name: "Marcus Johnson",
4443
role: "DevOps Engineer & Writer",
4544
bio: "CI/CD enthusiast who loves writing about test automation, infrastructure, and developer productivity.",
4645
image: "/images/writers/placeholder-2.svg",
47-
socialLinks: {
48-
github: "https://github.com",
49-
linkedin: "https://linkedin.com"
50-
}
46+
// Social links omitted - add real URLs when replacing with actual writer
5147
},
5248
{
5349
id: "writer-3",
5450
name: "Priya Sharma",
5551
role: "Full Stack Developer",
5652
bio: "Writes about end-to-end testing strategies, microservices, and building reliable software systems.",
5753
image: "/images/writers/placeholder-3.svg",
58-
socialLinks: {
59-
twitter: "https://twitter.com",
60-
website: "https://example.com"
61-
}
54+
// Social links omitted - add real URLs when replacing with actual writer
6255
},
6356
{
6457
id: "writer-4",
6558
name: "Alex Rivera",
6659
role: "QA Lead & Educator",
6760
bio: "Bridges the gap between development and QA through comprehensive testing tutorials and guides.",
6861
image: "/images/writers/placeholder-4.svg",
69-
socialLinks: {
70-
github: "https://github.com",
71-
linkedin: "https://linkedin.com"
72-
}
62+
// Social links omitted - add real URLs when replacing with actual writer
7363
},
7464
{
7565
id: "writer-5",
7666
name: "Emily Zhang",
7767
role: "Backend Developer",
7868
bio: "Focuses on database testing, performance optimization, and writing clean, testable code.",
7969
image: "/images/writers/placeholder-5.svg",
80-
socialLinks: {
81-
twitter: "https://twitter.com",
82-
github: "https://github.com"
83-
}
70+
// Social links omitted - add real URLs when replacing with actual writer
8471
},
8572
{
8673
id: "writer-6",
8774
name: "David Park",
8875
role: "Open Source Contributor",
8976
bio: "Active contributor to testing frameworks. Writes about open source tools and community building.",
9077
image: "/images/writers/placeholder-6.svg",
91-
socialLinks: {
92-
github: "https://github.com",
93-
website: "https://example.com"
94-
}
78+
// Social links omitted - add real URLs when replacing with actual writer
9579
}
9680
];

0 commit comments

Comments
 (0)