Download the PHP package mohamed-elgeady/artisan-architect without Composer
On this page you can find all versions of the php package mohamed-elgeady/artisan-architect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mohamed-elgeady/artisan-architect
More information about mohamed-elgeady/artisan-architect
Files in mohamed-elgeady/artisan-architect
Package artisan-architect
Short Description A powerful AST-based Laravel architecture analyser that detects design violations, calculates health scores, and integrates with CI/CD pipelines.
License MIT
Homepage https://github.com/Mohamed20a/artisan-architect
Informations about the package artisan-architect
🏗️ Artisan Architect
A powerful AST-based Laravel architecture analyzer that detects design violations, calculates health scores, generates visual reports, and integrates seamlessly with your CI/CD pipeline.
📖 Table of Contents
- Introduction
- Features
- Requirements
- Installation
- Available Commands
- Example Output
- Generating Reports
- Generating Architecture Graphs
- CI/CD Integration
- Laravel Modules & DDD Support
- Configuration Reference
- Contributing
- License
🚀 Introduction
Artisan Architect is a zero-runtime, static code analysis package built specifically for the Laravel ecosystem. It leverages PHP's Abstract Syntax Tree (AST) via nikic/php-parser to deeply inspect your application's source code without executing a single line of it.
It scans your Controllers, Models, Form Requests, API Resources, and Routes, evaluates them against a configurable set of architectural rules, assigns a health score (0–100) to each class, and aggregates a project-wide score with a full breakdown of violations.
Think of it as a code reviewer that never sleeps — integrated directly into your Artisan command suite.
✨ Features
| Feature | Description |
|---|---|
| 🧠 AST-Powered Analysis | Deep, accurate inspection of PHP source files — no runtime needed |
| 📊 Health Scoring | Every class gets a score (0–100). The overall project score is always visible |
| ❌ Violation Detection | Detects Fat Controllers, Direct DB Calls, Missing $fillable, Bloated Models, Closure Routes, and more |
| 🎨 Beautiful Console Output | Rich, color-coded, icon-decorated terminal output with detailed summaries |
| 🌐 HTML Reports | Stunning dark-mode HTML reports with Tailwind CSS glassmorphism design |
| 🗃️ JSON Reports | Machine-readable JSON reports for use with custom dashboards or APIs |
| 🔗 Dependency Graphs | Auto-generates interactive Mermaid.js class diagrams showing class relationships |
| 🧩 Module Support | Native wildcard (*) glob support for nwidart/laravel-modules and DDD structures |
| 🤖 CI/CD Ready | --min-score and --fail-on flags for enforcing quality gates in pipelines |
| 🎯 Targeted Analysis | Analyze the entire project, a specific directory, or a single file |
| 🔧 Fully Configurable | Tune every rule threshold (max methods, max lines, penalties, etc.) in the config |
| 🗂️ Safe Storage | All generated reports are safely stored in storage/artisan-architect/ (not in public/) |
🔧 Requirements
| Dependency | Version |
|---|---|
| PHP | ^8.2 or ^8.3 |
| Laravel | ^10.0 / ^11.0 / ^12.0 / ^13.0 |
| nikic/php-parser | ^5.0 |
The package should be installed as a dev dependency (
--dev), as it is a developer tool and should not run in production.
📦 Installation
Step 1 — Install via Composer:
Step 2 — Publish the configuration file:
This will create config/artisan-architect.php in your application where you can configure paths, rules, scoring weights, and output settings.
🛠️ Available Commands
architect:analyze — Project Architecture Analysis
architect:graph — Interactive Architecture Graph
📸 Example Output
Console Analysis (architect:analyze)
HTML Report (--format=html)
The HTML report is a beautiful dark-mode, interactive dashboard with glassmorphism UI. It displays:
- Overall score with color-coded rating
- Per-class health cards with all violations listed
- File paths, line counts, and metrics
Saved automatically to storage/artisan-architect/reports/architecture.html.
Architecture Graph (architect:graph)
Open the file in your browser to see an interactive Mermaid.js class diagram showing all class dependencies in your project. The graph is rendered client-side in dark mode with full SVG quality.
🤖 CI/CD Integration
Add Artisan Architect to your GitHub Actions workflow to enforce architectural quality on every pull request:
If the overall project score drops below 80 or any critical errors are found, the workflow will fail and block the merge. 🚫
🧩 Laravel Modules & DDD Support
Working with nwidart/laravel-modules or a Domain-Driven Design structure? Artisan Architect has native wildcard support.
Open config/artisan-architect.php and add your module paths alongside the standard paths:
The * wildcard will automatically expand to match every module directory under Modules/, giving you a single unified report for your entire application. ✅
⚙️ Configuration Reference
The published config file gives you full control over the analyzer's behavior:
🤝 Contributing
Contributions are welcome and appreciated! If you have an idea for a new architectural rule or a feature:
- Fork the repository.
- Create your feature branch:
git checkout -b feature/my-new-rule. - Implement your rule inside
src/Rules/. - Add a test inside
tests/. - Submit a Pull Request.
🛡️ Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
📄 License
The MIT License (MIT). Please see License File for more information.
Built with ❤️ for the Laravel Community by Mohamed Elgeady
All versions of artisan-architect with dependencies
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0
nikic/php-parser Version ^5.0