Directory Overview
Tienda ETCA follows a standard React application structure with clear separation of concerns. The source code is organized into logical directories based on functionality.Source Directory Structure
Detailed Directory Breakdown
/src/assets/ - Static Assets
/src/assets/ - Static Assets
Contains all static assets including images, icons, and media files.Files:
ETCAicon150.png(13.5 KB) - ETCA logo/iconarquero002a.webp(185 KB) - Archer imageloading.gif(1.4 MB) - Loading animationpinesETCA.jpg(490 KB) - ETCA location imagereact.svg(4.1 KB) - React logotresArquerosBochin.jpg(138 KB) - Three archers image
/src/auth/ - Authentication
/src/auth/ - Authentication
Contains authentication and authorization logic.Files:
RutaProtegida.jsx(15 lines) - Protected route wrapper component
- Implements role-based access control
- Redirects unauthorized users
- Wraps protected routes (e.g., admin panel)
/src/components/ - UI Components
/src/components/ - UI Components
Reusable components used throughout the application.Component Files:
Cart.jsx(126 lines) - Shopping cart modal with items listEquipo.jsx(29 lines) - Team/staff display componentFooter.jsx(49 lines) - Site footer with links and infoFormulario.jsx(55 lines) - Contact form componentFormularioEdicion.jsx(135 lines) - Product edit form for adminFormularioProducto.jsx(106 lines) - New product creation formHeader.jsx(44 lines) - Navigation header with cart iconListaUsuarios.jsx(37 lines) - User management listMain.jsx(29 lines) - Main content section componentMain2.jsx(29 lines) - Alternative main sectionNotFound.jsx(28 lines) - 404 error pageProduct.jsx(33 lines) - Individual product cardProductList.jsx(75 lines) - Product grid/list display
style/Footer.css- Footer component stylesstyle/Header.css- Header component stylesstyle/Modal.css- Modal component stylesstyle/NotFound.css- 404 page stylesstyle/Product.css- Product card styles
/src/context/ - State Management
/src/context/ - State Management
React Context providers for global state management.Files:Key Responsibilities:
AdminContext.jsx(135 lines) - Admin operations and product managementAuthContext.jsx(82 lines) - Authentication and user sessionCartContext.jsx(94 lines) - Shopping cart and product data
/src/layout/ - Page Layouts
/src/layout/ - Page Layouts
Full-page layout components representing application routes.Files:
AcercaDe.jsx(70 lines) - About page (/acercade)Admin.jsx(69 lines) - Admin dashboard (/admin)Contacto.jsx(36 lines) - Contact page (/contacto)DetallesProductos.jsx(47 lines) - Product detail page (/productos/:id)GaleriaProductos.jsx(32 lines) - Product gallery (/productos)Home.jsx(50 lines) - Homepage (/)Login.jsx(54 lines) - Login page (/login)layoutMain.css- Shared layout styles
Root Files
Application Entry Point
Styling Files
- index.css - Global CSS reset and base styles
- App.css - Application-level styling
- Component-specific CSS - Located in
components/style/
File Naming Conventions
Components
PascalCase:
ProductList.jsx, Header.jsxContexts
PascalCase with Context suffix:
CartContext.jsxStyles
PascalCase matching component:
Header.cssAssets
camelCase or descriptive:
pinesETCA.jpgComponent Size Distribution
Here’s a breakdown of component complexity by line count:Import Patterns
Context Usage
Component Imports
Asset Imports
Build Configuration
The project uses Vite as the build tool. Key configuration details:- Entry Point:
src/main.jsx - Build Tool: Vite 6.3.1
- Plugin: @vitejs/plugin-react 4.3.4
- Output: Optimized production bundle
Development Workflow
1
Development Server
Run
npm run dev to start Vite dev server with hot reload2
Component Development
Create components in appropriate directory (components/, layout/, etc.)
3
Context Integration
Use existing contexts or create new ones in context/ directory
4
Routing
Add routes in App.jsx, create layout components for pages
5
Build
Run
npm run build for production-optimized bundleBest Practices
Next Steps
Architecture
Learn about the application architecture
Technologies
Explore the tech stack details