Update README with full deploy guide
- Replace default Laravel README with project docs + deploy guide - Remove deploy/DEPLOY.md (merged into README)
This commit is contained in:
@@ -1,58 +1,243 @@
|
||||
<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" alt="Laravel Logo"></a></p>
|
||||
# Aplikasi Ketertiban Siswa
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.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 pencatatan pelanggaran siswa dengan manajemen poin, surat peringatan otomatis, notifikasi realtime, dan dashboard statistik.
|
||||
|
||||
## About Laravel
|
||||
**Tech Stack:** Laravel 13 · MySQL · Vite + Tailwind CSS v4 · Alpine.js · Laravel Reverb
|
||||
|
||||
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:
|
||||
---
|
||||
|
||||
- [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).
|
||||
## Fitur
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
- **Input Pelanggaran** — search siswa via API, pilih jenis pelanggaran, upload foto bukti (max 5)
|
||||
- **Sistem Poin** — setiap jenis punya poin, akumulasi otomatis, ambang surat peringatan SP1/SP2/SP3
|
||||
- **Surat Peringatan** — auto-generate saat poin capai ambang, format kop surat sekolah, siap cetak
|
||||
- **Dashboard** — statistik hari ini, feed realtime, top 5 poin, notifikasi ambang SP
|
||||
- **Realtime Notifikasi** — Laravel Reverb + Echo, notifikasi muncul saat pelanggaran baru
|
||||
- **Manajemen User** — role admin, BK, wali kelas, staff
|
||||
- **Sinkronisasi Siswa** — tarik data dari Database Kesiswaan via API token
|
||||
- **Foto Bukti** — upload via drag-drop atau kamera HP
|
||||
|
||||
## Learning Laravel
|
||||
---
|
||||
|
||||
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.
|
||||
## Panduan Deploy
|
||||
|
||||
In addition, [Laracasts](https://laracasts.com) contains thousands of 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.
|
||||
|
||||
You can also watch bite-sized lessons with real-world projects on [Laravel Learn](https://laravel.com/learn), where you will be guided through building a Laravel application from scratch while learning PHP fundamentals.
|
||||
|
||||
## Agentic Development
|
||||
|
||||
Laravel's predictable structure and conventions make it ideal for AI coding agents like Claude Code, Cursor, and GitHub Copilot. Install [Laravel Boost](https://laravel.com/docs/ai) to supercharge your AI workflow:
|
||||
### 1. Clone Repository
|
||||
|
||||
```bash
|
||||
composer require laravel/boost --dev
|
||||
|
||||
php artisan boost:install
|
||||
cd /var/www
|
||||
git clone https://github.com/novysan87/aplikasi-ketertiban.git
|
||||
cd aplikasi-ketertiban
|
||||
```
|
||||
|
||||
Boost provides your agent 15+ tools and skills that help agents build Laravel applications while following best practices.
|
||||
### 2. Setup Environment
|
||||
|
||||
## Contributing
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
Edit `.env` — sesuaikan dengan server produksi:
|
||||
|
||||
## Code of Conduct
|
||||
```
|
||||
APP_NAME="Aplikasi Ketertiban"
|
||||
APP_ENV=production
|
||||
APP_DEBUG=false
|
||||
APP_URL=http://192.168.100.6
|
||||
|
||||
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).
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=aplikasi_ketertiban
|
||||
DB_USERNAME=ketertiban
|
||||
DB_PASSWORD=***password***
|
||||
|
||||
## Security Vulnerabilities
|
||||
REVERB_APP_ID=app-id
|
||||
REVERB_APP_KEY=***key***
|
||||
REVERB_APP_SECRET=***secret***
|
||||
REVERB_HOST="localhost"
|
||||
REVERB_PORT=8080
|
||||
REVERB_SCHEME=http
|
||||
|
||||
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.
|
||||
VITE_REVERB_APP_KEY="***key***"
|
||||
VITE_REVERB_HOST="${REVERB_HOST}"
|
||||
VITE_REVERB_PORT="${REVERB_PORT}"
|
||||
```
|
||||
|
||||
## License
|
||||
Generate APP_KEY:
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
```bash
|
||||
php artisan key:generate
|
||||
```
|
||||
|
||||
### 3. Install Dependencies
|
||||
|
||||
```bash
|
||||
composer install --no-dev --optimize-autoloader
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
### 4. Setup Database
|
||||
|
||||
```sql
|
||||
CREATE DATABASE aplikasi_ketertiban CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
CREATE USER 'ketertiban'@'localhost' IDENTIFIED BY 'password_database';
|
||||
GRANT ALL ON aplikasi_ketertiban.* TO 'ketertiban'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
### 5. Migration & Link
|
||||
|
||||
```bash
|
||||
php artisan migrate --force
|
||||
php artisan storage:link
|
||||
```
|
||||
|
||||
### 6. Cache
|
||||
|
||||
```bash
|
||||
php artisan config:cache
|
||||
php artisan route:cache
|
||||
php artisan view:cache
|
||||
php artisan event:cache
|
||||
```
|
||||
|
||||
### 7. Izin Direktori
|
||||
|
||||
```bash
|
||||
chown -R www-data:www-data storage bootstrap/cache
|
||||
chmod -R 775 storage bootstrap/cache
|
||||
```
|
||||
|
||||
### 8. Web Server
|
||||
|
||||
**Apache VirtualHost:**
|
||||
|
||||
```apache
|
||||
<VirtualHost *:80>
|
||||
ServerName aplikasi-ketertiban.local
|
||||
DocumentRoot /var/www/aplikasi-ketertiban/public
|
||||
|
||||
<Directory /var/www/aplikasi-ketertiban/public>
|
||||
Options -Indexes +FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/aplikasi-ketertiban-error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/aplikasi-ketertiban-access.log combined
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
Aktifkan: `sudo a2ensite aplikasi-ketertiban.conf && sudo systemctl reload apache2`
|
||||
|
||||
### 9. Reverb WebSocket (Opsional)
|
||||
|
||||
Jalankan manual:
|
||||
|
||||
```bash
|
||||
php artisan reverb:start --host=0.0.0.0 --port=8080 &
|
||||
```
|
||||
|
||||
Atau via Supervisor di `/etc/supervisor/conf.d/reverb.conf`:
|
||||
|
||||
```ini
|
||||
[program:reverb]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=php /var/www/aplikasi-ketertiban/artisan reverb:start --host=0.0.0.0 --port=8080
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=www-data
|
||||
numprocs=1
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/var/www/aplikasi-ketertiban/storage/logs/reverb.log
|
||||
```
|
||||
|
||||
### 10. Queue Worker
|
||||
|
||||
File `/etc/supervisor/conf.d/queue-worker.conf`:
|
||||
|
||||
```ini
|
||||
[program:queue-worker]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=php /var/www/aplikasi-ketertiban/artisan queue:work --sleep=3 --tries=3
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=www-data
|
||||
numprocs=1
|
||||
redirect_stderr=true
|
||||
stdout_logfile=/var/www/aplikasi-ketertiban/storage/logs/queue.log
|
||||
```
|
||||
|
||||
### 11. User Default
|
||||
|
||||
Buat akun awal via tinker:
|
||||
|
||||
```bash
|
||||
php artisan tinker
|
||||
```
|
||||
|
||||
```php
|
||||
User::create([
|
||||
'name' => 'Administrator',
|
||||
'username' => 'admin',
|
||||
'email' => 'admin@sekolah.sch.id',
|
||||
'password' => bcrypt('Admin123!'),
|
||||
'role' => 'admin',
|
||||
'is_active' => true,
|
||||
]);
|
||||
User::create([
|
||||
'name' => 'BK Operator',
|
||||
'username' => 'bk',
|
||||
'email' => 'bk@sekolah.sch.id',
|
||||
'password' => bcrypt('Bk123!'),
|
||||
'role' => 'bk',
|
||||
'is_active' => true,
|
||||
]);
|
||||
```
|
||||
|
||||
### 12. Sinkronisasi Siswa
|
||||
|
||||
Login → **Pengaturan → Sinkronisasi** → isi URL API + Token → klik Sinkronkan Sekarang.
|
||||
|
||||
### 13. Verifikasi
|
||||
|
||||
Akses di browser: `http://IP-SERVER/`
|
||||
|
||||
---
|
||||
|
||||
## Catatan Penting
|
||||
|
||||
| Item | Detail |
|
||||
|------|--------|
|
||||
| **Akses** | HTTP via IP lokal (`192.168.100.6`). Belum HTTPS. |
|
||||
| **Upload foto** | Tersimpan di `storage/app/public/violations/` |
|
||||
| **Logo sekolah** | Upload di Pengaturan Sekolah setelah login |
|
||||
| **Background login** | Upload di Pengaturan Sekolah, ideal 1200×800 px |
|
||||
| **Queue & Reverb** | Wajib jalan via Supervisor untuk notifikasi realtime |
|
||||
|
||||
---
|
||||
|
||||
## Akun Default
|
||||
|
||||
| User | Username | Password | Role |
|
||||
|------|----------|----------|------|
|
||||
| Admin | `admin` | `Admin123!` | Full access |
|
||||
| BK | `bk` | `Bk123!` | Operasional |
|
||||
|
||||
---
|
||||
|
||||
## Struktur Database
|
||||
|
||||
```
|
||||
users → role (admin, bk, wali_kelas, staff)
|
||||
violation_categories → violation_types
|
||||
students → violations → violation_evidences
|
||||
students → sp_letters → sp_thresholds
|
||||
users → notifications
|
||||
settings (key-value)
|
||||
classes (sync dari kesiswaan)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Dikembangkan oleh [NOCTKJ.net](https://noctkj.net)
|
||||
|
||||
Reference in New Issue
Block a user