Skip to content

Commit bdb3751

Browse files
committed
feat: code quality tools
1 parent 41854a5 commit bdb3751

34 files changed

Lines changed: 1848 additions & 821 deletions

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
.next
3+
out
4+
build
5+
dist
6+
.husky
7+
coverage
8+
*.config.js
9+
*.config.mjs

.eslintrc.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"next/core-web-vitals",
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:react/recommended",
11+
"prettier"
12+
],
13+
"parser": "@typescript-eslint/parser",
14+
"parserOptions": {
15+
"ecmaFeatures": {
16+
"jsx": true
17+
},
18+
"ecmaVersion": "latest",
19+
"sourceType": "module"
20+
},
21+
"plugins": ["react", "@typescript-eslint", "prettier"],
22+
"rules": {
23+
"react/react-in-jsx-scope": "off",
24+
"react/prop-types": "off",
25+
"@typescript-eslint/no-unused-vars": [
26+
"error",
27+
{
28+
"argsIgnorePattern": "^_",
29+
"varsIgnorePattern": "^_"
30+
}
31+
],
32+
"@typescript-eslint/no-explicit-any": "warn",
33+
"@typescript-eslint/explicit-function-return-types": "off",
34+
"@typescript-eslint/explicit-module-boundary-types": "off",
35+
"prettier/prettier": "error",
36+
"react-hooks/rules-of-hooks": "error",
37+
"react-hooks/exhaustive-deps": "warn"
38+
},
39+
"settings": {
40+
"react": {
41+
"version": "detect"
42+
}
43+
}
44+
}

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged && npm run type-check

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
.next
3+
out
4+
build
5+
dist
6+
.git
7+
.husky
8+
coverage
9+
*.min.js

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always"
9+
}

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ A comprehensive GitHub toolkit built with Next.js frontend and Flask API. Analyz
66

77
- **[Getting Started](./docs/GETTING_STARTED.md)** - Installation, setup, and troubleshooting guide
88
- **[Features](./docs/FEATURES.md)** - Detailed feature descriptions and capabilities
9+
- **[Code Quality](./docs/CODE_QUALITY.md)** - Code quality tools, linting, formatting, and type safety
910
- **[Technical Details](./docs/TECHNICAL_DETAILS.md)** - Tech stack, architecture, and deployment
1011
- **[GitHub API Integration](./docs/GITHUB_API_INTEGRATION.md)** - API endpoints and integration details
1112

1213
## 🚀 Quick Start
1314

1415
### Prerequisites
16+
1517
- Node.js 18+ and yarn
1618
- Python 3.8+
1719
- Git
@@ -20,12 +22,14 @@ A comprehensive GitHub toolkit built with Next.js frontend and Flask API. Analyz
2022
### Setup
2123

2224
**1. Clone the repository:**
25+
2326
```bash
2427
git clone <repository-url>
2528
cd github-toolkit
2629
```
2730

2831
**2. Backend setup:**
32+
2933
```bash
3034
pip install -r requirements.txt
3135
cp .env.example .env
@@ -35,12 +39,14 @@ python -m flask --app api/index run -p 5328
3539
```
3640

3741
**3. Frontend setup (new terminal):**
42+
3843
```bash
3944
yarn
4045
yarn next-dev
4146
```
4247

4348
**4. Access the application:**
49+
4450
- Frontend: http://localhost:3000
4551
- Backend API: http://localhost:5328
4652

@@ -52,11 +58,13 @@ yarn next-dev
5258
## 💻 Development
5359

5460
**Run both frontend and backend concurrently:**
61+
5562
```bash
5663
yarn dev
5764
```
5865

5966
Or run them separately:
67+
6068
```bash
6169
# Terminal 1
6270
python -m flask --app api/index run -p 5328
@@ -66,6 +74,7 @@ yarn next-dev
6674
```
6775

