Overview
Music Store is a React-based e-commerce application built with Vite, Supabase, and Tailwind CSS. The project follows a modern component-based architecture with clear separation of concerns.Directory Structure
Key Directories
src/components/
src/components/
Contains all reusable React components organized by feature:
- CartPanel/ - Shopping cart sidebar with add/remove functionality
- Navbar/ - Navigation with glass morphism effect
- productos/ - Product display and detail components
- Loader/ - Loading animation component
- Hero/ - Homepage hero section
- Brands/ - Brand showcase section
- CircularGallery/ - Interactive product gallery
- GuitarOfTheMth/ - Featured product section
src/context/
src/context/
Global state management using React Context API:
- CartContext/ - Manages shopping cart state, including:
- Cart items array
- Add/remove/update quantity methods
- Cart total calculation
- Cart panel visibility state
main.jsx to provide global cart access.src/pages/
src/pages/
Top-level route components:
- Home.jsx - Landing page (
/) - Categoria.jsx - Category filtering page (
/categoria/:nombre) - Product detail pages are handled by
ProductosDetalle.jsxcomponent
backend/
backend/
Backend utilities and configuration:
- supabaseClient.js - Supabase client initialization
- server.js - Optional Express server for additional backend logic
- package.json - Backend-specific dependencies (Express, CORS)
Core Files
main.jsx - Application Entry Point
Renders the React app and wraps it with providers:The
main.jsx
CartProvider wraps the app to provide global cart state.App.jsx - Main Component & Router
Defines routes and fetches products from Supabase:Products are fetched once on mount and passed down to child components.
App.jsx
Configuration Files
vite.config.js
Vite build configuration with React plugin
tailwind.config.js
Tailwind CSS configured to scan all JSX/TSX files
backend/supabaseClient.js
Supabase client initialization and configuration
package.json
Project metadata and npm scripts (dev, build, preview)
Data Flow
Next Steps
Set up Supabase
Configure your Supabase project and database
Environment Variables
Set up required environment variables
