Quick Start Guide
Get Q-Sopa running on your local machine in just a few minutes. This guide will walk you through cloning the repository, installing dependencies, and starting the development server.Prerequisites: Make sure you have Node.js version 16 or higher installed on your machine. You can check your version with
node --version.Installation
Install Dependencies
Install all required dependencies using your preferred package manager:This will install:
- React 19.2.0
- React DOM 19.2.0
- Vite 7.3.1
- ESLint and related plugins
Start the Development Server
Launch the Vite development server with hot module replacement:The application will start at
http://localhost:5173 (or another port if 5173 is in use).Configuration
API Configuration
The application is pre-configured to use the production API hosted on Railway. The API base URL is set insrc/services/api.js:
src/services/api.js
Environment Variables (Optional)
For more flexible configuration, you can create a.env file in the project root:
.env
src/services/api.js to use the environment variable:
src/services/api.js
Vite exposes environment variables prefixed with
VITE_ to your client-side code via import.meta.env.Project Scripts
Q-Sopa includes several npm scripts defined inpackage.json:
package.json
Available Commands
Development Server
http://localhost:5173Build for Production
dist/ directoryLint Code
Preview Build
First-Time Setup Walkthrough
Understanding the Initial State
When you first load the application, you’ll see:- Navigation Bar: Displays the Q-Sopa logo and category navigation
- Logo Splash Screen: Animated ripple effect with the logo
- Call-to-Action: Text prompting you to “Selecciona una categoría para ver el menú”
- Footer: Copyright information
src/pages/Menu.jsx:
src/pages/Menu.jsx
Exploring the Application
Select a Category
Click on any category button in the navigation bar (e.g., hamburgers, pizzas, bebidas). On mobile, tap the hamburger menu icon to open the category drawer.
View Products
The application will:
- Show a loading spinner
- Fetch products from the API
- Display product cards in a responsive grid
- Product image
- Product name
- Price
- Optional badge (if present)
- “Ingredientes” button
Switch Categories
Click different category buttons to see different products. The active category is highlighted with a visual indicator.
Development Workflow
Hot Module Replacement (HMR)
Vite provides instant HMR, meaning your changes appear in the browser without a full page reload:src/components/ProductCard/ProductCard.jsx
Project Entry Point
The application bootstraps fromsrc/main.jsx:
src/main.jsx
StrictMode helps identify potential problems in the application during development.
Application Root
TheApp component simply renders the Menu page:
src/App.jsx
Building for Production
Create Production Build
Run the build command:This creates an optimized build in the
dist/ directory.Build Output
Vite optimizes your application with:- Code splitting: Separate chunks for better caching
- Minification: Smaller file sizes
- Tree shaking: Remove unused code
- Asset optimization: Optimized images and CSS
Troubleshooting
Port Already in Use
If port 5173 is already in use, Vite will automatically try the next available port. You can also specify a custom port:vite.config.js
API Connection Issues
If you see error messages about loading categories or products:- Check your internet connection
- Verify the API URL in
src/services/api.js - Check the browser console for detailed error messages
- Ensure the API server is running
Missing Material Symbols
If category icons don’t appear, verify that the Material Symbols stylesheet is loaded inindex.html:
index.html
Next Steps
Explore Components
Deep dive into each component’s implementation
API Integration
Learn how data flows through the application
Styling Guide
Understand the CSS architecture and customize styles
Customization
Learn how to customize and extend Q-Sopa
