Prerequisites
Before installing Sistema de Ventas, ensure your system meets the following requirements:Server Requirements
- PHP 7.3+ or 8.2+
- MySQL 5.7+ or 8.0+
- Apache or Nginx web server
- Composer (latest version)
Development Tools
- Node.js 14+ and NPM
- Git
- Text editor or IDE
- Terminal/Command line access
Installation Steps
Clone the Repository
Clone the Sistema de Ventas repository from GitHub:This downloads the complete application source code to your local machine.
Install PHP Dependencies
Use Composer to install all PHP dependencies defined in This installs:
composer.json:- Laravel Framework 11.0
- Laravel Sanctum 4.0 (API authentication)
- Laravel UI 4.0 (authentication scaffolding)
- Laravel Tinker 2.5 (REPL tool)
- Guzzle HTTP 7.0 (HTTP client)
If you encounter memory limit errors, try:
php -d memory_limit=-1 /path/to/composer installInstall Frontend Dependencies
Install JavaScript dependencies using NPM:This installs:
- Bootstrap 4.6
- jQuery 3.6
- Laravel Mix 6.0
- Sass and related build tools
Configure Environment
Copy the example environment file and configure it:Edit
.env and update the following essential settings:.env
Generate Application Key
Generate a unique application encryption key:This creates a secure
APP_KEY in your .env file, which Laravel uses to encrypt sessions and other sensitive data.Create Database
Create a MySQL database for the application:Or import the provided SQL file directly:The SQL file (
BD/tutorial_sistema_ventas.sql) includes the complete schema with these tables:categoria- Product categoriesproducto- Products with pricing and stockcliente- Customer informationproveedor- Supplier informationentrada- Inventory entriesventaandventa_detalle- Sales transactionsusuarioandtipo_usuario- User managementempresa- Company information
Run Migrations (Alternative)
If you prefer to use Laravel migrations instead of importing the SQL file:
The provided SQL file includes sample data. Using migrations will create empty tables.
Create Storage Link
Create a symbolic link from This allows public access to uploaded files (product photos, user avatars, company logos).
public/storage to storage/app/public:Compile Frontend Assets
Build the frontend assets (CSS and JavaScript):Use
watch mode during development to automatically recompile when files change.Post-Installation
Create Admin User
If using a fresh database, create an admin user account:Verify Installation
Check that everything is working:- Access the application: Navigate to
http://localhost:8000 - Login: Use the admin credentials
- Check database: Verify tables were created
- Test file uploads: Try uploading a product image
Docker Installation (Alternative)
Install with Laravel Sail
Install with Laravel Sail
Laravel Sail provides a Docker-based development environment:The application will be available at
http://localhostTroubleshooting
Permission Errors
Permission Errors
If you encounter permission errors, ensure proper permissions on storage and cache directories:
Database Connection Failed
Database Connection Failed
- Verify MySQL is running:
systemctl status mysql - Check credentials in
.envmatch your MySQL setup - Test connection:
mysql -u root -p -h 127.0.0.1 - Ensure database exists:
SHOW DATABASES;
Composer Install Fails
Composer Install Fails
- Update Composer:
composer self-update - Clear Composer cache:
composer clear-cache - Check PHP version:
php -v(must be 7.3+) - Install missing PHP extensions:
php-mbstring,php-xml,php-mysql
NPM Install Errors
NPM Install Errors
- Clear NPM cache:
npm cache clean --force - Delete node_modules:
rm -rf node_modules package-lock.json - Reinstall:
npm install - Update Node.js if using an old version
Production Deployment
For production deployment:- Set
APP_ENV=productionin.env - Set
APP_DEBUG=false - Configure a production database
- Run
php artisan config:cache - Run
php artisan route:cache - Run
php artisan view:cache - Build assets:
npm run prod - Configure your web server (Apache/Nginx)
- Set proper file permissions
- Enable HTTPS with SSL certificate
Next Steps
Quick Start
Complete the quick start guide
Configuration
Configure environment settings
Features
Explore core features