Technology Stack
Villa Buena E-Commerce is built with a modern React ecosystem leveraging industry-standard libraries for optimal performance and developer experience.Frontend Framework
React 19.2.0 with functional components and hooks
Build Tool
Vite 7.3.1 for fast development and optimized production builds
State Management
Zustand 5.0.11 with persistence middleware
Data Fetching
TanStack React Query 5.90.21 for server state
Routing
React Router DOM 7.13.1 with nested routes
HTTP Client
Axios 1.13.6 for API communication
Authentication
Auth0 React 2.15.0 for secure user authentication
UI Framework
Bootstrap 5.3.8 with custom styling
Core Dependencies
The application leverages the following key dependencies frompackage.json:12-21:
Architectural Layers
The application follows a clear separation of concerns across multiple layers:Presentation Layer
React components organized by feature (pages, components) that render the UI and handle user interactions.
State Management Layer
Zustand stores manage client-side state (cart, user data, UI preferences) with localStorage persistence.
Data Layer
React Query handles server state, caching, and data synchronization with automatic refetching and background updates.
Service Layer
Service modules encapsulate API communication logic and provide clean interfaces for data operations.
Application Entry Point
The application initializes inmain.jsx:13-24 with a provider hierarchy:
The provider hierarchy ensures that React Query, Auth0, and React Router are available throughout the entire component tree.
Directory Structure
The source code is organized as follows:Design Patterns
Provider Pattern
The application uses React Context providers for cross-cutting concerns like data fetching and authentication.Custom Hooks
Business logic is encapsulated in custom hooks (useProducts, useProduct) that combine React Query with service layer calls.
Service Layer Pattern
API calls are abstracted into service modules, keeping components clean and focused on presentation.Store Pattern
Zustand stores follow a simple create/update pattern with minimal boilerplate compared to Redux.Build Configuration
The project uses Vite with minimal configuration invite.config.js:5-7:
Environment Configuration
The API base URL is configured via environment variables:Next Steps
State Management
Learn about Zustand stores and client state patterns
Routing
Explore React Router configuration and navigation
API Integration
Understand API services and React Query integration
