sowl/laravel-doctrine-jsonapi-skeleton
Composer 安装命令:
composer create-project sowl/laravel-doctrine-jsonapi-skeleton
包简介
The skeleton application for the Laravel Doctrine JSON:API.
README 文档
README
This skeleton provides a template for building API-only Laravel applications using Doctrine ORM and the laravel-doctrine-jsonapi package for fully compliant JSON:API implementations.
Key Features:
- Doctrine ORM: Replaces Eloquent as the database layer, leveraging Doctrine's advanced data-mapping capabilities via laravel-doctrine/orm.
- Doctrine Migrations: Database migrations using laravel-doctrine/migrations.
- Doctrine Extensions: Extra features (sluggable, timestamps, soft deletes, etc.) via laravel-doctrine/extensions.
- JSON:API: All APIs conform to the JSON:API specification for standardized, robust, and scalable APIs.
- API-Only: No web routes or traditional Blade views are exposed—this skeleton is focused exclusively on backend API development.
- Automatic API Documentation: Generates OpenAPI specs, Postman collections, and human-friendly docs using Scribe.
About This Skeleton
This project is intended as a starting point for developers who want to:
- Use Laravel as the application framework
- Use Doctrine ORM for data persistence (with full support for migrations and extensions)
- Expose only JSON:API-compliant endpoints (no web UI)
You get a clean Laravel installation, ready for Doctrine and JSON:API integration.
Quick Start
You can start a new project using this skeleton by running:
composer create-project sowl/laravel-doctrine-jsonapi-skeleton jsonapi
Main Packages
- laravel/laravel: Laravel framework
- laravel-doctrine/orm: Doctrine ORM integration for Laravel (docs)
- laravel-doctrine/migrations: Integration with Doctrine2's migrations package for Laravel
- laravel-doctrine/extensions: Doctrine extensions for Laravel (Gedmo, Beberlei, etc.)
- sowl/laravel-doctrine-jsonapi: JSON:API implementation for Laravel + Doctrine
- scribe: API documentation generator
TODO List
This is a high-level roadmap for fully implementing the skeleton:
- Remove default Laravel web routes and Blade views
- Install and configure Doctrine ORM (laravel-doctrine/orm)
- Publish and customize Doctrine config
- Configure environment variables for Doctrine
- Install and configure Doctrine Migrations (laravel-doctrine/migrations)
- Set up migration paths
- Install and configure Doctrine Extensions (laravel-doctrine/extensions)
- Install Gedmo extensions requirement
- Enable useful extensions (timestamps, sluggable, soft deletes, etc.)
- Set up basic
Userentity- Set up entity folder structure
- Setup authentication and all the relevant user traits
- Add migration of the
Userentity and rest default entities. - Tests for authentication logic
- Install and configure laravel-doctrine-jsonapi (sowl/laravel-doctrine-jsonapi)
- Publish and customize
jsonapi.phpconfig - Register resources in
config/jsonapi.php
- Publish and customize
- Create sample Doctrine entity implementing
ResourceInterface - Create a transformer extending
AbstractTransformer - Set up API routes (remove
web.php, useapi.phponly) - Add example resource controller (using default or custom controller)
- Add policy-based authorization for resources
- Add validation for JSON:API requests
- Implement authentication (e.g., Laravel Passport, Sanctum, or JWT)
- Integrate Scribe for automatic generation of OpenAPI specs and API docs
- Configure Scribe for API-only docs
- Ensure docs include OpenAPI spec, Postman collection, and sample responses
- Add custom docs for example resource
- Configure proper exception handling with showing JSON:API errors.
- Use GUID for the primary key of the entities.
- Implement extensive testing of this skeleton
- Make sure all features work as expected
- Add tests for queue-failed jobs
- Add tests for cache
- Add tests for authentication
- Add tests for authorization
- Add tests for validation
- Add tests for API endpoints
- Add tests for API docs
- Implement RBAC (Role-Based Access Control) authorization logic
- Define roles and permissions (e.g., Admin, User, Guest)
- Assign roles to users and restrict resource actions accordingly
- Add policies and middleware for RBAC enforcement
- Document RBAC usage and configuration
- Add detailed onboarding and contribution guide for new developers
- Document setup, coding standards, and contribution workflow
- Provide example PR and review process
- Add FAQ and troubleshooting section
- Build and document default
.windsurfrulesfor this repository- Describe commit, branch, and review policies
- Add rules for sensitive files, migrations, and API docs
- Ensure
.windsurfrulesis kept up to date with project conventions
- Add API rate limiting and throttling
- Configure Laravel's built-in rate limiting for API endpoints
- Add custom logic for user/role-based limits if needed
- Set up CI/CD for automated testing and code quality checks
- Set up GitHub Actions for CI/CD
- Set up GitHub Actions for code quality checks
- Move the scribe.blade.php to the base library.
References
- Laravel Doctrine ORM Documentation
- Doctrine ORM Documentation
- Doctrine Migrations Documentation
- Doctrine Extensions Documentation
- laravel-doctrine-jsonapi Documentation
- Scribe Documentation
- Scribe GitHub
- JSON:API Specification
License
This project is open-source and available under the MIT license.
sowl/laravel-doctrine-jsonapi-skeleton 适用场景与选型建议
sowl/laravel-doctrine-jsonapi-skeleton 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 05 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「orm」 「migrations」 「extensions」 「doctrine」 「acl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sowl/laravel-doctrine-jsonapi-skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sowl/laravel-doctrine-jsonapi-skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sowl/laravel-doctrine-jsonapi-skeleton 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Kinikit - PHP Application development framework MVC component
Symfony ClickhouseMigrationsBundle
Very simple SQL-based database migrations tool - a heavily stripped down fork of robmorgan/phinx
PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2
Laravel table comments loader (part of Diplodocker project)
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-02