Localhost Setup
You can set up eGrocer on your localhost environment for development and testing purposes. Follow these steps:
-
Install XAMPP or similar local server environment
-
Create a database for eGrocer
-
Extract the eGrocer files to your web server directory
-
Access the installation wizard through your browser
-
Follow the installation steps as described in the Server Setup section
-
Install XAMPP and Composer.
-
Copy egrocer code in (EX. C:/Xampp/htdocs/egrocer) your folder (make sure all files move). If you going to setup it on server give root path to public folder (public_html/egrocer/public).
-
Add Your Domain Name As
APP_URL=yourdomain
(Ex: wrteam.in or egrocer.wrteam.in) in.env
File. (Note:Only for Live Server)
Note: Be advised that if you do not find the .env
file in the root folder, it is necessary to activate the "Unhide hidden files and folders" option in your settings.
Check the .env file and ensure that INSTALL_MODE=server is set for installation on a live server hosting.
- Create Database name 'egrocer' and change
DB_DATABASE=egrocer
DB_USERNAME=database_user_name
DB_PASSWORD=database_user_password
INSTALL_MODE=localhost
in.env
File. - Now, in root directory, run this command
composer install
- After Composer installed successfully, run this command
npm install
- After npm installed successfully, run this command
php artisan migrate
to add all required tables in database. (Note: Make Sure Database configure in.env
) - After Migration run this command to add required database entries
php artisan db:seed
- For API's Authentication run command
php artisan passport:install
- For Images run command
php artisan storage:link
, If it is show link is already generated Please delete folderpublic/storage
and run command again. - Now, in root directory, run this command
php artisan serve
(Note: This is only for localhost not for server)
Troubleshooting
Common Issues and Solutions
-
Composer Memory Limit
COMPOSER_MEMORY_LIMIT=-1 composer install
-
Permission Issues
chmod -R 775 storage bootstrap/cache
-
Node.js Version
- Use Node.js version 14.x or higher
- Use
nvm
to manage Node.js versions
-
Database Connection
- Verify MySQL service is running
- Check database credentials in
.env
- Ensure database exists
Development Tips
-
Enable Debug Mode in
.env
:APP_DEBUG=true
-
Clear Cache:
php artisan config:clear
php artisan cache:clear
php artisan view:clear -
Watch for Changes:
npm run watch
-
Access Logs:
- Check
storage/logs/laravel.log
- Enable debug bar for development
- Check