PhoneGuard Insurance Portal is a modern, responsive web application built for smartphone insurance services. It provides users with an intuitive interface to explore insurance plans, compare coverage options, and enroll in protection plans for their devices.
- React 18.3.1 - Modern React with hooks and functional components
- TypeScript - Type-safe JavaScript for better development experience
- Vite 5.4.2 - Fast build tool and development server
- React Router DOM 6.22.0 - Client-side routing for single-page application
- TailwindCSS 3.4.1 - Utility-first CSS framework
- Lucide React 0.344.0 - Beautiful SVG icons
- Custom Design System - Consistent colors, typography, and components
- ContentStack 3.25.3 - Headless CMS for dynamic content management
- Custom ContentStack Service - Abstraction layer for content fetching
- Hero Section with compelling messaging
- Features Section highlighting key benefits
- Services Section with detailed information
- Testimonials Section showing customer reviews
- Content-driven via ContentStack CMS
- Device Selector - Choose brand and model
- Plan Filtering - Dynamic plan search based on device
- Plan Comparison - Side-by-side feature comparison
- Recommended Plans - Curated popular options
- Enrollment Process - Simulated plan enrollment
- About Page - Company information and values
- Contact Page - Contact forms and information
- All content managed via ContentStack
- Mobile-first approach
- Tablet and desktop optimization
- Accessibility considerations
// Example: Reusable UI Components
interface ButtonProps {
variant?: 'primary' | 'secondary' | 'outline';
size?: 'sm' | 'md' | 'lg';
disabled?: boolean;
loading?: boolean;
}
const Button: React.FC<ButtonProps> = ({
variant = 'primary',
size = 'md',
children,
...props
}) => {
// Component implementation with TailwindCSS classes
};// Example: Insurance Plan Data Structure
interface InsurancePlan {
id: string;
brand: string;
model: string;
name: string;
premiumPerMonth: number;
deductible: number;
features: {
theft: boolean;
screenRepair: boolean;
waterDamage: boolean;
upgradeOption: boolean;
};
}// Example: Content Fetching Hook
export const useHomePageContent = (options: {
locale?: string;
includeReferences?: boolean;
}) => {
const [homeContent, setHomeContent] = useState<any>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
// Fetch content from ContentStack
// Handle loading states and errors
return { homeContent, loading, error };
};- Primary Colors: Teal gradient (#14b8a6 to #0d9488)
- Secondary Colors: Blue gradient (#3b82f6 to #2563eb)
- Accent Colors: Orange gradient (#f97316 to #ea580c)
- Neutral Colors: Gray scale for text and backgrounds
- Font Family: Inter (modern, readable sans-serif)
- Responsive Typography: Fluid scaling across devices
- Semantic Hierarchy: Clear heading and body text styles
- Consistent spacing using Tailwind's spacing scale
- Hover effects for interactive elements
- Loading states for async operations
- Error handling with user-friendly messages
export const phoneModels = {
'Apple': ['iPhone 15 Pro Max', 'iPhone 15 Pro', 'iPhone 15', ...],
'Samsung': ['Galaxy S24 Ultra', 'Galaxy S24+', 'Galaxy S24', ...],
'Google Pixel': ['Pixel 8 Pro', 'Pixel 8', 'Pixel 8a', ...],
'OnePlus': ['OnePlus 12', 'OnePlus 11', 'OnePlus Nord 3', ...],
'Xiaomi': ['Xiaomi 14 Ultra', 'Xiaomi 14', 'Redmi Note 13 Pro+', ...]
};- 10 predefined plans across different brands
- Varying coverage levels (Basic, Premium, Ultimate)
- Realistic pricing based on device value
- Feature-based differentiation
const handleGeneratePlans = async () => {
if (!selectedBrand || !selectedModel) return;
setIsLoading(true);
// Simulate API call
await new Promise(resolve => setTimeout(resolve, 1500));
// Filter plans by device
const plans = insurancePlans.filter(
plan => plan.brand === selectedBrand && plan.model === selectedModel
);
setFilteredPlans(plans);
setIsLoading(false);
};const { homeContent, loading, error } = useHomePageContent({
locale: 'en-us',
includeReferences: true
});
// Render content with loading states
if (loading) return <LoadingSpinner />;
if (error) return <ErrorMessage />;- Feature-by-feature comparison
- Visual indicators (checkmarks/X marks)
- Pricing comparison
- Responsive table design
const getRecommendedPlans = () => {
return insurancePlans.filter(plan =>
(plan.name.includes('Premium') || plan.name.includes('Ultimate')) &&
(plan.brand === 'Apple' || plan.brand === 'Samsung' || plan.brand === 'Google Pixel')
).slice(0, 3);
};# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run previewsrc/
โโโ components/
โ โโโ Layout/ # Header, Footer components
โ โโโ UI/ # Reusable UI components
โโโ pages/ # Main application pages
โโโ hooks/ # Custom React hooks
โโโ services/ # ContentStack integration
โโโ data/ # Static data and types
โโโ styles/ # CSS and styling
- Vite's fast HMR for development
- Code splitting for optimal bundle size
- Tree shaking to eliminate unused code
- Modern JavaScript targeting for better performance
- Functional components with hooks
- Memo optimization for expensive components
- Lazy loading for route-based code splitting
- Error boundaries for graceful error handling
- Home Page Content
- Benefits and Features
- Testimonials
- Contact Information
- About Page Content
- Multi-language support ready
- Real-time content updates
- Reference field handling
- Asset management
// Example ContentStack service
export const getHomePageContent = async (options) => {
const query = Stack.ContentType('home_page')
.Entry()
.language(options.locale || 'en-us');
if (options.includeReferences) {
query.includeReference('benefits_reference');
query.includeReference('testimonials_reference');
}
const result = await query.fetch();
return result[0];
};- Show responsive hero section
- Demonstrate ContentStack content loading
- Highlight features and benefits section
- Show testimonials with dynamic content
- Demonstrate device selection process
- Show loading states during plan search
- Display filtered results based on device
- Show plan comparison functionality
- Demonstrate enrollment process
- Show mobile navigation
- Demonstrate responsive layouts
- Show touch-friendly interactions
- Highlight accessibility features
- Show CMS interface (if available)
- Demonstrate content updates
- Show how changes reflect in the app
- Explain content management workflow
- Loading states during async operations
- Error messages with actionable guidance
- Fallback content when CMS is unavailable
- Graceful degradation for offline scenarios
- TypeScript for compile-time error checking
- ESLint for code quality
- Console logging for debugging
- Error boundaries for React error handling
- User authentication system
- Payment integration for real enrollments
- Customer dashboard for policy management
- Claims processing workflow
- Real-time chat support
- Mobile app development
- Performance monitoring (e.g., Observe integration)
- A/B testing capabilities
- Advanced analytics tracking
- SEO optimization
- Progressive Web App features
- Modern React patterns with hooks and TypeScript
- Headless CMS integration with ContentStack
- Responsive design with TailwindCSS
- Component-based architecture
- State management with React hooks
- API integration patterns
- User-friendly interface for insurance shopping
- Dynamic content management capabilities
- Mobile-responsive design
- Scalable architecture for future growth
- Fast loading and smooth interactions
- Professional design and branding
- Cost-effective modern web solution
- Maintainable codebase with TypeScript
- Flexible content management system
- Scalable for business growth
- Modern technology stack
- Professional user experience
- First Contentful Paint: < 1.5s
- Largest Contentful Paint: < 2.5s
- Cumulative Layout Shift: < 0.1
- Time to Interactive: < 3.5s
- Chrome: Latest 2 versions
- Firefox: Latest 2 versions
- Safari: Latest 2 versions
- Edge: Latest 2 versions
- Mobile browsers: iOS Safari, Chrome Mobile
- WCAG 2.1 AA compliance target
- Screen reader compatibility
- Keyboard navigation support
- Color contrast requirements met
- Semantic HTML structure
This PhoneGuard Insurance Portal demonstrates modern web development practices, combining React's power with ContentStack's flexibility and TailwindCSS's utility-first approach. The application showcases how to build a professional, scalable, and maintainable web application that delivers an excellent user experience while providing robust content management capabilities.
The project serves as an excellent example of:
- Modern frontend architecture
- Headless CMS integration
- Responsive design principles
- Type-safe development
- Professional UI/UX design
Ready for production deployment and future enhancements!