Overview
The SPA app is a modern single-page application built with React 19 and TanStack Router. It provides a fast, responsive user experience with client-side routing and state management. Key Information:- Port:
3001 - Framework: React 19
- Router: TanStack Router v1.159.10
- Build Tool: Vite 7.3.1
- Styling: Tailwind CSS 4.1.18
Tech Stack
Core Dependencies
- React: 19.2.4 - UI library with React Compiler support
- TanStack Router: 1.159.10 - Type-safe file-based routing
- TanStack Query: 5.90.21 - Data fetching and caching
- TanStack Form: 1.28.2 - Type-safe form handling
- Vite: 7.3.1 - Build tool and dev server
UI & Styling
- Tailwind CSS: 4.1.18 - Utility-first CSS framework
- React Aria Components: 1.15.1 - Accessible UI primitives
- Motion: 12.34.0 - Animation library
- Radix UI: Scroll area components
- Sonner: 2.0.7 - Toast notifications
- Recharts: 3.7.0 - Chart components
State Management & Forms
- Zustand: 5.0.11 - Lightweight state management
- Zod: 4.3.6 - Schema validation
- React Stately: 3.44.0 - State management for UI components
Data Fetching
- ky: 1.14.3 - HTTP client
- radashi: 12.7.1 - Utility library
Observability
- OpenTelemetry: Full instrumentation suite for browser tracing and metrics
@opentelemetry/api: 1.9.0@opentelemetry/sdk-trace-web: 2.5.1@opentelemetry/sdk-metrics: 2.5.1@opentelemetry/instrumentation-fetch: 0.212.0
SEO & Meta
- @unhead/react: 2.1.4 - Head management
- @unhead/schema-org: 2.1.4 - Schema.org metadata
- web-vitals: 5.1.0 - Core Web Vitals tracking
PWA
- vite-plugin-pwa: 1.2.0 - Progressive Web App support
- workbox: 7.4.0 - Service worker tooling
Developer Tools
- @tanstack/react-router-devtools: 1.159.10
- @tanstack/react-query-devtools: 5.91.3
- @tanstack/react-form-devtools: 0.2.15
- React Compiler: 1.0.0 - babel-plugin-react-compiler
- Playwright: 1.58.2 - E2E testing
Development
Available Scripts
Project Structure
Configuration Files
Vite Configuration
File:vite.config.ts
Configures:
- React plugin with React Compiler
- TanStack Router plugin
- Tailwind CSS via Vite
- PWA plugin with workbox
- TanStack devtools
- Bundle analyzer
- HTTPS localhost
TypeScript
Files:tsconfig.json- Main TypeScript configurationtsconfig.node.json- Node.js specific config
Playwright
File:playwright.config.ts
E2E testing configuration with Chromium.
PWA Assets
File:pwa-assets.config.ts
Generates PWA icons and splash screens.
Components
File:components.json
UI component configuration.
Environment Variables
The app uses
@dotenvx/dotenvx for environment variable management. Environment files are copied to .env.local during build/dev commands..env.dev- Development environment.env.prod- Production environment.env.local- Active environment (generated)
Testing
End-to-End Testing
The app uses Playwright for E2E testing with Chromium. Test Configuration:- Uses
.env.devfor test environment - Supports test sharding for CI
- UI mode available for interactive debugging
- Generates HTML reports
Observability
OpenTelemetry browser instrumentation is configured but does not support logs in the browser.
- Automatic fetch instrumentation
- Browser resource detection
- Custom metrics and traces
- OTLP HTTP exporters
@workspace/core for console logging.
SEO
Runtime Metadata
Use theuseSeo hook to generate metadata at runtime:
Sitemap Generation
When adding new pages, update the sitemap:scripts/gen-sitemap.ts.
Progressive Web App
The SPA includes full PWA support:- Service worker with workbox
- Offline support
- App manifest
- Install prompts
- Auto-generated icons and splash screens
Generate PWA Assets
Deployment
Vercel
The app includes avercel.json configuration for deployment.
Build Commands:
Build Output
Production builds are output to thedist/ directory.
Performance
Bundle Analysis
The Vite config includesrollup-plugin-visualizer for bundle analysis.
Web Vitals
Core Web Vitals are tracked using theweb-vitals library (v5.1.0).
React Compiler
The app uses the official React Compiler (babel-plugin-react-compiler v1.0.0) for automatic optimizations.Workspace Integration
The SPA uses shared packages from the monorepo:@workspace/core- Shared utilities and components@workspace/typescript-config- Shared TypeScript configuration
Best Practices
Type Safety: The app uses generated route trees (
routeTree.gen.ts) for type-safe routing. This file is automatically generated by the TanStack Router plugin.