6876
**Build for production:**
77+
6978
```bash
7079
yarn build
7180
yarn start
@@ -75,6 +84,7 @@ yarn start
7584

7685
- For detailed setup and troubleshooting, see [Getting Started](./docs/GETTING_STARTED.md)
7786
- For feature descriptions, see [Features](./docs/FEATURES.md)
87+
- For code quality standards, see [Code Quality](./docs/CODE_QUALITY.md)
7888
- For technical architecture, see [Technical Details](./docs/TECHNICAL_DETAILS.md)
7989
- For API integration details, see [GitHub API Integration](./docs/GITHUB_API_INTEGRATION.md)
8090

@@ -89,6 +99,7 @@ We welcome contributions! Please follow these steps:
8999
5. Open a Pull Request
90100

91101
### Code Standards
102+
92103
- Use TypeScript for frontend code
93104
- Maintain clean, readable code with proper comments
94105
- Test your changes thoroughly before submitting

app/compare-profiles/page.tsx

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

3-
import CompareProfiles from "@/components/CompareProfiles";
3+
import CompareProfiles from '@/components/CompareProfiles';
44

55
export default function CompareProfilesPage() {
66
return (

app/layout.tsx

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
1-
import type { Metadata } from "next";
2-
import { Inter } from "next/font/google";
3-
import "./globals.css";
4-
import Footer from "@/components/Footer";
5-
import ScrollToTop from "@/components/ScrollToTop";
1+
import type { Metadata } from 'next';
2+
import { Inter } from 'next/font/google';
3+
import './globals.css';
4+
import Footer from '@/components/Footer';
5+
import ScrollToTop from '@/components/ScrollToTop';
66

7-
const inter = Inter({ subsets: ["latin"] });
7+
const inter = Inter({ subsets: ['latin'] });
88

99
export const metadata: Metadata = {
10-
title: "GitHub Toolkit",
10+
title: 'GitHub Toolkit',
1111
description:
12-
"A comprehensive GitHub toolkit for analyzing profiles, repositories, and comparing developers",
12+
'A comprehensive GitHub toolkit for analyzing profiles, repositories, and comparing developers',
1313
icons: {
1414
icon: [
15-
{ url: "/favicon.ico", sizes: "any" },
16-
{ url: "/favicon-16x16.png", sizes: "16x16", type: "image/png" },
17-
{ url: "/favicon-32x32.png", sizes: "32x32", type: "image/png" },
15+
{ url: '/favicon.ico', sizes: 'any' },
16+
{ url: '/favicon-16x16.png', sizes: '16x16', type: 'image/png' },
17+
{ url: '/favicon-32x32.png', sizes: '32x32', type: 'image/png' },
1818
],
19-
apple: "/apple-touch-icon.png",
19+
apple: '/apple-touch-icon.png',
2020
},
21-
manifest: "/site.webmanifest",
21+
manifest: '/site.webmanifest',
2222
};
2323

24-
export default function RootLayout({
25-
children,
26-
}: {
27-
children: React.ReactNode;
28-
}) {
24+
export default function RootLayout({ children }: { children: React.ReactNode }) {
2925
const token = process.env.CLOUDFLARE_WEB_ANALYTICS_TOKEN;
3026

3127
return (

app/page.tsx

Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
1-
"use client";
1+
'use client';
22

3-
import {
4-
Github,
5-
User,
6-
Users,
7-
BarChart3,
8-
TrendingUp,
9-
ArrowRight,
10-
} from "lucide-react";
11-
import Link from "next/link";
3+
import { Github, User, Users, BarChart3, TrendingUp } from 'lucide-react';
4+
import Link from 'next/link';
125

136
export default function Home() {
147
const tools = [
158
{
16-
id: "profile-analyzer",
17-
title: "Profile Analyzer",
18-
subtitle: "Analyze GitHub profiles",
9+
id: 'profile-analyzer',
10+
title: 'Profile Analyzer',
11+
subtitle: 'Analyze GitHub profiles',
1912
icon: User,
20-
href: "/profile-analyzer",
13+
href: '/profile-analyzer',
2114
},
2215
{
23-
id: "compare-profiles",
24-
title: "Compare Profiles",
25-
subtitle: "Compare two developers",
16+
id: 'compare-profiles',
17+
title: 'Compare Profiles',
18+
subtitle: 'Compare two developers',
2619
icon: Users,
27-
href: "/compare-profiles",
28-
}
20+
href: '/compare-profiles',
21+
},
2922
];
3023

3124
return (
@@ -34,11 +27,12 @@ export default function Home() {
3427
<header className="bg-surface border-b border-elevated sticky top-0 z-50">
3528
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
3629
<div className="flex items-center h-16">
37-
<Link href="/" className="flex items-center space-x-3 hover:opacity-80 transition-opacity">
30+
<Link
31+
href="/"
32+
className="flex items-center space-x-3 hover:opacity-80 transition-opacity"
33+
>
3834
<Github className="h-8 w-8 text-primary" />
39-
<h1 className="text-2xl font-bold text-primary">
40-
GitHub Toolkit
41-
</h1>
35+
<h1 className="text-2xl font-bold text-primary">GitHub Toolkit</h1>
4236
</Link>
4337
</div>
4438
</div>
@@ -47,12 +41,10 @@ export default function Home() {
4741
<main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
4842
{/* Hero Section */}
4943
<div className="text-center mb-16">
50-
<h1 className="text-4xl md:text-5xl font-bold text-primary mb-4">
51-
GitHub Toolkit
52-
</h1>
44+
<h1 className="text-4xl md:text-5xl font-bold text-primary mb-4">GitHub Toolkit</h1>
5345
<p className="text-lg md:text-xl text-gray-300 mb-8 max-w-3xl mx-auto">
54-
A comprehensive suite of tools for analyzing GitHub profiles,
55-
comparing developers, and gaining insights.
46+
A comprehensive suite of tools for analyzing GitHub profiles, comparing developers, and
47+
gaining insights.
5648
</p>
5749
</div>
5850

@@ -97,34 +89,22 @@ export default function Home() {
9789
<div className="w-16 h-16 bg-elevated rounded-lg flex items-center justify-center mx-auto mb-4 border border-primary">
9890
<BarChart3 className="h-8 w-8 text-primary" />
9991
</div>
100-
<h3 className="text-lg font-semibold text-primary mb-2">
101-
Analytics
102-
</h3>
103-
<p className="text-gray-400">
104-
Get detailed insights with beautiful visualizations.
105-
</p>
92+
<h3 className="text-lg font-semibold text-primary mb-2">Analytics</h3>
93+
<p className="text-gray-400">Get detailed insights with beautiful visualizations.</p>
10694
</div>
10795
<div className="text-center">
10896
<div className="w-16 h-16 bg-elevated rounded-lg flex items-center justify-center mx-auto mb-4 border border-secondary">
10997
<Users className="h-8 w-8 text-secondary" />
11098
</div>
111-
<h3 className="text-lg font-semibold text-secondary mb-2">
112-
Compare
113-
</h3>
114-
<p className="text-gray-400">
115-
Compare developers side-by-side easily.
116-
</p>
99+
<h3 className="text-lg font-semibold text-secondary mb-2">Compare</h3>
100+
<p className="text-gray-400">Compare developers side-by-side easily.</p>
117101
</div>
118102
<div className="text-center">
119103
<div className="w-16 h-16 bg-elevated rounded-lg flex items-center justify-center mx-auto mb-4 border border-tertiary">
120104
<TrendingUp className="h-8 w-8 text-tertiary" />
121105
</div>
122-
<h3 className="text-lg font-semibold text-tertiary mb-2">
123-
Real-time
124-
</h3>
125-
<p className="text-gray-400">
126-
Access live data from GitHub API.
127-
</p>
106+
<h3 className="text-lg font-semibold text-tertiary mb-2">Real-time</h3>
107+
<p className="text-gray-400">Access live data from GitHub API.</p>
128108
</div>
129109
</div>
130110
</div>

app/profile-analyzer/page.tsx

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

3-
import ProfileAnalyzer from "@/components/ProfileAnalyzer";
3+
import ProfileAnalyzer from '@/components/ProfileAnalyzer';
44

55
export default function ProfileAnalyzerPage() {
66
return (

0 commit comments

Comments
 (0)