承接 gesmuni/slim-skeleton 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gesmuni/slim-skeleton

最新稳定版本:1.1.0

Composer 安装命令:

composer create-project gesmuni/slim-skeleton

包简介

Gesmuni starter template with authentication and audit logging ready to use

README 文档

README

A starter template for building Gesmuni applications with Laravel. Includes authentication (gesmuni/laravel-auth-local) and audit logging (gesmuni/laravel-audit-db) ready to use out of the box.

Demo Dashboard

Quick Start

Using Composer Create-Project

composer create-project gesmuni/slim-skeleton my-app
cd my-app
php artisan serve

The create-project command will automatically:

  1. Install dependencies
  2. Create .env from .env.example
  3. Generate application key
  4. Create SQLite database
  5. Run migrations (auth + audit tables)
  6. Seed the auth system and a demo user

Using Docker Compose

docker compose up -d

The container will automatically install dependencies, configure the database, run migrations, and seed the demo user.

To view logs:

docker compose logs -f

To stop:

docker compose down

Using the Setup Script

git clone <repository-url> my-app
cd my-app
bash setup.sh
php artisan serve

Access the Application

Visit http://localhost:8000 and log in with:

  • Email: demo@example.com
  • Password: password

What's Included

Authentication (gesmuni/laravel-auth-local)

  • Session-based login/logout
  • Middleware-protected routes
  • User, role, and permission management via AuthQuery/AuthAdmin services

Audit Logging (gesmuni/laravel-audit-db)

  • Automatic audit events on login (success/failure) and logout
  • Database-backed audit event store with integrity verification
  • Artisan commands for verification and purging:
# Verify integrity of recent events
php artisan gesmuni:audit:verify

# Verify a specific date range
php artisan gesmuni:audit:verify --from=2026-01-01 --to=2026-01-31

# Purge expired events (based on retention policy)
php artisan gesmuni:audit:purge

Dashboard

The default dashboard shows:

  • Authenticated user information (name, email, status)
  • Assigned roles and permissions
  • Recent audit events with 5W details (Who, What, When, Where, Why)

Project Structure

├── app/Http/Controllers/
│   ├── AuthController.php          # Login/logout with audit events
│   └── DashboardController.php     # User info + audit log dashboard
├── app/Http/Middleware/
│   └── Authenticate.php            # Session-based authentication
├── config/
│   ├── app.php                     # Service providers (auth + audit)
│   ├── audit.php                   # Audit retention configuration
│   └── ...                         # Standard Laravel configs
├── database/seeders/
│   └── DemoUserSeeder.php          # Creates demo@example.com user
├── resources/views/
│   ├── layout.blade.php            # Base layout
│   ├── login.blade.php             # Login form
│   └── dashboard.blade.php         # Dashboard with auth + audit info
├── routes/
│   └── web.php                     # Auth and dashboard routes
├── setup.sh                        # Alternative setup script
└── composer.json                   # Dependencies and post-create scripts

Configuration

Audit Retention

Edit config/audit.php to change the retention period:

return [
    'retention_days' => 365, // default: 1 year
];

Database

The skeleton defaults to SQLite. To use MySQL or PostgreSQL, update .env:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=my_app
DB_USERNAME=root
DB_PASSWORD=

Then run migrations:

php artisan migrate --force

Adding Audit Events

To emit audit events from your application code:

use Gesmuni\Audit\Contracts\AuditEventSink;
use Gesmuni\Audit\Entities\AuditEvent;
use Gesmuni\Audit\ValueObjects\Action;
use Gesmuni\Audit\ValueObjects\Actor;
use Gesmuni\Audit\ValueObjects\Source;
use Ramsey\Uuid\Uuid;

class MyController
{
    public function __construct(
        private readonly AuditEventSink $auditSink,
    ) {}

    public function doSomething(Request $request)
    {
        // ... your logic ...

        $event = new AuditEvent(
            id: Uuid::uuid4()->toString(),
            actor: new Actor($userId, 'HUMAN', $userName),
            action: new Action('create', 'order', $orderId, 'SUCCESS'),
            occurredAt: new \DateTimeImmutable('now', new \DateTimeZone('UTC')),
            source: new Source('web-app', $request->ip()),
        );

        $this->auditSink->receive($event);
    }
}

License

AGPL-3.0-or-later

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-or-later
  • 更新时间: 2026-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固