From f4b9501d505e4b33238c8f93456dc72319301cab Mon Sep 17 00:00:00 2001 From: GuavaPopper Date: Wed, 10 Jun 2026 18:18:37 +0700 Subject: [PATCH] chore: remove docs and tests from deploy package --- DOCKER.md | 66 --- docs/plan3-admin-user-management.md | 746 ---------------------------- missing_features.md | 200 -------- phpunit.xml | 36 -- public/favicon.ico | 0 tests/Feature/AdminAdvancedTest.php | 156 ------ tests/Feature/AdminUserTest.php | 127 ----- tests/Feature/AuthTest.php | 131 ----- tests/Feature/DashboardTest.php | 56 --- tests/Feature/EditFormTest.php | 144 ------ tests/Feature/ExampleTest.php | 19 - tests/Feature/ExportTest.php | 75 --- tests/Feature/Plan7Test.php | 112 ----- tests/TestCase.php | 10 - tests/Unit/ExampleTest.php | 16 - 15 files changed, 1894 deletions(-) delete mode 100644 DOCKER.md delete mode 100644 docs/plan3-admin-user-management.md delete mode 100644 missing_features.md delete mode 100644 phpunit.xml delete mode 100644 public/favicon.ico delete mode 100644 tests/Feature/AdminAdvancedTest.php delete mode 100644 tests/Feature/AdminUserTest.php delete mode 100644 tests/Feature/AuthTest.php delete mode 100644 tests/Feature/DashboardTest.php delete mode 100644 tests/Feature/EditFormTest.php delete mode 100644 tests/Feature/ExampleTest.php delete mode 100644 tests/Feature/ExportTest.php delete mode 100644 tests/Feature/Plan7Test.php delete mode 100644 tests/TestCase.php delete mode 100644 tests/Unit/ExampleTest.php diff --git a/DOCKER.md b/DOCKER.md deleted file mode 100644 index 72f7ce8..0000000 --- a/DOCKER.md +++ /dev/null @@ -1,66 +0,0 @@ -# Docker Development - -This setup runs the Laravel app, Vite, and MySQL through Docker Compose. - -## Services - -- Laravel app: `http://localhost:8000` -- Vite dev server: `http://localhost:5173` -- MySQL from host: `127.0.0.1:3307` -- MySQL from containers: `mysql:3306` - -## First Run - -If you want Docker to own the Laravel environment values, copy the Docker example: - -```powershell -Copy-Item .env.docker.example .env -``` - -Then start everything: - -```powershell -docker compose up -d --build -``` - -The app container installs Composer dependencies, generates `APP_KEY` if needed, clears config, runs migrations, and seeds the database (roles + default admin account). - -The Vite container installs Node dependencies and starts the dev server. - -## Useful Commands - -```powershell -docker compose ps -docker compose logs -f app -docker compose logs -f vite -docker compose exec app php artisan migrate:status -docker compose exec app php artisan test -docker compose down -``` - -To remove the MySQL data volume and start with a clean database: - -```powershell -docker compose down -v -``` - -## Database Credentials - -```text -Database: webgis_miskin -Username: webgis -Password: secret -Root password: root -``` - -## Default Login - -Akses `http://localhost:8000` dan login dengan salah satu akun berikut: - -| Email | Password | Role | -|---|---|---| -| `admin@webgis.local` | `admin123` | Administrator (akses penuh) | -| `pengurus@webgis.local` | `password123` | Pengurus Ibadah | -| `petugas@webgis.local` | `password123` | Petugas Pendataan | -| `kebijakan@webgis.local` | `password123` | Pemangku Kebijakan (view only) | - diff --git a/docs/plan3-admin-user-management.md b/docs/plan3-admin-user-management.md deleted file mode 100644 index 746fd93..0000000 --- a/docs/plan3-admin-user-management.md +++ /dev/null @@ -1,746 +0,0 @@ -# Plan 3: Manajemen Pengguna (Admin User Management) - -> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. - -**Goal:** Tambah halaman admin `/admin/users` untuk CRUD pengguna dan assign role — hanya bisa diakses oleh `administrator`. - -**Architecture:** Buat `AdminUserController` dengan 5 endpoint JSON (`index`, `store`, `update`, `destroy`, `resetPassword`). Buat view `resources/views/admin/users.blade.php` dengan pola DaisyUI yang sama persis seperti `data.blade.php` (fetch API, toast, modals, table rows). Tambahkan link "Admin" ke navbar di `map.blade.php` dan `data.blade.php` — muncul hanya untuk role `administrator`. Semua route di-protect dengan `role:administrator`. - -**Tech Stack:** Laravel 13, Spatie Permission v8, Blade, Vanilla JS (fetch + async/await), DaisyUI 4, Tailwind CSS, Font Awesome 6. - -> **Scope note:** Ini adalah Plan 3 dari `missing_features.md` (A-01). Plan 4–6 adalah subsistem terpisah yang masing-masing butuh plan tersendiri. - ---- - -## Progress - -| Task | Status | -|------|--------| -| Task 1: AdminUserController | ✅ Selesai (file dibuat, belum di-commit) | -| Task 2: Routes | ⚠️ Sebagian — `use` statement ditambah, route group belum | -| Task 3: View admin/users.blade.php | ❌ Belum | -| Task 4: Navbar links (map + data) | ❌ Belum | -| Task 5: Tests | ❌ Belum | -| Task 6: Docs | ❌ Belum | - -**Commit dulu sebelum lanjut:** -```bash -git add app/Http/Controllers/AdminUserController.php routes/web.php -git commit -m "feat: add AdminUserController, add use statement to routes" -``` - ---- - -## File Map - -| Action | File | -|--------|------| -| Create | `app/Http/Controllers/AdminUserController.php` | -| Modify | `routes/web.php` | -| Create | `resources/views/admin/users.blade.php` | -| Modify | `resources/views/map.blade.php` | -| Modify | `resources/views/data.blade.php` | -| Create | `tests/Feature/AdminUserTest.php` | -| Modify | `missing_features.md` | -| Modify | `README.md` | - ---- - -## Task 1: Buat AdminUserController ✅ - -File sudah dibuat di `app/Http/Controllers/AdminUserController.php`. - -- [x] **Step 1: Tulis controller** - -```php -get()->map(fn($u) => [ - 'id' => $u->id, - 'name' => $u->name, - 'email' => $u->email, - 'role' => $u->getRoleNames()->first() ?? null, - ]); - return response()->json($users); - } - - public function store(Request $request) - { - $validated = $request->validate([ - 'name' => 'required|string|max:255', - 'email' => 'required|email|unique:users,email', - 'password' => 'required|string|min:8', - 'role' => 'required|string|exists:roles,name', - ]); - - $user = User::create([ - 'name' => $validated['name'], - 'email' => $validated['email'], - 'password' => $validated['password'], - ]); - $user->syncRoles([$validated['role']]); - - return response()->json(['success' => true, 'data' => [ - 'id' => $user->id, 'name' => $user->name, - 'email' => $user->email, 'role' => $validated['role'], - ]]); - } - - public function update(Request $request, $id) - { - $user = User::findOrFail($id); - - $validated = $request->validate([ - 'name' => 'required|string|max:255', - 'email' => 'required|email|unique:users,email,' . $id, - 'role' => 'required|string|exists:roles,name', - ]); - - $user->update(['name' => $validated['name'], 'email' => $validated['email']]); - $user->syncRoles([$validated['role']]); - - return response()->json(['success' => true, 'data' => [ - 'id' => $user->id, 'name' => $user->name, - 'email' => $user->email, 'role' => $validated['role'], - ]]); - } - - public function destroy($id) - { - $user = User::findOrFail($id); - - if ($user->id === auth()->id()) { - return response()->json(['message' => 'Tidak dapat menghapus akun sendiri.'], 403); - } - - $user->delete(); - return response()->json(['success' => true]); - } - - public function resetPassword(Request $request, $id) - { - $user = User::findOrFail($id); - - $request->validate([ - 'password' => 'required|string|min:8|confirmed', - ]); - - $user->update(['password' => $request->password]); - return response()->json(['success' => true]); - } -} -``` - -- [ ] **Step 2: Commit** - -```bash -git add app/Http/Controllers/AdminUserController.php -git commit -m "feat: add AdminUserController with CRUD and password reset" -``` - ---- - -## Task 2: Tambah Routes Admin - -**Files:** -- Modify: `routes/web.php` - -> **STATUS:** `use App\Http\Controllers\AdminUserController;` sudah ditambah di routes/web.php. Tinggal tambahkan route group di Step 1 lalu commit. - -- [ ] **Step 1: Tambah route group admin** - -Di `routes/web.php`, dalam middleware group `auth`, tambahkan **sebelum** kurung tutup `});` terakhir: - -```php - // Admin routes — hanya administrator - Route::middleware('role:administrator')->group(function () { - Route::get('/admin/users', fn() => view('admin.users'))->name('admin.users'); - - Route::prefix('api/admin')->group(function () { - Route::get('/users', [AdminUserController::class, 'index']); - Route::post('/users', [AdminUserController::class, 'store']); - Route::put('/users/{id}', [AdminUserController::class, 'update']); - Route::delete('/users/{id}', [AdminUserController::class, 'destroy']); - Route::put('/users/{id}/password', [AdminUserController::class, 'resetPassword']); - }); - }); -``` - -- [ ] **Step 2: Commit** - -```bash -git add routes/web.php -git commit -m "feat: add admin user management routes" -``` - ---- - -## Task 3: Buat View Admin Users - -**Files:** -- Create: `resources/views/admin/users.blade.php` - -Ikuti pola `data.blade.php` (sticky navbar, DaisyUI, JS fetch, toast, modals). - -- [ ] **Step 1: Tulis view lengkap** - -```html - - - - - - - Manajemen Pengguna - WebGIS - - - - - - - - - - - - -
- - -
-
-

- - Manajemen Pengguna -

-

Kelola akun pengguna dan hak akses sistem.

-
- -
- - -
- - -
- - - - - - - - -
#NamaEmailRoleAksi
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -``` - -- [ ] **Step 2: Commit** - -```bash -git add resources/views/admin/users.blade.php -git commit -m "feat: add admin users management view" -``` - ---- - -## Task 4: Tambah Link Admin ke Navbar - -**Files:** -- Modify: `resources/views/map.blade.php` -- Modify: `resources/views/data.blade.php` - -- [ ] **Step 1: Tambah di map.blade.php** - -Cari `