> Create new database and rename `.env.example` to `.env` then update you `.env` configs so run this commands:
> Create a new database and rename `.env.example` to `.env`, then update your `.env` configurations. Run the following commands:
```bash
git clone https://github.com/4xmen/xshop.git
@ -39,35 +38,34 @@ composer install
php artisan migrate:fresh --seed
php artisan storage:link
php artisan key:generate
php artisan serv
php artisan serve
# to develop front-end
# To develop front-end
npm i
php artisan client
npm install @rollup/rollup-win32-x64-msvc # just for windows if the below line dose not work
npm install @rollup/rollup-win32-x64-msvc # Windows only, if the below line does not work
npm run dev
# or with yarn
# Or with yarn
yarn install
php artisan client
yarn add @rollup/rollup-win32-x64-msvc # just for windows if the below line dose not work
yarn add @rollup/rollup-win32-x64-msvc # Windows only, if the below line does not work
yarn dev
```
> [!TIP]
> Default admin email is : `developer@example.com` (developer) or `admin@example.com` (admin) and default password is: `password`
> [!TIP]
> Default admin emails are: `developer@example.com` (developer) or `admin@example.com` (admin)
> Default password: `password`
## Image Seeding
## image seeding
- Download & prepare images
- Download and prepare images:
```bash
php artisan seeding:prepare
```
- nor copy your image folder to `database/seeders/images/`
- then: Seeding image for models: [Group, Category, Post, Product, Slider]
```
- Then copy your image folder to `database/seeders/images/`
- Seed images for models: [Group, Category, Post, Product, Slider]
```bash
php artisan seeding:image Product digital
@ -79,94 +77,93 @@ Or to seed all models:
php artisan seeding:all digital
```
> First parameter is Model, Second is image seeder directory available [bag, clothe, digital, sport, posts, makeup]
> You can create your directory and put your image into new directory then use image seeder
> The first parameter is the model name; the second is the image seeder directory. Available directories: `[bag, clothe, digital, sport, posts, makeup]`
> You can create your own directory, add images to it, and use it with the image seeder.
## Requirement
## Requirements
- php 8.2.x or above [`php-gd`, `sqlite3`, `php-soap`]
- mysql or mariadb or sqlite
- composer
- recommends install imagemagick on server to more image performance
- PHP 8.2.x or above with extensions:`php-gd`, `sqlite3`, `php-soap`
- MySQL, MariaDB, or SQLite
- Composer
- Recommended: Install ImageMagick on the server for better image performance
## Deploy guide
## Deployment Guide
We recommend deploy xShop on VPS, so create database and run this commands:
We recommend deploying xShop on a VPS. Create a database and run the following commands:
```bash
cd /home/[yourUsername]/[pathOfYourWebsitePublicHTML]
git clone https://github.com/4xmen/xshop.git . # if this command not work make empty this folder
cd /home/[yourUsername]/[pathToYourWebsitePublicHTML]
git clone https://github.com/4xmen/xshop.git . # If this command doesn’t work, empty this folder first
cp .env.example .env
nano .env # edit your config db, url, etc.
nano .env # Edit your DB config, URL, etc.
composer install
php artisan migrate:fresh --seed
php artisan storage:link
php key:generate
php artisan key:generate
npm install
php artisan client
npm run build
```
## Make your site optimize & production mode
## Optimize for Production
```bash
nano .env # make APP_DEBUG false, APP_ENV production
nano .env # Set APP_DEBUG=false, APP_ENV=production