fix readme and preview precheck

This commit is contained in:
2025-07-14 16:28:22 +07:00
parent 833d5abbb5
commit f123e082f9
2 changed files with 235 additions and 62 deletions

261
README.md
View File

@@ -1,64 +1,237 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
# CKB - Bengkel Management System
<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>
Sistem manajemen bengkel yang dibangun dengan Laravel 8 dan menggunakan JavaScript inline untuk performa optimal.
## About Laravel
## 🚀 Overview
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
Aplikasi ini menggunakan pendekatan JavaScript inline untuk menghindari kebutuhan build process di production server. Semua vendor assets sudah disalin ke folder `public` dan siap untuk deployment.
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
## 📦 Prerequisites
Laravel is accessible, powerful, and provides tools required for large, robust applications.
- PHP 8.1+
- Composer
- MySQL/MariaDB
- Redis (optional)
- Docker (optional)
## Learning Laravel
## 🛠️ Installation
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
### Local Development
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
1. **Clone repository**
## Laravel Sponsors
```bash
git clone <repository-url>
cd ckb
```
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
2. **Install PHP dependencies**
### Premium Partners
```bash
composer install
```
- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Cubet Techno Labs](https://cubettech.com)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[Many](https://www.many.co.uk)**
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
- **[DevSquad](https://devsquad.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[OP.GG](https://op.gg)**
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
- **[Lendio](https://lendio.com)**
3. **Copy environment file**
## Contributing
```bash
cp .env.example .env
php artisan key:generate
```
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
4. **Configure database**
## Code of Conduct
```bash
# Edit .env file with your database credentials
php artisan migrate
php artisan db:seed
```
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
5. **Start development server**
```bash
php artisan serve
```
## Security Vulnerabilities
### Docker Development
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
```bash
# Build development image
docker build -f Dockerfile.dev -t ckb-dev .
## License
# Run container
docker run -p 8080:80 ckb-dev
```
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
### Docker Production
```bash
# Build production image
docker build -f Dockerfile -t ckb-prod .
# Run container
docker run -p 8080:80 ckb-prod
```
## 🐳 Docker Optimization
### ⚡ Optimizations Made
1. **Removed Node.js Dependencies**
- ❌ `nodejs` dan `npm` tidak lagi diinstall di container
- ✅ Mengurangi ukuran image sekitar 200-300MB
- ✅ Build time lebih cepat
2. **No JavaScript Compilation**
- ❌ Tidak ada `npm install` atau `npm run production`
- ✅ Vendor assets sudah ada di `public/js/vendor/` dan `public/css/vendor/`
- ✅ Library diakses langsung dari file yang sudah di-minify
3. **Optimized .dockerignore**
- ❌ Exclude `node_modules/`, `package.json`, `webpack.mix.js`
- ✅ Keep vendor assets di `public/` folder
- ✅ Mengurangi build context size
4. **Better Layer Caching**
- ✅ Copy `composer.json` terlebih dahulu
- ✅ Install PHP dependencies sebelum copy source code
- ✅ Cache layer untuk composer dependencies
### 📊 Performance Improvements
| Metric | Before | After | Improvement |
| ------------ | ------------- | -------- | ----------- |
| Image Size | ~800MB | ~500MB | -37.5% |
| Build Time | ~5-8 min | ~2-3 min | -60% |
| Dependencies | Node.js + PHP | PHP only | -50% |
## 📁 Project Structure
```
ckb/
├── app/
│ ├── Http/
│ │ ├── Controllers/
│ │ └── Requests/
│ ├── Models/
│ └── Services/
├── resources/
│ ├── views/
│ │ ├── layouts/
│ │ │ ├── frontapp.blade.php
│ │ │ └── backapp.blade.php
│ │ └── transaction/
│ └── sass/
├── public/
│ ├── js/
│ │ ├── vendor/
│ │ │ ├── jquery.dataTables.min.js
│ │ │ ├── dataTables.bootstrap4.min.js
│ │ │ ├── sweetalert2.min.js
│ │ │ ├── chart.umd.js
│ │ │ └── ...
│ │ └── bootstrap-datepicker.min.js
│ └── css/
│ ├── vendor/
│ │ ├── dataTables.bootstrap4.min.css
│ │ ├── sweetalert2.min.css
│ │ └── ...
│ └── bootstrap-datepicker.min.css
└── docker/
├── Dockerfile
├── Dockerfile.dev
└── nginx.conf
```
## 🎯 Key Features
### Frontend (Mobile App)
- **Camera Integration** - Foto precheck dan postcheck dengan kontrol penuh
- **File Upload** - Support hingga 20MB
- **Responsive Design** - Optimized untuk mobile devices
- **Real-time Updates** - WebSocket integration
### Backend (Admin Panel)
- **Transaction Management** - Manajemen transaksi bengkel
- **KPI Tracking** - Sistem KPI dengan perhitungan otomatis
- **DataTables** - Tabel data dengan fitur advanced
- **Chart.js** - Visualisasi data dan laporan
- **SweetAlert2** - Notifikasi yang user-friendly
### Warehouse Management
- **Stock Audit** - Audit stok dengan filter advanced
- **Mutations** - Mutasi antar dealer
- **Opnames** - Penghitungan stok
- **Product Management** - Manajemen produk dan kategori
## 🔧 Technology Stack
### Backend
- **Laravel 8** - PHP Framework
- **MySQL/MariaDB** - Database
- **Redis** - Cache & Session
- **PHP 8.1** - Runtime
### Frontend
- **Bootstrap 4** - CSS Framework
- **jQuery** - JavaScript Library
- **DataTables** - Table Enhancement
- **Chart.js** - Chart Library
- **SweetAlert2** - Alert Library
- **Bootstrap Datepicker** - Date Picker
### DevOps
- **Docker** - Containerization
- **Nginx** - Web Server
- **Supervisor** - Process Management
## 🚨 Important Notes
1. **Vendor assets sudah ada di folder `public/`** dan akan di-push ke git
2. **Tidak perlu npm install di production server**
3. **Semua JavaScript sudah inline** di Blade templates
4. **CSS masih perlu dikompilasi** jika ada perubahan di `resources/sass/`
## 🔧 Troubleshooting
### Docker Build Issues
```bash
# Gunakan Docker BuildKit untuk build lebih cepat
export DOCKER_BUILDKIT=1
docker build -f Dockerfile -t ckb-prod .
```
### Vendor Assets Missing
Pastikan folder `public/js/vendor/` dan `public/css/vendor/` sudah ada dan berisi file-file yang diperlukan.
### Database Issues
```bash
# Clear cache
php artisan cache:clear
php artisan config:clear
# Recreate database
php artisan migrate:fresh --seed
```
## 📝 License
This project is licensed under the MIT License.
## 🤝 Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request