Platform komunitas Clash of Clans untuk berbagi dan mengelola base layout dengan sistem admin panel yang komprehensif menggunakan Laravel, Inertia.js, React, dan TypeScript.
- Dashboard Statistik Global: Overview total users, base layouts, views, dan likes
- User Management: Kelola semua user (view, detail, delete)
- Base Layout Management: Kelola semua base layout dari semua user
- Category & Tag Management: Kelola kategori dan tag untuk base layouts
- Personal Dashboard: Statistik pribadi (total layouts, views, likes)
- Base Layout CRUD: Create, Read, Update, Delete base layout milik sendiri
- Browse & Share: Lihat dan share base layouts ke komunitas
- Role-based Access Control: Admin dan General User dengan permissions berbeda
- Laravel Policies: Authorization untuk setiap aksi
- Email Verification: Verifikasi email untuk General User
- Secure Authentication: Laravel Breeze dengan Inertia.js
- Framework: Laravel 12
- Authentication: Laravel Breeze + Sanctum
- Database: MySQL/PostgreSQL
- API: RESTful API untuk mobile app (terpisah)
- Framework: React 18 with TypeScript
- UI Framework: Inertia.js (SSR)
- Component Library: Shadcn UI + Tailwind CSS 4
- Form Handling: React Hook Form + Zod Validation
- Icons: Lucide React
- State Management: Inertia.js (server-driven)
- Build Tool: Vite
- Type Checking: TypeScript
- Code Quality: Laravel Pint (PHP), ESLint (TypeScript)
- PHP >= 8.2
- Composer
- Node.js >= 18.x
- NPM or Yarn
- MySQL >= 8.0 atau PostgreSQL >= 13
git clone <repository-url>
cd csb# Install PHP dependencies
composer install
# Install Node dependencies
npm install# Copy environment file
cp .env.example .env
# Generate application key
php artisan key:generateEdit file .env dan sesuaikan dengan konfigurasi database Anda:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=csb_database
DB_USERNAME=root
DB_PASSWORD=# Run migrations and seed database with sample data
php artisan migrate:fresh --seedSeeder akan membuat:
- 1 Admin User
- 3 General Users
- Sample Categories & Tags
- Sample Base Layouts
# Development build with watch
npm run dev
# Production build
npm run build# Start Laravel development server
php artisan serve
# In another terminal, start Vite dev server
npm run devAplikasi akan berjalan di http://localhost:8000
- Email: admin@cocbases.com
- Password: password
- Email: john@example.com | Password: password
- Email: jane@example.com | Password: password
- Email: mike@example.com | Password: password
csb/
βββ app/
β βββ Enums/ # Enumerations (Role, Status)
β βββ Http/
β β βββ Controllers/
β β β βββ Web/ # Inertia Controllers
β β β β βββ Admin/ # Admin Controllers
β β β β βββ ... # User Controllers
β β β βββ ... # API Controllers
β β βββ Middleware/ # Custom Middleware (EnsureUserHasRole)
β β βββ Requests/ # Form Requests
β βββ Models/ # Eloquent Models
β βββ Policies/ # Authorization Policies
β βββ Services/ # Business Logic Services
βββ database/
β βββ migrations/ # Database Migrations
β βββ seeders/ # Database Seeders
βββ resources/
β βββ js/
β β βββ components/
β β β βββ ui/ # Shadcn UI Components
β β βββ Layouts/ # Page Layouts (AppLayout, AuthLayout)
β β βββ Pages/ # Inertia Pages
β β β βββ Admin/ # Admin Pages
β β β βββ User/ # General User Pages
β β β βββ Auth/ # Authentication Pages
β β β βββ ...
β β βββ types/ # TypeScript Type Definitions
β β βββ lib/ # Utility Functions
β βββ views/ # Blade Templates (minimal, for Inertia root)
βββ routes/
βββ web.php # Web Routes (Inertia)
βββ api.php # API Routes (untuk mobile app)
- admin: Full access ke semua fitur
- general_user: Akses terbatas ke fitur user
Menggunakan Laravel Policy:
viewAny: Semua user bisa melihat listview: Semua user bisa melihat detailcreate: Admin dan General Userupdate: Admin (semua) atau owner (milik sendiri)delete: Admin (semua) atau owner (milik sendiri)
viewAny: Hanya Adminview: Admin atau user itu sendiricreate: Hanya Adminupdate: Admin atau user itu sendiridelete: Hanya Admin (tidak bisa delete diri sendiri)
GET /admin/dashboard # Admin Dashboard
GET /admin/users # Users List
GET /admin/users/{id} # User Detail
DELETE /admin/users/{id} # Delete User
GET /admin/base-layouts # Base Layouts List
GET /admin/base-layouts/{id} # Base Layout Detail
DELETE /admin/base-layouts/{id} # Delete Base Layout
GET /admin/categories # Categories List
GET /admin/tags # Tags List
GET /dashboard # User Dashboard
GET /base-layouts # My Base Layouts
GET /base-layouts/create # Create Base Layout Form
GET /base-layouts/{id} # Base Layout Detail
POST /base-layouts # Store Base Layout (implement as needed)
PUT /base-layouts/{id} # Update Base Layout (implement as needed)
DELETE /base-layouts/{id} # Delete Base Layout (implement as needed)
GET /login # Login Page
POST /login # Login Action
POST /logout # Logout
GET /register # Register Page
POST /register # Register Action
GET /forgot-password # Forgot Password
POST /forgot-password # Send Reset Link
GET /reset-password/{token} # Reset Password Page
POST /reset-password # Reset Password Action
GET /verify-email # Email Verification Notice
GET /verify-email/{id}/{hash} # Verify Email
POST /email/verification-notification # Resend Verification
API tersedia di /api/v1/* untuk integrasi dengan mobile app. Dokumentasi API terpisah.
- Button
- Card
- Badge
- Table
- Form Components (Input, Label, etc.)
- Dialog/Modal
- Dropdown Menu
- Toast Notifications (dapat ditambahkan)
- AppLayout: Main layout dengan sidebar navigation
- AuthLayout: Layout untuk halaman authentication (dari Breeze)
# Terminal 1: Laravel server
php artisan serve
# Terminal 2: Vite dev server (hot reload)
npm run dev
# Terminal 3: Queue worker (optional)
php artisan queue:work
# Terminal 4: Log monitoring (optional)
php artisan pail# Build optimized assets
npm run build
# Optimize Laravel
php artisan config:cache
php artisan route:cache
php artisan view:cache# Run PHP tests
php artisan test
# Run with coverage
php artisan test --coverage- Complete CRUD operations for Base Layouts (general user)
- Implement file upload for base layout screenshots
- Add image optimization and storage
- Implement Categories and Tags CRUD
- Add search and filtering functionality
- Implement sorting and advanced filtering
- Add toast notifications untuk feedback
- Implement bulk actions (delete multiple)
- Add export functionality (CSV, PDF)
- Implement base layout rating system
- Add comments system untuk base layouts
- Create public Next.js app untuk SEO-friendly browsing
- Mobile app integration (React Native/Flutter)
- Advanced analytics dashboard
- Real-time notifications
- Social features (follow users, save favorites)
- Integration dengan Clash of Clans API
# Clear all caches
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
# Rebuild frontend
rm -rf node_modules
npm install
npm run build# Reset database
php artisan migrate:fresh --seedchmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cacheThis project is open-sourced software licensed under the MIT license.
Contributions are welcome! Please feel free to submit a Pull Request.
For support, email support@cocbases.com or join our Discord community.
Built with β€οΈ using Laravel, Inertia.js, React, and TypeScript