- Primary Goal: Create a modern, high-converting agency website for Phoenix small businesses
- Value Proposition: "NASA engineer brings aerospace precision to business websites"
- Target Market: Small businesses in Phoenix area needing website modernization
- Core Message: Transform outdated 2005-era websites into modern, performance-driven solutions
- Framework: Next.js 15.4.5 with App Router (chosen for performance and SEO)
- Styling: Tailwind CSS v4 with custom design system
- Type Safety: Full TypeScript implementation for reliability
- Route Groups: Using
(marketing)and(dashboard)for logical separation - Performance First: Focus on Core Web Vitals and loading speed
Core Dependencies:
- Next.js 15.4.5 (React 19.1.0)
- TypeScript 5.x
- Tailwind CSS 4.x
- Framer Motion 12.23.12 (animations)
UI Components:
- shadcn/ui components (Button, Card, Badge, Skeleton)
- Custom components built on Radix UI primitives
- Lucide React for icons
Backend Services:
- Upstash Redis (lead storage, rate limiting)
- Resend (email notifications)
- Clerk (admin authentication)
Testing:
- Jest for unit tests
- Playwright for E2E tests (multi-browser support)
- Testing Library for component tests
- File Structure: Feature-based organization with clear separation of concerns
- Component Pattern: Functional components with TypeScript interfaces
- Styling: Utility-first with Tailwind, custom CSS variables for theming
- State Management: React hooks and context for local state
- Error Handling: Centralized error boundaries and graceful fallbacks
- Performance: Lazy loading, code splitting, optimized images
-
Interactive Demo Section
- Split-screen comparison (2005 vs modern site)
- Auto-switching views with smooth zoom transitions
- Progress indicators and animations
- Responsive design with mobile optimizations
-
Contact System
- Form with validation (react-hook-form)
- Rate limiting via Upstash Redis
- Email notifications through Resend
- Lead storage in Redis
- Success/error handling with user feedback
-
Trust Building Elements
- NASA engineer badge with experience
- Client testimonials section
- 99.9% uptime guarantee
- Performance metrics with animations
- Portfolio showcase
-
SEO & Performance
- Optimized meta tags
- Open Graph implementation
- Performance monitoring
- Lazy loading for heavy components
- Responsive images
E2E Test Failures (189/280 failing):
Critical Issues:
- Duplicate Elements - Multiple elements with same text causing test failures
- Missing Content Sections - "Lightning-Fast Performance" section not found
- Touch Target Sizes - Mobile buttons/links too small (< 48x48px)
- Responsive Issues - Layout problems on mobile viewports
Current Todo List:
- ✅ Create missing /contact and /portfolio pages - DONE (pages exist in
(marketing)group) - 🔄 Fix duplicate elements causing strict mode violations (in_progress)
- ⏳ Add missing content sections like Lightning-Fast Performance (pending)
- ⏳ Fix touch target sizes and mobile test issues (pending)
- ⏳ Run E2E tests to verify fixes (pending)
-
Test Infrastructure
- E2E tests need comprehensive update
- Mock implementations need review
- Test data needs standardization
-
Content Consistency
- Contact info variations (some places show placeholder data)
- Footer links need verification
- Portfolio content needs real projects
-
Performance Optimizations
- Bundle size analysis needed
- Image optimization opportunities
- Third-party script loading strategy
- Lighthouse Scores (target):
- Performance: 95+
- Accessibility: 100
- Best Practices: 100
- SEO: 100
- Core Web Vitals:
- LCP: < 2.5s
- FID: < 100ms
- CLS: < 0.1
-
App Router over Pages Router
- Better performance with React Server Components
- Improved data fetching patterns
- Built-in layouts and error handling
-
Route Groups Strategy
(marketing): Public-facing pages with shared layout(dashboard): Admin area with authentication- Clear separation of concerns
-
Component Architecture
- Atomic design principles
- Reusable UI components via shadcn
- Clear props interfaces with TypeScript
- Server Actions for form submissions
- API Routes for external integrations
- Edge Functions for performance-critical paths
- Rate Limiting at API level
Redis Data Structure:
leads:{email} - Contact form submissions
analytics:{metric}:{date} - Performance metrics
ratelimit:{ip} - Rate limiting counters
- Input Validation - Zod schemas for all user inputs
- Rate Limiting - IP-based with Upstash
- CSRF Protection - Built into Next.js
- Content Security Policy - Strict CSP headers
- Authentication - Clerk for admin access
/app # Next.js App Router
/(marketing) # Public pages with shared layout
/page.tsx # Homepage
/contact # Contact page
/portfolio # Portfolio page
/(dashboard) # Protected admin area
/dashboard # Analytics dashboard
/api # API routes
/contact # Contact form submission
/components # Reusable React components
/demo # Demo comparison components
/forms # Form components
/ui # Base UI components
/lib # Utility functions and services
/analytics.ts # Analytics tracking
/upstash.ts # Redis integration
/types.ts # TypeScript definitions
// Component Structure
interface ComponentProps {
// Props with JSDoc comments
}
export function Component({ prop }: ComponentProps) {
// Hook usage at top
// Event handlers
// Render logic
}
// Consistent naming
- Components: PascalCase
- Functions: camelCase
- Constants: UPPER_SNAKE_CASE
- Files: kebab-case or PascalCase for components- Loading States: Skeleton components for better UX
- Error Boundaries: Graceful error handling
- Lazy Loading: Dynamic imports for heavy components
- Animation Patterns: Framer Motion with consistent easing
- Unit Tests: Critical business logic
- Integration Tests: API routes and forms
- E2E Tests: User journeys across browsers
- Visual Regression: Screenshot comparisons
- Try-Catch Blocks: Async operations
- Error Boundaries: Component-level failures
- Fallback UI: Loading and error states
- User Feedback: Toast notifications
- Initial Setup Agent: Project scaffolding, dependencies
- UI/UX Agent: Design system, component library
- Backend Agent: API routes, database integration
- Testing Agent: Test suite setup, E2E tests
- Performance Agent: Optimizations, monitoring
- Context Management Agent: Documentation, knowledge transfer
- UI + Backend: Form implementations
- Testing + Performance: E2E performance tests
- Context + All: Knowledge sharing sessions
- UI Agent: Established Tailwind patterns, component library
- Backend Agent: Redis patterns, email integration
- Testing Agent: Playwright configuration, test patterns
- Performance Agent: Bundle analysis, optimization opportunities
- UI components → Backend APIs
- Tests → All features
- Performance → UI and Backend optimizations
- Context → All agents for knowledge
-
Analytics Dashboard
- Real-time visitor tracking
- Conversion metrics
- Performance monitoring
-
Enhanced Portfolio
- Case studies with metrics
- Before/after comparisons
- Client testimonials
-
Blog/Resources
- SEO-focused content
- Technical guides
- Industry insights
-
Client Portal
- Project status tracking
- Document sharing
- Communication hub
-
Performance
- Implement service worker
- Add resource hints
- Optimize third-party scripts
-
SEO
- Schema markup
- XML sitemap
- Robots.txt optimization
-
Accessibility
- ARIA improvements
- Keyboard navigation
- Screen reader testing
-
Code Quality
- Refactor duplicate code
- Improve type coverage
- Update dependencies
-
Testing
- Increase test coverage
- Add visual regression tests
- Performance benchmarks
-
Documentation
- API documentation
- Component storybook
- Deployment guides
-
Bundle Size
- Tree shaking improvements
- Dynamic imports strategy
- Dependency analysis
-
Runtime Performance
- React component memoization
- Virtual scrolling for lists
- Web worker utilization
-
Network Optimization
- HTTP/3 adoption
- CDN strategy
- Caching improvements
- Platform: Vercel (auto-deploy from GitHub)
- Branch Strategy:
main: Productiondevelop: Staging- Feature branches for development
- Performance: Vercel Analytics
- Errors: Built-in Next.js error reporting
- Uptime: External monitoring service
UPSTASH_REDIS_REST_URL
UPSTASH_REDIS_REST_TOKEN
RESEND_API_KEY
CLERK_SECRET_KEY
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
CONTACT_EMAIL_TO (default: fmp321@gmail.com)
pnpm dev # Development server
pnpm build # Production build
pnpm test # Run tests
pnpm test:e2e # E2E tests
git push # Deploy via Vercel/app/(marketing)/*- Public pages/components/*- Reusable components/lib/*- Utilities and helpers/e2e/*- E2E test suitesCLAUDE.md- AI assistant instructions
- Production Email: contact@phoenixprecision.dev
- Developer Email: fmp321@gmail.com
- Phone: (602) 531-4111
- Workflow:
.github/workflows/e2e-tests.yml - Triggers: Push to main/develop, pull requests
- Test Matrix:
- Browsers: Chromium, Firefox, WebKit
- Mobile: Pixel 5, iPhone 12
- Runs in parallel for efficiency
- Artifacts: Test reports and screenshots on failure
Last Updated: 2025-08-03 Version: 1.0.0 Status: Active Development