pkt / starter-kit
Comprehensive and efficient toolkit designed to streamline the process of developing Laravel application In PT Pupuk Kaltim
Installs: 128
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:CSS
Requires
- php: ^8.1.0
- doctrine/dbal: *
- illuminate/console: ^10.17
- illuminate/database: ^10.0
- illuminate/filesystem: ^10.17
- illuminate/support: ^10.17
- illuminate/validation: ^10.17
README
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
- Installing Laravel
composer create-project laravel/laravel:^10.0 <project-name>
- Move to Project Directory
cd <project-name>
- Include Starter Kit to Project
composer require pkt/starter-kit --dev
- Install Starter Kit
php artisan pkt:install vue
#or
php artisan pkt:install react
- Setup/Edit environment variable (.env)
.env
- Run Migration and Seeder
php artisan migrate:fresh --seed
- Run project
# Frontend npm run dev #backend php artisan serve
- 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
- Build docker and run
docker-compose up -d --build
- 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