# SuperAPP PKLK - Aplikasi Pendataan PKLK Provinsi Jawa Barat

<p align="center">
    <img src="https://img.shields.io/badge/Laravel-11.x-FF2D20?style=for-the-badge&logo=laravel" alt="Laravel">
    <img src="https://img.shields.io/badge/PHP-8.2+-777BB4?style=for-the-badge&logo=php" alt="PHP">
    <img src="https://img.shields.io/badge/MySQL-8.0+-4479A1?style=for-the-badge&logo=mysql" alt="MySQL">
    <img src="https://img.shields.io/badge/Bootstrap-5.3-7952B3?style=for-the-badge&logo=bootstrap" alt="Bootstrap">
</p>

## 📋 Tentang Aplikasi

SuperAPP PKLK adalah sistem informasi manajemen untuk **Bidang PKLK Dinas Pendidikan Provinsi Jawa Barat** yang mengelola:

- 🏫 Data Sekolah Luar Biasa (SLB)
- 👨‍🎓 Data Siswa dan Disabilitas
- 📊 PSAJ (Penilaian Siswa Akhir Jenjang)
- 📍 Unit Layanan Disabilitas (ULD)
- 👥 Manajemen Pengguna Multi-Role
- 📈 Dashboard dan Statistik Real-time

---

## 🚀 Quick Start

### Prerequisites
- PHP >= 8.2
- Composer
- MySQL >= 8.0
- Node.js & NPM (untuk asset compilation)

### Installation

```bash
# Clone repository
git clone <repository-url>
cd appsuper

# Install dependencies
composer install
npm install

# Environment setup
cp .env.example .env
php artisan key:generate

# Database setup
php artisan migrate --seed

# Build assets
npm run build

# Start development server
php artisan serve
```

Aplikasi akan berjalan di `http://localhost:8000`

**Default Login:**
- Email: `superadmin@example.com`
- Password: `password`

---

## 📚 Dokumentasi

### Panduan Lengkap
- [📖 Installation Guide](dokumentasi/INSTALLATION_GUIDE.md) - Panduan instalasi lengkap
- [🗃️ Database Schema](dokumentasi/DATABASE_SCHEMA.md) - Struktur database
- [🔐 Security Guide](dokumentasi/SECURITY_GUIDE.md) - **Panduan keamanan & deployment**
- [🛡️ Security Cheatsheet](dokumentasi/SECURITY_CHEATSHEET.md) - **Quick reference keamanan**
- [📊 Flowcharts](dokumentasi/flowcharts.md) - Alur sistem

### Fitur-Fitur
- [🎓 PSAJ Feature](dokumentasi/PSAJ_FEATURE.md) - Sistem penilaian akhir jenjang
- [♿ Student Disability](dokumentasi/STUDENT_DISABILITY_FEATURE.md) - Manajemen data disabilitas
- [📍 ULD Location](dokumentasi/ULD_LOCATION_FEATURE.md) - Unit layanan disabilitas
- [🏠 Landing Page](dokumentasi/LANDING_PAGE_FEATURE.md) - Halaman publik
- [👤 User-School Mapping](dokumentasi/USER_SCHOOL_MAPPING.md) - Mapping user dan sekolah
- [🔐 NPSN Login](dokumentasi/NPSN_LOGIN_IMPLEMENTATION.md) - Login dengan NPSN

---

## 🔒 Keamanan

### ✅ Fitur Keamanan yang Sudah Diterapkan

1. **XSS Protection** - Auto-escape output pada semua blade templates
2. **CSRF Protection** - Token validation pada semua form POST
3. **SQL Injection Prevention** - Eloquent ORM dengan prepared statements
4. **Rate Limiting** - Maksimal 5 percobaan login gagal (lockout 5 menit)
5. **Security Headers** - X-Frame-Options, CSP, XSS-Protection, dll
6. **Input Validation** - Validasi ketat pada semua input
7. **Mass Assignment Protection** - Fillable attributes di semua model
8. **Session Security** - Encrypted sessions, HTTP-only cookies
9. **Password Hashing** - Bcrypt dengan rounds=12

