Frontend Architecture
FVN.li uses a modern React-based frontend architecture with Inertia.js, providing a seamless single-page application experience while maintaining the simplicity of server-side routing.
Technology Stack
Core Framework
React 19: Latest version with improved performance and concurrent features
Inertia.js 2.x: Bridges Laravel backend with React frontend without building an API
TypeScript: Full type safety with strict mode enabled
Vite 7: Lightning-fast build tool with HMR (Hot Module Replacement)
UI & Styling
Tailwind CSS 4: Utility-first CSS framework with custom design system
Headless UI: Unstyled, accessible UI components
Heroicons: SVG icon library
Flag Icons: Country flag icons for language support
State & Data Management
Inertia Shared Data: Global state (user, flash messages, filters)
React Hooks: Component-local state management
URL Parameters: Filter and search state persistence
Ziggy: Laravel route helper for type-safe routing in TypeScript
Forms & Validation
Inertia Form Helpers: Built-in form state management
Client-side Validation: Real-time validation feedback
CSRF Protection: Automatic token handling
File Uploads: Progress tracking and error handling
Rich Content
TinyMCE 8: WYSIWYG editor for game descriptions and content
Chart.js 4: Data visualization for analytics
react-chartjs-2: React wrapper for Chart.js
dnd-kit: Drag and drop for sortable lists
Project Structure
Key Architectural Patterns
Persistent Layouts
The application uses a persistent layout system where the header, navigation, and footer remain mounted across page transitions:
Benefits:
Smooth page transitions without re-mounting the header/footer
Maintains search state and navigation state
Reduces layout shift and improves perceived performance
Better accessibility with focus management
Server-Side Rendering (SSR)
Inertia SSR is enabled for improved SEO and initial page load performance:
The SSR process:
Server renders React components to HTML
HTML is sent to the client with initial props
React hydrates the HTML on the client side
Subsequent navigation uses client-side routing
Type-Safe Routing
Ziggy provides Laravel routes in TypeScript with full type safety:
Component Composition
UI components follow composition patterns for flexibility:
Custom Hooks
Reusable logic is extracted into custom hooks:
Accessibility
The application prioritizes accessibility:
Semantic HTML: Proper use of semantic elements
ARIA Labels: Descriptive labels for screen readers
Keyboard Navigation: Full keyboard support
Focus Management: Proper focus handling on navigation
Color Contrast: WCAG AA compliant color schemes
Responsive Design: Mobile-first approach
Build Process
Development
Vite development server features:
Hot Module Replacement (HMR): Instant updates without page reload
Fast Refresh: Preserves component state during updates
WebSocket over SSL: Secure HMR connection in DDEV
Source Maps: Easy debugging with original TypeScript source
Production Build
Build optimizations:
Code Splitting: Automatic route-based code splitting
Tree Shaking: Removes unused code
Minification: Compresses JavaScript and CSS
Asset Optimization: Optimizes images and fonts
SSR Bundle: Generates server-side rendering bundle
Source Maps: Production source maps for error tracking
Migration from Livewire
The application was migrated from Laravel Livewire to React + Inertia.js for:
Benefits Gained
Better Performance: Virtual DOM and optimized re-renders
Type Safety: Full TypeScript coverage
Developer Experience: Better tooling, HMR, and debugging
Component Ecosystem: Access to React ecosystem
SSR Support: Improved SEO and initial load performance
Testing: Better E2E testing with Playwright
Key Changes
Removed: Livewire components and Alpine.js
Added: React components with TypeScript
Replaced: Blade templates with React JSX/TSX
Updated: Build system from Laravel Mix to Vite
Enhanced: Form handling with Inertia form helpers
Improved: State management with React hooks
Best Practices
Component Organization
Keep components small and focused
Use composition over inheritance
Extract reusable logic into custom hooks
Maintain consistent file naming (PascalCase for components)
Type Safety
Define interfaces for all props
Use TypeScript strict mode
Avoid
any
type - useunknown
when necessaryLeverage type inference where possible
Performance
Use React.memo for expensive components
Implement proper key props in lists
Lazy load heavy components
Optimize images and assets
Accessibility Best Practices
Use semantic HTML elements
Provide ARIA labels where needed
Ensure keyboard navigation works
Test with screen readers
Maintain color contrast ratios