# 📋 Sistem Informasi Pendataan Pegawai Jabatan Fungsional

**Sistem Informasi Pendataan Pegawai Jabatan Fungsional Pemerintah Kabupaten Sukabumi**

Aplikasi web untuk pendataan pegawai dengan sistem validasi admin. Pegawai mengisi formulir publik tanpa login, admin memvalidasi dan mengelola data.

---

## 🎯 Fitur Utama

### Untuk Pegawai (Public)
✅ Formulir pengisian data lengkap (otomatis)  
✅ Upload dokumen pendukung (SK, ijazah, CV, dll)  
✅ Validasi form real-time  
✅ Notifikasi sukses setelah submit  

### Untuk Admin (Dashboard)
✅ Login dengan autentikasi aman  
✅ Dashboard dengan statistik lengkap  
✅ Validasi/Setujui/Tolak data pegawai  
✅ Management CRUD pegawai  
✅ Management CRUD jabatan fungsional  
✅ Pencarian dan filter data  
✅ Lihat dokumen pegawai  

---

## 🚀 Quick Start

### Installation (5 menit)

**1. Setup Environment**
```bash
cd C:\laragon\www\Skripsi-M
copy .env.example .env
php artisan key:generate
```

**2. Database**
```bash
# Buat database di PHPMyAdmin atau:
php artisan migrate
php artisan db:seed
```

**3. Storage Link**
```bash
php artisan storage:link
```

**4. Run**
```bash
php artisan serve
# Akses: http://127.0.0.1:8000
```

### Default Login
- Email: `admin@sukabumi.gov.id`
- Password: `admin123456`

---

## 📚 Dokumentasi

| Dokumen | Deskripsi |
|---------|-----------|
| **[SETUP_GUIDE.md](SETUP_GUIDE.md)** | Panduan instalasi lengkap & konfigurasi |
| **[ARCHITECTURE.md](ARCHITECTURE.md)** | Arsitektur sistem & struktur kode |
| **[API_DOCUMENTATION.md](API_DOCUMENTATION.md)** | Dokumentasi API endpoints |
| **[SQL_REFERENCES.md](SQL_REFERENCES.md)** | Query SQL & troubleshooting |
| **[DEPLOYMENT_CHECKLIST.md](DEPLOYMENT_CHECKLIST.md)** | Deployment & testing checklist |

---

## 📁 Struktur Proyek

```
Skripsi-M/
├── app/                    # Application code
│   ├── Http/Controllers/   # Business logic
│   ├── Models/            # Database models
│   └── Http/Middleware/   # Middleware
├── database/              # Migrations & seeders
├── resources/views/       # Blade templates
│   ├── public/           # Public views
│   └── admin/            # Admin views
├── routes/               # Route definitions
└── storage/              # File uploads
```

---

## 🔐 Keamanan

- ✅ Password hashing dengan bcrypt
- ✅ CSRF protection
- ✅ Session management
- ✅ Admin middleware protection
- ✅ Input validation
- ✅ SQL injection prevention

---

## 🛠️ Tech Stack

| Layer | Technology |
|-------|-----------|
| **Backend** | Laravel 11 |
| **Frontend** | Bootstrap 5 + Blade |
| **Database** | MySQL 8.0 |
| **Server** | Apache + PHP 8.0+ |
| **Dev Tools** | Laragon |

---

## 📋 Tabel Database

### Pegawai
- NIP (unique)
- Nama, TTL, jenis kelamin
- Kontak (email, telepon)
- Data jabatan
- Status validasi (pending/approved/rejected)

### Jabatan Fungsional
- Nama jabatan
- Kategori
- Relasi dengan pegawai

### Pegawai Files
- Dokumen upload
- Path dan tipe file
- Relasi dengan pegawai

---

## 💼 Cara Kerja

### 1. Pengisian Data (Pegawai)
```
Kunjungi halaman form → Isi data lengkap → Upload dokumen → Submit
                       ↓
                    Data disimpan dengan status PENDING
```

### 2. Validasi (Admin)
```
Login admin → Dashboard → Pilih pegawai pending → Review data
                         ↓
                    Approve / Reject / Edit
```

---

## 🔄 Routes (Ringkas)

| Method | Route | Fungsi |
|--------|-------|--------|
| GET | `/` | Redirect ke form |
| GET | `/pendataan` | Form publik |
| POST | `/pendataan` | Submit form |
| GET | `/login` | Login page |
| POST | `/login` | Process login |
| GET | `/admin/dashboard` | Admin dashboard |
| GET | `/admin/pegawai` | List pegawai |
| POST | `/admin/pegawai/{id}/approve` | Approve |
| POST | `/admin/pegawai/{id}/reject` | Reject |

---

## 📝 Validasi Data

### NIP
- Wajib unik
- Max 20 karakter

