Skip to content

Commit dc679b3

Browse files
committed
refactor: simplify architecture by removing husky, test coverage requirements, and unused dependencies
- Remove Husky pre-commit hooks for faster development iteration - Remove test coverage thresholds (80%) to reduce development friction - Remove @tanstack/react-query (unused data fetching) - Remove @tanstack/react-query-devtools - Remove Zustand and unused store (no global state actually used) - Remove lint-staged configuration (can be added back if needed) - Simplify README to focus on actual stack - Add dist/ and build/ to .gitignore Tech stack now simplified to: - React 18 + TypeScript + Vite - TanStack Router (keeps type-safe routing) - Tailwind + Framer Motion for styling/animations - ESLint with StandardJS + TS Standard (linting only) - Vitest for optional testing (not required for commits) This maintains code quality through linting while reducing friction for portfolio development.
1 parent 98861e4 commit dc679b3

File tree

10 files changed

+63
-200
lines changed

10 files changed

+63
-200
lines changed

.eslintignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@ src/routeTree.gen.ts
3131
# Husky
3232
.husky/_/
3333

34+
35+
# Build output
36+
dist
37+
build
38+
39+
# Environment variables
40+
.env*
41+
!.env.example

.husky/pre-commit

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 39 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# grwm.dev — Homepage
22

3-
A modern React website for grwm.dev built with **TypeScript**, **Vite**, **React**, **TanStack Router**, **TanStack Query**, **Zustand**, and **Tailwind CSS**, following **Domain-Driven Design**, **SOLID principles**, and **clean code practices**.
3+
A modern, performant React portfolio built with **TypeScript**, **Vite**, **React 18**, **TanStack Router**, and **Tailwind CSS**, following **Domain-Driven Design** and **clean code practices**.
44

55
## Architecture
66

