Comprehensive development assistant for the SolidInvoice invoicing application, covering architecture, conventions, testing, and workflows.
Expert guide for developing, testing, and maintaining the SolidInvoice codebase—a sophisticated open-source invoicing application built with Symfony.
SolidInvoice is an enterprise-grade invoicing solution for small businesses and freelancers, featuring client management, quote/invoice generation, recurring billing, multi-gateway payment processing, and a RESTful API.
**Tech Stack:** PHP 8.4+, Symfony 7.1+, Doctrine ORM, API Platform, MySQL/PostgreSQL, Stimulus, Webpack Encore, Docker, FrankenPHP
The application uses a modular bundle architecture with clear separation of concerns:
**Business Logic:**
**Infrastructure:**
**UI & Presentation:**
```
BundleNameBundle/
├── Action/ # HTTP entry points (not Controllers)
├── Entity/ # Doctrine ORM entities
├── Form/ # Form types and handlers
├── Listener/ # Event listeners/subscribers
├── Manager/ # Complex business logic
├── Repository/ # Database queries
├── Resources/
│ ├── config/ # Routes, services
│ ├── translations/
│ └── views/ # Twig templates
└── Tests/
├── Functional/
└── Unit/
```
Entry points are single-purpose Action classes:
```php
// src/InvoiceBundle/Action/CreateAction.php
class CreateAction
{
public function __invoke(Request $request): Response
{
// Handle invoice creation
}
}
```
Use Symfony EventDispatcher for decoupling:
Symfony Workflow manages invoice states:
Common cross-cutting concerns:
Custom repositories for complex queries:
```php
class InvoiceRepository extends EntityRepository
{
public function findOverdueInvoices(): array
{
// Optimized query logic
}
}
```
```bash
git clone https://github.com/SolidInvoice/SolidInvoice.git
cd SolidInvoice
composer install
bun install
bun run dev # Development with watch
bun run build # Production build
bin/console doctrine:database:create
bin/console doctrine:migrations:migrate
```
**Frontend:**
```bash
bun run dev # Build with watch
bun run build # Production build
bun run lint:js # ESLint validation
bun run lint:css # StyleLint validation
```
**Backend:**
```bash
bin/console cache:clear # Clear cache
bin/console doctrine:migrations:migrate # Run migrations
bin/console doctrine:schema:validate # Validate schema
```
**Code Quality:**
```bash
bin/ecs check # Check coding standards
bin/ecs check --fix # Auto-fix standards
bin/phpstan analyse # Static analysis (Level 6)
bin/rector process --dry-run # Preview refactoring
bin/rector process # Apply refactoring
```
**Testing:**
```bash
bin/phpunit # Run all tests
bin/phpunit --coverage-html coverage # Generate coverage
bin/phpunit --filter testName # Run specific test
bin/phpunit src/InvoiceBundle/Tests # Test specific bundle
```
**1. Unit Tests**
```php
use Mockery as m;
class InvoiceManagerTest extends TestCase
{
public function testCreateInvoice(): void
{
$repository = m::mock(InvoiceRepository::class);
// Test logic
}
}
```
**2. Functional Tests**
**3. API Tests**
**Key PHPUnit Settings:**
**Fixtures:** Use Foundry for factory-based test data
```php
<?php
declare(strict_types=1);
/*
* This file is part of SolidInvoice project.
*
* (c) Pierre du Plessis <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
```
Configuration: `ecs.php`
Applied standards:
Configuration: `phpstan.neon`
Configuration: `rector.php`
Rules:
Before committing code:
1. ✅ Run `bin/ecs check --fix` - Fix coding standards
2. ✅ Run `bin/phpstan analyse` - Static analysis
3. ✅ Run `bin/phpunit` - All tests pass
4. ✅ Ensure proper file headers
5. ✅ Update documentation if needed
GitHub Actions runs on every PR:
1. **Unit Tests** - PHP 8.4/8.5, MySQL 8.0, coverage reporting
2. **Coding Standards** - ECS, Composer normalize, Super-Linter
3. **Static Analysis** - PHPStan Level 6, Qodana
4. **Security Checks** - Composer vulnerabilities, CodeQL
**Doctrine ORM 2.15+** with migrations
```bash
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
bin/console doctrine:schema:validate
```
**Entity Conventions:**
**API Platform 4.0+** for REST API
**Features:**
**Testing API endpoints:**
```php
class InvoiceApiTest extends ApiTestCase
{
public function testGetInvoice(): void
{
$this->createClient()->request('GET', '/api/invoices/1');
$this->assertResponseIsSuccessful();
$this->assertJsonContains(['@type' => 'Invoice']);
}
}
```
1. **FrankenPHP** (Recommended) - Single binary with PHP, web server, and app code
2. **Docker** - Official images on Docker Hub (`solidinvoice/solidinvoice`)
3. **Archive** - ZIP/TAR with pre-compiled assets
Use this skill when:
This skill provides comprehensive guidance on SolidInvoice's architecture, development workflow, testing strategy, and quality standards to ensure consistent, maintainable contributions.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/solidinvoice-development-assistant-wrwlia/raw