### 📖 Baca Selengkapnya
- [🔐 Security Guide](dokumentasi/SECURITY_GUIDE.md) - Panduan deploy production
- [🛡️ Security Cheatsheet](dokumentasi/SECURITY_CHEATSHEET.md) - Best practices

---

## 👥 User Roles

1. **Super Admin** - Manajemen sistem keseluruhan
2. **Admin Dinas** - Manajemen tingkat dinas pendidikan
3. **Admin KCD** - Manajemen tingkat KCD (Kantor Cabang Dinas)
4. **Pengawas** - Supervisi sekolah
5. **Kepala Sekolah** - Manajemen sekolah
6. **Admin Sekolah** - Operasional sekolah

---

## 🛠️ Tech Stack

### Backend
- **Framework:** Laravel 11.x
- **Database:** MySQL 8.0+
- **Authentication:** Laravel Breeze (custom)
- **Queue:** Database driver

### Frontend
- **CSS Framework:** Bootstrap 5.3
- **Icons:** Bootstrap Icons
- **Charts:** Chart.js
- **Template Engine:** Blade

### Security
- **CSRF Protection:** Laravel built-in
- **XSS Prevention:** Blade auto-escaping
- **Rate Limiting:** Laravel RateLimiter
- **Password Hash:** Bcrypt (12 rounds)
- **Custom Middleware:** SecurityHeaders

---

## 🌐 Deployment ke Production

### Quick Steps

```bash
# 1. Copy production config
cp .env.production.example .env

# 2. Update .env
nano .env
# Set: APP_ENV=production, APP_DEBUG=false, SESSION_ENCRYPT=true

# 3. Generate key
php artisan key:generate

# 4. Optimize
php artisan config:cache
php artisan route:cache
php artisan view:cache

# 5. Migrate database
php artisan migrate --force

# 6. Set permissions
chmod -R 755 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache
```

**📖 Panduan lengkap:** [Security Guide - Deployment](dokumentasi/SECURITY_GUIDE.md#-langkah-deploy-ke-production)

---

## 🧪 Testing

```bash
# Run all tests
php artisan test

# Run specific test
php artisan test --filter=LoginTest

# With coverage
php artisan test --coverage
```

---

## 📊 Database Seeding

### Development Data
```bash
php artisan migrate:fresh --seed
```

### Production Data
```bash
php artisan migrate --force
php artisan db:seed --class=ProductionSeeder
```

---

## 🐛 Troubleshooting

### Umum
```bash
# Clear all caches
php artisan optimize:clear

# Regenerate autoload
composer dump-autoload

# Fix permissions
chmod -R 775 storage bootstrap/cache
```

### Session Issues
```bash
php artisan session:clear
php artisan cache:clear
php artisan config:clear
```

### Database Connection
```bash
# Test connection
php artisan tinker
>>> DB::connection()->getPdo();
```

---

## 📝 Changelog

### Version 1.0.0 (Feb 2026)
- ✅ Security hardening (XSS, CSRF, Rate Limiting, Security Headers)
- ✅ PSAJ management system
- ✅ ULD location mapping
- ✅ Student disability tracking
- ✅ Landing page with statistics
- ✅ NPSN login support
- ✅ Multi-role user management

---

## 🤝 Contributing

Panduan untuk berkontribusi:

1. Fork repository
2. Buat feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit changes (`git commit -m 'Add some AmazingFeature'`)
4. Push ke branch (`git push origin feature/AmazingFeature`)
5. Buka Pull Request

**Code Style:** PSR-12

---

## 🔐 Security Vulnerabilities

Jika menemukan security vulnerability, **jangan** buat public issue. Laporkan via email ke:
- **Email:** security@your-domain.com

Kami akan menangani dengan prioritas tinggi.

---

## 📄 License

The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

SuperAPP PKLK © 2026 Bidang PKLK Dinas Pendidikan Provinsi Jawa Barat

---

## 📞 Support

- **Email:** support@your-domain.com
- **Documentation:** [/dokumentasi](dokumentasi/)
- **Issues:** GitHub Issues

---

**Built with ❤️ for Bidang PKLK Dinas Pendidikan Provinsi Jawa Barat**

The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