### Email
- Format valid
- Wajib terisi

### Telepon
- Format Indonesia (08xx)

### Tanggal Lahir
- Harus sebelum hari ini

### File Upload
- Max 5MB per file
- Format: PDF, JPG, PNG

---

## 🐛 Troubleshooting Cepat

## Halaman 404
```bash
php artisan cache:clear
php artisan route:clear
```

### Database error
```bash
php artisan migrate:fresh --seed
```

### File upload tidak bekerja
```bash
php artisan storage:link --force
```

Lihat [SQL_REFERENCES.md](SQL_REFERENCES.md) untuk troubleshooting lengkap.

---

## 👥 User Roles

### Admin
- Login required
- Full CRUD access
- Validasi data
- Management system

### Pegawai
- No login needed
- Hanya bisa submit form
- View success page

---

## 📊 Dashboard Statistics

- Total pegawai terdaftar
- Pegawai menunggu validasi
- Pegawai yang disetujui
- Pegawai yang ditolak
- Pegawai per jabatan

---

## 🔒 Authentication & Security

```
Request → Check Session → Check Admin Middleware → Allow/Deny
```

**Security Features:**
- Password encrypted (Bcrypt)
- Session validated
- CSRF tokens checked
- Role-based access control

---

## 📤 File Management

**Direktori Upload:**
```
storage/app/public/pegawai-files/
```

**Akses Web:**
```
http://localhost/storage/pegawai-files/
```

---

## 🎨 UI/UX Design

- **Public Form:** Simple, responsive, user-friendly
- **Admin Dashboard:** Modern dark sidebar, clean interface
- **Tables:** Paginated, searchable, filterable
- **Mobile:** Fully responsive Bootstrap 5

---

## ⚡ Performance Optimizations

- ✅ Pagination (15 items/page)
- ✅ Database index optimization
- ✅ Eager loading relationships
- ✅ Query optimization
- ✅ File size limits

---

## 📞 Support & Documentation

### Dokumentasi Project
- [Setup Guide](SETUP_GUIDE.md) - Instalasi & setup lengkap
- [Architecture](ARCHITECTURE.md) - Design & structure
- [API Docs](API_DOCUMENTATION.md) - API endpoints
- [SQL Guide](SQL_REFERENCES.md) - Database & queries
- [Deployment](DEPLOYMENT_CHECKLIST.md) - Testing & deployment

### Official Resources
- [Laravel 11 Documentation](https://laravel.com/docs/11.x)
- [Bootstrap 5 Documentation](https://getbootstrap.com/docs/5.3)
- [MySQL 8.0 Reference](https://dev.mysql.com/doc/refman/8.0)

---

## 📋 System Requirements

- Windows PC / Server
- Laragon with PHP 8.0+
- MySQL 8.0+
- Composer
- Modern browser (Chrome, Edge, Firefox)
- Minimum 2GB RAM
- 500MB free disk space

---

## 🚀 Deployment Options

### Local Development
```bash
php artisan serve
```
Akses: `http://127.0.0.1:8000`

### Laragon Virtual Host
```
Configure di Laragon → Access via http://skripsi-m.test
```

### Production
```env
APP_ENV=production
APP_DEBUG=false
```

[Lihat DEPLOYMENT_CHECKLIST.md untuk detail lengkap](DEPLOYMENT_CHECKLIST.md)

---

## 📈 Future Roadmap

- [ ] Email notifications
- [ ] Excel export reports
- [ ] Advanced analytics
- [ ] LDAP integration
- [ ] Two-factor authentication
- [ ] Audit logging
- [ ] API versioning

---

## 📄 License & Attribution

**Private Project** untuk Pemerintah Kabupaten Sukabumi

Dibuat dengan Laravel 11 & Bootstrap 5

---

## 📊 Project Information

| Info | Detail |
|------|--------|
| **Project Name** | Sistem Informasi Pendataan Pegawai |
| **Version** | 1.0.0 |
| **Created Date** | 12 Mei 2025 |
| **Framework** | Laravel 11 |
| **Database** | MySQL 8.0 |
| **Deployment Status** | Production Ready |
| **Maintenance** | Ongoing |

---

## 🎯 Getting Started Steps

1. **Installation**: [Baca SETUP_GUIDE.md](SETUP_GUIDE.md)
2. **Testing**: Jalankan instalasi & test semua fitur
3. **Deployment**: Follow [DEPLOYMENT_CHECKLIST.md](DEPLOYMENT_CHECKLIST.md)
4. **Maintenance**: Setup backup & monitoring rutin

---

## 📧 Contact & Support

Untuk pertanyaan, feedback, atau support, silakan hubungi tim development.

---

**Dibuat dengan ❤️ untuk Kabupaten Sukabumi**

*Last Updated: 12 Mei 2025*  
*Version: 1.0.0 - Production Ready*
