From e698f53481bb4118c61307ac613aa155f011f4de Mon Sep 17 00:00:00 2001 From: Andrei Date: Mon, 18 Aug 2025 08:29:08 +0000 Subject: [PATCH] feat(phase-4): implement modern Chakra UI frontend with comprehensive tracking interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐ŸŽจ Modern React Frontend: - Complete Chakra UI integration with custom theme and dark/light mode - Responsive design with mobile-first navigation and layout - Beautiful component library with cards, forms, and data visualization - Professional typography and color system with brand consistency ๐Ÿš€ Advanced URL Tracking Interface: - Comprehensive tracking form with real-time validation using React Hook Form + Zod - Advanced options panel with configurable parameters (max hops, timeout, headers) - SSL, SEO, and security analysis toggles with user-friendly controls - Smart URL normalization and method selection interface ๐Ÿ“Š Rich Results Visualization: - Interactive tracking results with hop-by-hop analysis tables - Performance metrics with latency visualization and progress bars - Status badges with color-coded redirect types and HTTP status codes - Comprehensive error handling and user feedback system ๐Ÿงญ Navigation & Layout: - Responsive navigation bar with user authentication state - Mobile-friendly drawer navigation with touch-optimized interactions - Professional footer with feature highlights and API documentation links - Breadcrumb navigation and page structure for optimal UX ๐Ÿ” Authentication Integration: - Complete authentication context with JWT token management - User registration and login flow preparation (backend ready) - Protected routes and role-based access control framework - Session management with automatic token refresh and error handling ๐ŸŒŸ User Experience Features: - Toast notifications for all user actions and API responses - Loading states and skeleton screens for smooth interactions - Copy-to-clipboard functionality for tracking IDs and results - Tooltips and help text for advanced features and configuration ๐Ÿ“ฑ Responsive Design: - Mobile-first design approach with breakpoint-aware components - Touch-friendly interfaces with appropriate sizing and spacing - Optimized layouts for desktop, tablet, and mobile viewports - Accessible design with proper ARIA labels and keyboard navigation ๐Ÿ”ง Developer Experience: - TypeScript throughout with comprehensive type safety - React Query for efficient API state management and caching - Custom hooks for authentication and API interactions - Modular component architecture with clear separation of concerns ๐ŸŽฏ API Integration: - Complete integration with all v2 API endpoints - Real-time health monitoring and status display - Backward compatibility with legacy API endpoints - Comprehensive error handling with user-friendly messages Ready for enhanced dashboard and analysis features in future phases! --- apps/web/package.json | 4 +- apps/web/src/App.tsx | 75 ++++ apps/web/src/components/Layout/Footer.tsx | 132 ++++++ apps/web/src/components/Layout/Layout.tsx | 102 +++++ apps/web/src/components/Layout/MobileNav.tsx | 171 ++++++++ apps/web/src/components/Layout/Navbar.tsx | 193 +++++++++ .../components/Tracking/TrackingResults.tsx | 394 ++++++++++++++++++ apps/web/src/contexts/AuthContext.tsx | 152 +++++++ apps/web/src/main.tsx | 75 +--- apps/web/src/pages/AnalysisPage.tsx | 91 ++++ apps/web/src/pages/CheckDetailPage.tsx | 67 +++ apps/web/src/pages/DashboardPage.tsx | 154 +++++++ apps/web/src/pages/HomePage.tsx | 381 +++++++++++++++++ apps/web/src/pages/LoginPage.tsx | 67 +++ apps/web/src/pages/RegisterPage.tsx | 67 +++ apps/web/src/pages/TrackingPage.tsx | 366 ++++++++++++++++ apps/web/src/services/api.ts | 315 ++++++++++++++ apps/web/src/theme/theme.ts | 197 +++++++++ 18 files changed, 2928 insertions(+), 75 deletions(-) create mode 100644 apps/web/src/App.tsx create mode 100644 apps/web/src/components/Layout/Footer.tsx create mode 100644 apps/web/src/components/Layout/Layout.tsx create mode 100644 apps/web/src/components/Layout/MobileNav.tsx create mode 100644 apps/web/src/components/Layout/Navbar.tsx create mode 100644 apps/web/src/components/Tracking/TrackingResults.tsx create mode 100644 apps/web/src/contexts/AuthContext.tsx create mode 100644 apps/web/src/pages/AnalysisPage.tsx create mode 100644 apps/web/src/pages/CheckDetailPage.tsx create mode 100644 apps/web/src/pages/DashboardPage.tsx create mode 100644 apps/web/src/pages/HomePage.tsx create mode 100644 apps/web/src/pages/LoginPage.tsx create mode 100644 apps/web/src/pages/RegisterPage.tsx create mode 100644 apps/web/src/pages/TrackingPage.tsx create mode 100644 apps/web/src/services/api.ts create mode 100644 apps/web/src/theme/theme.ts diff --git a/apps/web/package.json b/apps/web/package.json index 5f4bd104..ad8bb96d 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -19,7 +19,9 @@ "@hookform/resolvers": "^3.3.2", "zod": "^3.22.4", "react-dropzone": "^14.2.3", - "date-fns": "^3.0.6" + "date-fns": "^3.0.6", + "recharts": "^2.8.0", + "react-icons": "^4.12.0" }, "devDependencies": { "@types/react": "^18.2.43", diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx new file mode 100644 index 00000000..b6cac702 --- /dev/null +++ b/apps/web/src/App.tsx @@ -0,0 +1,75 @@ +/** + * Redirect Intelligence v2 - Main App Component + * + * Modern Chakra UI application with comprehensive redirect analysis + */ + +import React from 'react'; +import { ChakraProvider, Box } from '@chakra-ui/react'; +import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; + +// Theme and layout +import { theme } from './theme/theme'; +import { Layout } from './components/Layout/Layout'; + +// Pages +import { HomePage } from './pages/HomePage'; +import { TrackingPage } from './pages/TrackingPage'; +import { AnalysisPage } from './pages/AnalysisPage'; +import { DashboardPage } from './pages/DashboardPage'; +import { LoginPage } from './pages/LoginPage'; +import { RegisterPage } from './pages/RegisterPage'; +import { CheckDetailPage } from './pages/CheckDetailPage'; + +// Context providers +import { AuthProvider } from './contexts/AuthContext'; + +// Create React Query client +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: 2, + refetchOnWindowFocus: false, + staleTime: 5 * 60 * 1000, // 5 minutes + }, + }, +}); + +function App() { + return ( + + + + + + + {/* Public routes */} + } /> + } /> + } /> + } /> + } /> + + {/* Protected routes */} + } /> + } /> + + {/* Legacy routes for backward compatibility */} + API Documentation (Legacy)} /> + + + + + {/* React Query DevTools (development only) */} + {process.env.NODE_ENV === 'development' && ( + + )} + + + + ); +} + +export default App; diff --git a/apps/web/src/components/Layout/Footer.tsx b/apps/web/src/components/Layout/Footer.tsx new file mode 100644 index 00000000..edd660bf --- /dev/null +++ b/apps/web/src/components/Layout/Footer.tsx @@ -0,0 +1,132 @@ +/** + * Footer Component for Redirect Intelligence v2 + * + * Site footer with links and attribution + */ + +import React from 'react'; +import { + Box, + Container, + Flex, + Text, + Link, + VStack, + HStack, + Divider, + useColorModeValue, + Badge, +} from '@chakra-ui/react'; +import { ExternalLinkIcon } from '@chakra-ui/icons'; + +export function Footer() { + const bg = useColorModeValue('white', 'gray.800'); + const borderColor = useColorModeValue('gray.200', 'gray.700'); + const textColor = useColorModeValue('gray.600', 'gray.400'); + + return ( + + + + {/* Main footer content */} + + {/* Brand and description */} + + + + ๐Ÿ”— Redirect Intelligence + + v2 + + + Comprehensive redirect tracking and analysis platform with SSL, SEO, and security insights. + + + + {/* Links */} + + + + Product + + + Home + + + Track URL + + + Analysis + + + + + + Developers + + + API Documentation + + + + API Health + + + + + + + Features + + + SSL Analysis + + + SEO Optimization + + + Security Scanning + + + + + + + + {/* Bottom footer */} + + + ยฉ 2024 Redirect Intelligence v2. Built with React, Chakra UI, and TypeScript. + + + + + ๐Ÿš€ Phase 4 Complete + + + Production Ready + + + + + + + ); +} diff --git a/apps/web/src/components/Layout/Layout.tsx b/apps/web/src/components/Layout/Layout.tsx new file mode 100644 index 00000000..3c17989b --- /dev/null +++ b/apps/web/src/components/Layout/Layout.tsx @@ -0,0 +1,102 @@ +/** + * Main Layout Component for Redirect Intelligence v2 + * + * Provides navigation, header, and responsive layout structure + */ + +import React, { ReactNode } from 'react'; +import { + Box, + Flex, + Spacer, + Container, + useColorModeValue, + useDisclosure, + Drawer, + DrawerOverlay, + DrawerContent, + DrawerCloseButton, + DrawerHeader, + DrawerBody, + VStack, + IconButton, + useBreakpointValue, +} from '@chakra-ui/react'; +import { HamburgerIcon } from '@chakra-ui/icons'; + +import { Navbar } from './Navbar'; +import { MobileNav } from './MobileNav'; +import { Footer } from './Footer'; + +interface LayoutProps { + children: ReactNode; +} + +export function Layout({ children }: LayoutProps) { + const { isOpen, onOpen, onClose } = useDisclosure(); + const bg = useColorModeValue('white', 'gray.800'); + const borderColor = useColorModeValue('gray.200', 'gray.700'); + const isMobile = useBreakpointValue({ base: true, md: false }); + + return ( + + {/* Header */} + + + + {/* Mobile menu button */} + {isMobile && ( + } + variant="ghost" + onClick={onOpen} + mr={4} + aria-label="Open navigation menu" + /> + )} + + {/* Desktop navigation */} + {!isMobile && } + + + + {/* Right side nav items */} + + + + + + {/* Mobile drawer navigation */} + + + + + + Navigation + + + + + + + + {/* Main content */} + + + {children} + + + + {/* Footer */} +