From 35cc3d0f2c29e6edb17479d093dc4dd5376938d8 Mon Sep 17 00:00:00 2001 From: idevakk <219866223+idevakk@users.noreply.github.com> Date: Mon, 29 Sep 2025 13:43:14 +0530 Subject: [PATCH] chore(docs): update README.md --- README.md | 233 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 212 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index adc6825..1655b5c 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,233 @@ -# πŸ“© iSMS - Temporary SMS Receiver +# πŸš€ Laravel Filament Admin Starter Kit -A Laravel-based web application that allows users to receive SMS messages online via temporary phone numbers. Useful for testing or anonymous verification. +A pre-configured **Laravel Admin Panel Starter Kit** built with [Livewire Starter Kit](https://github.com/laravel-livewire/starter-kit) and powered by [FilamentPHP](https://filamentphp.com/). + +Ideal for developers who want to skip boilerplate setup and jump straight into building robust admin dashboards, with essential tools and permissions already in place. --- -## πŸš€ Features +## ⚑ Features at a Glance -* πŸ“± Temporary phone numbers (dynamic or pre-defined) -* πŸ“¨ Real-time SMS receiving and display -* πŸ›  Admin panel for managing numbers and messages -* πŸ”’ Basic spam protection and rate limiting -* πŸ“Š Logs and analytics (optional) +* βœ… Livewire Starter Kit foundation +* βœ… Elegant UI with **FilamentPHP** +* βœ… Filament Panel configurable via `.env` +* βœ… Roles & Permissions (Spatie) +* βœ… Activity Logging +* βœ… Mail & Log Viewer +* βœ… Code quality with **RectorPHP** +* βœ… Authentication with default seeded admin --- -## 🧰 Tech Stack +## πŸ“‚ Admin Panel Access -* **Framework:** Laravel 12+ -* **Database:** MySQL -* **Frontend:** Blade / Tailwind CSS -* **Real-time:** Laravel Echo + Pusher (optional) -* **Queue:** Redis / Database queues +* **Panel ID:** `dash` +* **Admin Route:** `/dash` (configurable) +* **Default Admin Credentials:** + +| Email | Password | +| ------------------- | ---------- | +| `admin@example.com` | `password` | + +> ⚠️ **Change these credentials before deploying to production.** --- -## πŸ” Security Notes +## βš™οΈ Environment Configuration -* Do not use this in production without proper rate-limiting & abuse prevention. -* Use HTTPS and secure access to the admin panel. +All major features are easily configurable using environment variables: + +```env +# Filament Admin Panel +FILAMENT_ROUTE=dash +FILAMENT_ENABLE_LOGIN=true +FILAMENT_ENABLE_REGISTER=false +FILAMENT_ENABLE_PROFILE=false + +# Activity Logger +ACTIVITY_LOGGER_ENABLED=true +ACTIVITY_LOGGER_TABLE_NAME=activity_log + +# Log Viewer +FILAMENT_LOG_VIEWER_DRIVER=raw +``` --- -## πŸ“„ License +## 🎨 Filament Panel Configuration -This project is open-source under the [MIT License](LICENSE). +The Filament admin panel's appearance and basic behaviors are defined in `config/filament-php.php`: + +```php + env('FILAMENT_ROUTE', 'dash'), + + 'colors' => [ + 'primary' => Color::Teal, + 'danger' => Color::Red, + 'gray' => Color::Zinc, + 'info' => Color::Blue, + 'success' => Color::Green, + 'warning' => Color::Amber, + ], + + 'enable_login' => env('FILAMENT_ENABLE_LOGIN', true), + 'enable_registration'=> env('FILAMENT_ENABLE_REGISTER', false), + 'enable_profile' => env('FILAMENT_ENABLE_PROFILE', false), +]; +``` + +You can easily override the route, theming colors, and feature toggles via `.env`. --- -## πŸ‘¨β€πŸ’» Contributing +## πŸ” Roles & Permissions -Feel free to fork the repo and submit PRs. Bug reports and feature suggestions are welcome! +This starter kit uses [Spatie Laravel Permission](https://spatie.be/docs/laravel-permission) with the following default setup: + +### πŸ‘€ Roles + +* `admin` – Full control, including access to logs and mails +* `user` – No permissions assigned by default + +### πŸ”‘ Permissions + +The `admin` role is granted the following permissions: + +* `manage mails` +* `manage panels` + +These are assigned in the `RoleSeeder` class: + +```php +class RoleSeeder extends Seeder +{ + public function run(): void + { + $role = Role::findOrCreate(name: 'admin', guardName: 'web'); + Role::findOrCreate(name: 'user', guardName: 'web'); + + $permissionManageMails = Permission::findOrCreate(name: 'manage mails', guardName: 'web'); + $role->givePermissionTo($permissionManageMails); + + $permissionManageFilamentPanel = Permission::findOrCreate(name: 'manage panels', guardName: 'web'); + $role->givePermissionTo($permissionManageFilamentPanel); + } +} +``` + +> βœ… You can expand this by adding more roles and permissions via the Filament UI or custom seeders. + +--- + +## πŸ“¨ Mail Viewer + +View all outgoing mail inside the Filament admin panel β€” ideal for local and staging environments. + +--- + +## πŸͺ΅ Log Viewer + +Filament Log Viewer is pre-configured to use the `raw` driver: + +```env +FILAMENT_LOG_VIEWER_DRIVER=raw +``` + +View and analyze application logs from the admin panel. +For advanced configuration, see the [Log Viewer docs](https://github.com/ryangjchandler/filament-log). + +--- + +## πŸ•΅οΈ Activity Logger + +Tracks user actions and stores them in the `activity_log` table (or custom name via `.env`): + +```env +ACTIVITY_LOGGER_ENABLED=true +ACTIVITY_LOGGER_TABLE_NAME=activity_log +``` + +More configuration options available in [Spatie’s documentation](https://spatie.be/docs/laravel-activitylog). + +--- + +## 🧼 Automated Refactoring with Rector + +The root of the project includes a pre-configured `rector.php` file. +This allows for auto-refactoring and upgrading code to Laravel best practices. + +### βž• Run Rector: + +```bash +vendor/bin/rector +``` + +--- + +## πŸš€ Installation + +```bash +git clone https://github.com/your-org/admin-starter-kit.git your-project +cd your-project + +composer install +cp .env.example .env +php artisan key:generate +``` + +Update your `.env` with database and mail configuration: + +```bash +php artisan migrate --seed +npm install && npm run dev +php artisan serve +``` + +Visit: [http://localhost:8000/dash](http://localhost:8000/dash) (or your configured route) + +--- + +## πŸ“ Key Structure + +``` +β”œβ”€β”€ config/ +β”‚ β”œβ”€β”€ filament.php # Filament core settings +β”‚ β”œβ”€β”€ filament-php.php # UI theming + custom toggles +β”‚ β”œβ”€β”€ activitylog.php # Activity log config +β”œβ”€β”€ database/ +β”‚ └── seeders/FilamentAdminSeeder.php +β”‚ └── seeders/RoleSeeder.php +β”œβ”€β”€ rector.php # Rector config +``` + +--- + +## 🀝 Contributing + +Contributions are welcome. Feel free to fork, submit issues or create pull requests. + +--- + +## πŸ›‘ License + +Open-sourced under the [MIT license](LICENSE). + +--- + +## πŸ™ Credits + +* [Laravel](https://laravel.com) +* [Livewire Starter Kit](https://github.com/laravel-livewire/starter-kit) +* [FilamentPHP](https://filamentphp.com/) +* [Spatie Permissions](https://github.com/spatie/laravel-permission) +* [Spatie Activity Log](https://spatie.be/docs/laravel-activitylog) +* [Filament Log Viewer](https://github.com/ryangjchandler/filament-log) +* [Filament Mail Viewer](https://github.com/ryangjchandler/filament-mail) +* [RectorPHP](https://getrector.com) + +---