Community Edition

Panduan Instalasi

Step-by-step guide untuk install dan menjalankan Yualan POS Community Edition di server Anda.

💡 Cara tercepat? Gunakan Docker: docker run -d -p 8627:80 rozzaqnh/yualan-community-edition

Prasyarat

Pastikan sistem Anda memiliki requirements berikut:

  • PHP: 8.2 atau lebih tinggi
  • Composer: 2.0 atau lebih tinggi
  • Node.js: 18.x atau 20.x
  • NPM/Yarn: Latest version
  • Database: SQLite (default) atau MySQL/PostgreSQL
  • Web Server: Apache/Nginx (untuk production)

PHP Extensions

Pastikan PHP extensions berikut telah terinstall:

Ubuntu / Debian

$ sudo apt install php8.2-curl php8.2-dom php8.2-gd \
  php8.2-intl php8.2-json php8.2-mbstring php8.2-openssl \
  php8.2-pdo php8.2-sqlite3 php8.2-xml php8.2-zip

CentOS / RHEL

$ sudo yum install php-curl php-dom php-gd php-intl \
  php-json php-mbstring php-openssl php-pdo php-sqlite \
  php-xml php-zip

Instalasi Development

1. Clone Repository

$ git clone https://github.com/Abdurozzaq/Yualan.git
$ cd Yualan

2. Install PHP Dependencies

$ composer install

3. Install Node.js Dependencies

$ npm install
# atau dengan yarn
$ yarn install

4. Environment Configuration

# Copy environment file
$ cp .env.example .env

# Generate application key
$ php artisan key:generate

Database Setup

Dengan SQLite (Default — Paling Mudah)

# Buat database file
$ touch database/database.sqlite

# Jalankan migrations
$ php artisan migrate

Dengan MySQL / PostgreSQL

Edit file .env:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=yualan_pos
DB_USERNAME=root
DB_PASSWORD=your_password

Kemudian jalankan migrations:

$ php artisan migrate

Seed Database (Opsional)

# Seed dengan data dummy untuk testing
$ php artisan db:seed

Asset Compilation

Development Mode

$ npm run dev

Production Build

$ npm run build

Storage & Queue Configuration

Storage Link

$ php artisan storage:link

Queue Worker (Production)

# Install supervisor
$ sudo apt install supervisor

Buat config file supervisor di /etc/supervisor/conf.d/yualan-worker.conf:

[program:yualan-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/yualan/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=www-data
numprocs=8
redirect_stderr=true
stdout_logfile=/path/to/yualan/storage/logs/worker.log
stopwaitsecs=3600
$ sudo supervisorctl reread
$ sudo supervisorctl update
$ sudo supervisorctl start yualan-worker:*

Cron Jobs

# Tambahkan ke crontab (crontab -e)
* * * * * cd /path/to/yualan && php artisan schedule:run >> /dev/null 2>&1

Menjalankan Aplikasi

Development Server

# Terminal 1 - Laravel server
$ php artisan serve

# Terminal 2 - Vite dev server
$ npm run dev

# Terminal 3 - Queue worker (opsional)
$ php artisan queue:work
🌐 Akses aplikasi di http://localhost:8000

Untuk deployment ke production, lihat Panduan Deployment →

Configuration

Mail Configuration

MAIL_MAILER=smtp
MAIL_HOST=your-smtp-host
MAIL_PORT=587
MAIL_USERNAME=your-email@example.com
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=your-email@example.com
MAIL_FROM_NAME="Yualan POS"

Cache Configuration (Production)

CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis

Verifikasi Instalasi

1. Test Basic Functionality

# Test database connection
$ php artisan tinker
>>> App\Models\User::count()

# Test queue system
$ php artisan queue:work --once

2. Test Frontend Build

$ npm run build

3. Check Logs

$ tail -f storage/logs/laravel.log

Troubleshooting

❌ Permission Errors

$ sudo chown -R www-data:www-data storage bootstrap/cache
$ sudo chmod -R 755 storage bootstrap/cache

❌ Node.js Version Issues

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
$ nvm install 20
$ nvm use 20

❌ Composer Memory Issues

$ php -d memory_limit=2G composer install

❌ SQLite Permission Issues

$ sudo chown www-data:www-data database/database.sqlite
$ sudo chmod 664 database/database.sqlite
$ sudo chown www-data:www-data database/

📁 Error Logs Location

  • Laravel logs: storage/logs/laravel.log
  • Web server logs: /var/log/apache2/ atau /var/log/nginx/
  • PHP-FPM logs: /var/log/php8.2-fpm.log

Butuh Bantuan?

Hubungi kami via WhatsApp atau buat issue di GitHub.