@@ -11,20 +11,15 @@ This project follows **Domain-Driven Design (DDD)** principles, organizing code
1111
- **TypeScript** - Type safety and better developer experience
1212
- **Vite** - Fast build tool and dev server
1313
- **React 18** - UI framework with latest features
14-
- **TanStack Router** - Type-safe routing
15-
- **TanStack Query** - Powerful data synchronization
16-
- **Zustand** - Lightweight state management
17-
- **Underscore.js** - Utility functions
14+
- **TanStack Router** - Type-safe routing with zero-config
1815
- **Tailwind CSS** - Utility-first CSS framework
1916
- **Framer Motion** - Animation library
20-
- **Vitest** - Fast unit testing
21-
- **Standard JS** - JavaScript style guide ([standardjs.com](https://standardjs.com/))
22-
- **TS Standard** - TypeScript style guide ([ts.dev/style](https://ts.dev/style/))
23-
- **Husky** - Git hooks
17+
- **Standard JS** - JavaScript style guide
18+
- **TS Standard** - TypeScript style guide
2419

2520
### Project Structure
2621

27-
```
22+
\\\
2823
src/
2924
├── domains/ # Business domains (DDD)
3025
│ ├── hero/ # Hero section domain
@@ -37,135 +32,57 @@ src/
3732
├── routes/ # TanStack Router routes
3833
├── pages/ # Page components
3934
├── shared/ # Shared resources
40-
│ ├── components/ # Reusable UI components
41-
│ ├── hooks/ # Custom React hooks
42-
│ ├── store/ # Zustand stores
43-
│ ├── utils/ # Utility functions
44-
│ ├── types/ # TypeScript type definitions
45-
│ └── constants/ # Application constants
4635
├── router.tsx # Router configuration
4736
└── main.tsx # Application entry point
48-
```
49-
50-
## Code Quality & Standards
51-
52-
### JavaScript Standard Style
53-
This project uses [JavaScript Standard Style](https://standardjs.com/) for JavaScript files:
54-
- No configuration needed
55-
- Automatic code formatting
56-
- Catches style issues early
57-
58-
### TypeScript Standard Style
59-
This project uses [TypeScript Standard Style](https://ts.dev/style/) for TypeScript files:
60-
- Strict type checking
61-
- Consistent code style
62-
- Type-safe development
63-
64-
### Pre-commit Hooks (Husky)
65-
Before every commit, the following checks run automatically:
66-
- ✅ Linting (Standard JS & TS Standard)
67-
- ✅ Code formatting
68-
- ✅ Type checking
69-
- ✅ Unit tests
70-
- ✅ Code coverage (minimum 80%)
37+
\\\
7138

7239
## Getting Started
7340

7441
### Prerequisites
75-
7642
- Node.js (v18 or higher)
7743
- npm or yarn
7844

7945
### Installation
80-
81-
1. Install dependencies:
82-
```bash
46+
\\\ash
8347
npm install
84-
```
85-
86-
2. Update Calendly URL:
87-
- Edit `src/shared/constants/calendly.ts` and replace the placeholder URL with your actual Calendly link
88-
89-
3. Start development server:
90-
```bash
9148
npm run dev
92-
```
49+
\\\
9350

94-
4. Build for production:
95-
```bash
51+
### Build for Production
52+
\\\ash
9653
npm run build
97-
```
98-
99-
The built files will be in the `dist` directory.
54+
\\\
10055

10156
## Available Scripts
10257

103-
- `npm run dev` - Start development server
104-
- `npm run build` - Build for production
105-
- `npm run preview` - Preview production build
106-
- `npm test` - Run tests in watch mode
107-
- `npm run test:ui` - Run tests with UI
108-
- `npm run test:coverage` - Run tests with coverage report
109-
- `npm run test:run` - Run tests once (CI mode)
110-
- `npm run lint` - Lint and fix code
111-
- `npm run lint:check` - Check linting without fixing
112-
- `npm run format` - Format code
113-
- `npm run type-check` - Type check without emitting
114-
115-
## Error Handling
116-
117-
### Error Boundaries
118-
The application includes error boundaries to catch React errors gracefully:
119-
- Root-level error boundary in router
120-
- Component-level error boundaries where needed
121-
122-
### 404 Page
123-
A custom 404 page is available at `/404` route.
124-
125-
### Error Handling Utilities
126-
- `useErrorHandler` hook for consistent error handling
127-
- Error formatting utilities
128-
- Global error state management with Zustand
129-
130-
## Performance Optimizations
131-
132-
- **Lazy Loading**: All below-the-fold components lazy loaded with React.lazy()
133-
- **Shimmer Loaders**: Replaced spinners with shimmer loaders for better UX
134-
- **Code Splitting**: Optimized vendor chunks for better caching
135-
- **Intersection Observer**: Viewport-based component loading
136-
- **React Query**: Optimized for fast hydration with structural sharing
137-
- **Build Optimizations**: ESBuild minification, CSS minification
138-
- **HTML Optimizations**: Preconnect, DNS prefetch, critical CSS inline
139-
- **Core Web Vitals**: Optimized for LCP < 2.5s, TTI < 3.8s
140-
141-
See [PERFORMANCE.md](./PERFORMANCE.md) for detailed optimization strategies.
142-
143-
## Testing
144-
145-
- **Vitest** - Fast unit testing framework
146-
- **React Testing Library** - Component testing
147-
- **Coverage Threshold** - Minimum 80% coverage required
148-
- All tests must pass before commit
149-
150-
## State Management
151-
152-
- **Zustand** - Lightweight state management
153-
- Global app state in `src/shared/store/useAppStore.ts`
154-
- Domain-specific stores can be added as needed
155-
156-
## Data Fetching
157-
158-
- **TanStack Query** - Powerful data synchronization
159-
- Configured with 5-minute stale time
160-
- Automatic retry and error handling
161-
- DevTools available in development
162-
163-
## Routing
164-
165-
- **TanStack Router** - Type-safe routing
166-
- File-based routing in `src/routes/`
167-
- Automatic route generation
168-
- Type-safe navigation
58+
- \
59+
pm run dev\ - Start development server
60+
- \
61+
pm run build\ - Build for production
62+
- \
63+
pm run preview\ - Preview production build
64+
- \
65+
pm run test\ - Run tests in watch mode
66+
- \
67+
pm run test:run\ - Run tests once
68+
- \
69+
pm run lint\ - Lint and fix code
70+
- \
71+
pm run type-check\ - Type check TypeScript
72+
73+
## Code Quality
74+
75+
- **Linting**: ESLint with StandardJS + TS Standard (enforced on staged files)
76+
- **Formatting**: Standard + TS Standard (automatic fixing)
77+
- **Type Safety**: TypeScript strict mode enforced
78+
79+
## Performance Features
80+
81+
- Lazy loading of below-fold sections
82+
- Code splitting by domain
83+
- Shimmer loaders for better UX
84+
- Intersection Observer-based viewport loading
85+
- Optimized vendor chunks
16986

17087
## License
17188

package.json

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,23 @@
99
"preview": "vite preview",
1010
"test": "vitest",
1111
"test:ui": "vitest --ui",
12-
"test:coverage": "vitest --coverage",
1312
"test:run": "vitest run",
1413
"lint": "standard --fix && ts-standard --fix",
1514
"lint:check": "standard && ts-standard",
1615
"format": "standard --fix && ts-standard --fix",
17-
"type-check": "tsc --noEmit",
18-
"prepare": "husky install"
16+
"type-check": "tsc --noEmit"
1917
},
2018
"dependencies": {
21-
"@tanstack/react-query": "^5.17.9",
2219
"@tanstack/react-router": "^1.20.0",
2320
"framer-motion": "^10.16.4",
2421
"react": "^18.2.0",
2522
"react-dom": "^18.2.0",
2623
"react-ga4": "^2.1.0",
2724
"react-grab": "^0.0.91",
2825
"react-helmet-async": "^2.0.4",
29-
"underscore": "^1.13.6",
30-
"zustand": "^4.4.7"
26+
"underscore": "^1.13.6"
3127
},
3228
"devDependencies": {
33-
"@tanstack/react-query-devtools": "^5.91.1",
3429
"@tanstack/router-devtools": "^1.20.0",
3530
"@tanstack/router-plugin": "^1.20.0",
3631
"@tanstack/router-vite-plugin": "^1.20.0",
@@ -52,9 +47,7 @@
5247
"eslint-plugin-promise": "^6.1.1",
5348
"eslint-plugin-react": "^7.33.2",
5449
"eslint-plugin-react-hooks": "^4.6.0",
55-
"husky": "^9.0.11",
5650
"jsdom": "^23.0.1",
57-
"lint-staged": "^15.2.0",
5851
"postcss": "^8.4.32",
5952
"standard": "^17.1.0",
6053
"tailwindcss": "^3.3.6",
@@ -63,14 +56,5 @@
6356
"typescript-eslint": "^7.0.0",
6457
"vite": "^5.0.8",
6558
"vitest": "^1.0.4"
66-
},
67-
"lint-staged": {
68-
"*.{ts,tsx}": [
69-
"eslint --fix",
70-
"ts-standard --fix"
71-
],
72-
"*.{js,jsx}": [
73-
"standard --fix"
74-
]
7559
}
7660
}

src/domains/layout/components/Footer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export const Footer = (): JSX.Element => {
2929
<div className='max-w-4xl mx-auto'>
3030
{/* Clarity Call Button */}
3131
<div className='mb-8 flex justify-center'>
32-
<Button
33-
href={CALENDLY_URL}
34-
label='👉 Book a Free Clarity Call'
32+
<Button
33+
href={CALENDLY_URL}
34+
label='👉 Book a Free Clarity Call'
3535
variant='primary'
3636
/>
3737
</div>

src/shared/components/Button/Button.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ describe('Button', () => {
6868
it('should track GA event on button click', () => {
6969
render(<Button href='/test' label='Tracked Button' />)
7070
const button = screen.getByRole('link', { name: 'Tracked Button' })
71-
71+
7272
button.click()
73-
73+
7474
expect(gaModule.trackGAEvent).toHaveBeenCalledWith(
7575
'engagement',
7676
'cta_button_click',
@@ -83,9 +83,9 @@ describe('Button', () => {
8383
const ctaLabel = '👉 Book a 1:1 Call'
8484
render(<Button href='https://topmate.io' label={ctaLabel} variant='topmate' />)
8585
const button = screen.getByRole('link', { name: ctaLabel })
86-
86+
8787
button.click()
88-
88+
8989
expect(gaModule.trackGAEvent).toHaveBeenCalledWith(
9090
'engagement',
9191
'cta_button_click',

src/shared/store/useAppStore.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/test-utils/setup.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ declare global {
88
}
99

1010
globalThis.IntersectionObserver = class IntersectionObserver {
11-
constructor() {}
12-
disconnect() {}
13-
observe() {}
14-
takeRecords() {
11+
constructor () {}
12+
disconnect () {}
13+
observe () {}
14+
takeRecords () {
1515
return []
1616
}
17-
unobserve() {}
17+
18+
unobserve () {}
1819
} as any
1920

2021
// Cleanup after each test

vitest.config.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ export default defineConfig({
2020
'**/dist/',
2121
'**/routeTree.gen.ts',
2222
],
23-
thresholds: {
24-
lines: 80,
25-
functions: 80,
26-
branches: 80,
27-
statements: 80,
28-
},
2923
},
3024
},
3125
resolve: {
@@ -36,3 +30,4 @@ export default defineConfig({
3630
},
3731
},
3832
});
33+

0 commit comments

Comments
 (0)