pkt/starter-kit

Comprehensive and efficient toolkit designed to streamline the process of developing Laravel application In PT Pupuk Kaltim

v2.3.3 2024-04-29 04:32 UTC

README

Logo Pupuk Kaltim

Total Downloads Latest Stable Version 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6d6d69742d61637469766974792f6d2f73616c6c6965656b792f706b742d737461727465722d6b6974 License

PKT Starter Kit

Welcome to the Pupuk Kaltim Laravel Starter Kit – your gateway to streamlined Laravel development imbued with the distinctive essence of Pupuk Kaltim's expertise. Crafted meticulously to align with the industry-leading practices and standards, this plugin/library serves as your companion in building robust Laravel applications infused with the hallmark quality of Pupuk Kaltim.

Installation

For stable package install using (RECOMMENDED)

composer require pkt/starter-kit --dev 

For development this package install using

composer require pkt/starter-kit:dev-dev --dev 

How To Use

Using vue

php artisan pkt:install vue

Using react (NOT READY)

php artisan pkt:install react

Full Installation/Setup Project

  1. Installing Laravel
composer create-project laravel/laravel:^10.0 <project-name>
  1. Move to Project Directory
cd <project-name>
  1. Include Starter Kit to Project
composer require pkt/starter-kit --dev 
  1. Install Starter Kit
php artisan pkt:install vue

#or

php artisan pkt:install react
  1. Setup/Edit environment variable (.env)
.env
  1. Run Migration and Seeder
php artisan migrate:fresh --seed
  1. Run project
# Frontend
npm run dev

#backend
php artisan serve
  1. For other development guide see GUIDE.md

Configuration

Before you use between ldap or portal, first you need to have production server and ask to IT Infra to open your application host and port to get authorize to use ldap or portal

Ldap

To enable ldap functionality, first you need to add this to the .env file and ask admin for the credential

LDAP_HOST=<ask admin>
LDAP_PORT=<ask admin>
LDAP_DN=<ask admin>
LDAP_PASS=<ask admin>
LDAP_TREE=<ask admin>

Portal PKT

To enable portal functionality, first you need to add this to the .env file and ask admin for the credential

ENABLE_SSO=<true|false>
DISABLE_INTERNAL_LOGIN=<true|false>
SSO_FULL_FEATURE=<true|false>
APPLICATION_NAME=pkt_starter_kit (your app name)
PORTAL_URL=https://aplikasi.pupukkaltim.com/
PORTAL_URL_LOGIN=https://aplikasi.pupukkaltim.com/login
PORTAL_URL_LOGOUT=https://aplikasi.pupukkaltim.com/logout
SSO_AUTH_TOKEN=<ask admin>
API_KEY_PORTAL=<ask admin>
AUTHORIZATION_TOKEN_PORTAL=<ask admin>

Using Docker For Production

Configure image, container name, and exposed port in docker-compose.yml file

# version: '1.0'
services:
  app:
    build:
      context: .
      dockerfile: .docker/php/Dockerfile
    image: pkt-starter-kit (your app name)
    container_name: pkt-starter-kit (your app name)
    restart: always
    ports:
      - 44080:80 (change 44080 to any open port you want)
      - 44443:443 (change 44443 to any open port you want)
    volumes:
      - .:/var/www/html
  1. Build docker and run
    docker-compose up -d --build
  2. To enter docker container
    docker exec -it <container_name> bash

SSL (HTTPS)

If SSL is disabled, enable SSL using

a2enmod ssl

Worker using supervisor

Available supervisor worker located in /etc/supervisor/conf.d/laravel-worker.conf

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=8
redirect_stderr=true
stdout_logfile=/var/logs/supervisor/laravel-worker.log
stopwaitsecs=3600

By default supervisor service is disabled in docker so you need to start.

service supervisor start
supervisorctl status

Or if you change the worker you need to reread and update supervisor service

supervisorctl reread
supervisorctl update

Or if you want to stop supervisor service

service supervisor stop

Included Library

Dev Extreme Laravel Breeze Spatie Role and Permission Element Plus Amcharts Tailwind CSS

Authors