Admin Dashboard Guide - luckydeva03/barbershop_app GitHub Wiki
👥 Admin Dashboard Guide
Panduan lengkap penggunaan dashboard admin untuk mengelola sistem barbershop.
🔐 Admin Login
Akses Admin Panel
- URL:
http://your-domain.com/admin
- Default Credentials:
- Email:
[email protected]
- Password:
password123
- Email:
⚠️ Penting: Segera ganti password default setelah login pertama!
📊 Dashboard Overview
/admin
)
Main Dashboard (Dashboard utama menampilkan overview sistem dengan metrics real-time:
📈 Analytics Cards
- Total Users: Jumlah customer terdaftar
- Total Points Distributed: Total poin yang telah dibagikan
- Active Codes: Jumlah kode redeem yang masih aktif
- Total Reviews: Jumlah review dari customer
📊 Charts & Graphs
- User Registration Trend: Grafik pendaftaran user per bulan
- Point Distribution: Grafik distribusi poin per kategori
- Review Ratings: Chart rating review 1-5 bintang
- Store Performance: Ranking performa toko berdasarkan review
🔔 Quick Actions
- Create New Code: Buat kode redeem baru
- View Recent Users: Lihat user yang baru mendaftar
- Export Reports: Download laporan dalam format Excel/PDF
- System Health Check: Status kesehatan sistem
👥 User Management
/admin/users
)
User List (Mengelola semua customer yang terdaftar di sistem.
Features:
- Search & Filter: Cari user berdasarkan nama, email, atau phone
- Sort Options: Urutkan berdasarkan tanggal daftar, total poin, dll
- Bulk Actions: Aksi massal untuk multiple users
- Export Data: Export data user ke Excel/CSV
User Actions:
View Profile → Detail lengkap user + history
Edit User → Update info personal
Deactivate → Soft delete user
Add/Remove Points → Manual adjustment poin
View History → Riwayat transaksi poin user
User Detail Page
- Personal Information: Nama, email, phone, foto profil
- Account Statistics: Total poin, jumlah redeem, review count
- Point History: Tabel riwayat earning/spending poin
- Review History: Semua review yang pernah ditulis user
- Activity Log: Log aktivitas user di sistem
Point Management
// Add points to user
POST /admin/users/{id}/points/add
{
"points": 100,
"description": "Bonus ulang tahun"
}
// Deduct points from user
POST /admin/users/{id}/points/deduct
{
"points": 50,
"description": "Penalti abuse system"
}
🎫 Code Management
/admin/codes
)
Redeem Code List (Mengelola semua kode redeem/promo.
Create New Code
Form untuk membuat kode redeem baru:
Code → WELCOME50 (unique, uppercase)
Points Value → 50 (positive integer)
Description → "Welcome bonus untuk member baru"
Expires At → 2024-12-31 23:59:59
Max Uses → 100 (batas penggunaan)
Status → Active/Inactive
Code List Features:
- Status Filter: All, Active, Expired, Inactive
- Search: Cari berdasarkan kode atau deskripsi
- Usage Tracking: Monitor berapa kali sudah digunakan
- Quick Actions: Activate/Deactivate, Edit, Delete
Code Analytics:
- Usage Statistics: Grafik penggunaan kode per hari
- Popular Codes: Kode yang paling sering digunakan
- Conversion Rate: Persentase kode yang berhasil di-redeem
- Revenue Impact: Estimasi value dari point distribution
Code Types & Examples:
Welcome Bonus → WELCOME50 (50 points, new users)
Monthly Promo → MARCH2024 (100 points, limited time)
Loyalty Reward → LOYAL200 (200 points, VIP members)
Event Special → NEWYEAR (150 points, holiday)
Referral Bonus → REF25 (25 points, referral program)
🏪 Store Management
Store Overview
Mengelola data toko/barbershop dalam sistem.
⚠️ Note: Berdasarkan dokumentasi, store management dilakukan via kode/seeder, bukan UI admin.
Store Data Management:
// Via Seeder (database/seeders/StoreSeeder.php)
$stores = [
[
'name' => 'Barbershop Central',
'description' => 'Premium barbershop di pusat kota',
'address' => 'Jl. Sudirman No. 123, Jakarta',
'phone' => '021-1234567',
'latitude' => -6.2088,
'longitude' => 106.8456,
'image_url' => 'https://example.com/store1.jpg'
]
];
Via Tinker (Manual):
php artisan tinker
App\Models\Store::create([
'name' => 'Barbershop New',
'description' => 'Barbershop modern dengan layanan premium',
'address' => 'Jl. Gatot Subroto No. 456, Jakarta',
'phone' => '021-7654321',
'latitude' => -6.2297,
'longitude' => 106.8401
]);
Store Analytics:
- Review Summary: Average rating dan total review per store
- Popular Stores: Ranking berdasarkan jumlah review
- Geographic Distribution: Peta sebaran store
- Performance Metrics: Engagement rate per store
⭐ Review Management
/admin/reviews
)
Review Overview (Monitor dan moderasi semua review customer.
Review List Features:
- Filter by Rating: 1-5 stars
- Filter by Store: Lihat review per toko
- Sort Options: Terbaru, rating tertinggi, dll
- Moderation: Approve/reject review jika diperlukan
Review Analytics:
- Average Rating: Rating rata-rata semua store
- Rating Distribution: Chart distribusi rating 1-5
- Review Trends: Grafik jumlah review per bulan
- Top Reviewers: User yang paling aktif review
Review Actions:
View Detail → Baca full review + user info
Edit Review → Moderate inappropriate content
Delete Review → Remove spam/inappropriate review
Reply Review → Respond as store owner (future feature)
📊 Analytics & Reports
Dashboard Analytics
Berbagai metric dan insight bisnis.
Key Performance Indicators (KPIs):
- User Growth Rate: Pertumbuhan user per bulan
- Point Redemption Rate: Persentase user yang redeem points
- Average Points per User: Rata-rata poin yang dimiliki user
- Store Rating Average: Rating rata-rata semua store
- Review Engagement: Persentase user yang menulis review
Report Generation:
User Report → Excel/PDF export user data
Point Activity → History semua transaksi poin
Code Usage Report → Analisis penggunaan kode redeem
Store Performance → Laporan performa per store
Monthly Summary → Ringkasan bulanan semua metrics
Custom Analytics Queries:
// Top users by points
$topUsers = User::withSum('historyPoints', 'points')
->orderBy('history_points_sum_points', 'desc')
->limit(10)
->get();
// Most used codes
$popularCodes = ReedemCode::orderBy('used_count', 'desc')
->limit(10)
->get();
// Store rankings
$topStores = Store::withAvg('reviews', 'rating')
->withCount('reviews')
->orderBy('reviews_avg_rating', 'desc')
->get();
🔧 System Configuration
Settings Management
Konfigurasi sistem melalui file .env
dan config files.
Key Configuration Options:
# Point System Settings
POINTS_EXPIRY_DAYS=365
MAX_POINTS_PER_CODE=1000
MIN_POINTS_PER_CODE=10
# Code Settings
CODE_LENGTH=8
CODE_PREFIX="BB"
MAX_CODE_USES=1000
# Review Settings
MAX_REVIEW_LENGTH=1000
REQUIRE_REVIEW_APPROVAL=false
Rate Limiting Configuration:
// app/Http/Kernel.php
'admin' => [
'throttle:120,1', // 120 requests per minute
],
'redeem' => [
'throttle:3,10', // 3 redeem attempts per 10 minutes
],
🛡️ Security Features
Admin Security
- Rate Limiting: Proteksi brute force attack
- CSRF Protection: Semua form protected
- Input Validation: Validasi semua input admin
- Audit Logging: Log semua aktivitas admin
- Session Security: Secure session management
Security Best Practices:
- Change Default Password: Ganti password default
- Enable 2FA: Setup two-factor authentication (future)
- Regular Backup: Backup database secara rutin
- Monitor Logs: Review activity logs regularly
- Update Dependencies: Keep Laravel & packages updated
Security Monitoring:
// Log admin activities
Log::info('Admin action', [
'admin_id' => auth('admin')->id(),
'action' => 'create_code',
'target' => $code->code,
'ip' => request()->ip(),
'user_agent' => request()->userAgent()
]);
📱 Mobile Responsive Design
Admin Panel Mobile Features:
- Responsive Tables: Horizontal scroll untuk table besar
- Touch-Friendly UI: Button dan form dioptimasi untuk touch
- Quick Actions: Action buttons mudah diakses di mobile
- Simplified Navigation: Menu burger untuk mobile
Mobile Dashboard:
- Card Layout: Info cards distack vertical di mobile
- Simplified Charts: Chart responsif di berbagai ukuran layar
- Touch Gestures: Swipe navigation untuk tab/section
🚀 Advanced Features
Bulk Operations:
// Bulk activate codes
ReedemCode::whereIn('id', $selectedIds)
->update(['is_active' => true]);
// Bulk export users
Excel::download(new UsersExport($filters), 'users.xlsx');
// Bulk point adjustment
foreach ($selectedUsers as $userId) {
HistoryPoint::create([
'user_id' => $userId,
'points' => $pointAdjustment,
'type' => 'bonus',
'description' => 'Bulk adjustment by admin'
]);
}
API Integration:
// Admin API endpoints (future feature)
GET /api/admin/dashboard/stats
GET /api/admin/users?page=1&search=john
POST /api/admin/codes
PUT /api/admin/codes/{id}
DELETE /api/admin/codes/{id}
📞 Support & Troubleshooting
Common Admin Issues:
Login Problems:
# Reset admin password
php artisan tinker
$admin = App\Models\Admin::where('email', '[email protected]')->first();
$admin->password = Hash::make('newpassword123');
$admin->save();
Permission Issues:
# Fix storage permissions
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache
Performance Issues:
# Clear caches
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
# Optimize for production
php artisan config:cache
php artisan route:cache
php artisan view:cache
Getting Help:
- Error Logs: Check
storage/logs/laravel.log
- Debug Mode: Set
APP_DEBUG=true
untuk development - Troubleshooting Guide: Troubleshooting
- Create Issue: GitHub Issues
Next Guide: Customer Portal Guide untuk panduan customer portal.