First off, thank you for considering contributing to Inventoros! It's people like you that make Inventoros such a great tool for the community.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed and what you expected
- Include screenshots if relevant
- Include your environment details (OS, PHP version, Laravel version, etc.)
**Description**
A clear and concise description of the bug.
**Steps to Reproduce**
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
**Expected Behavior**
What you expected to happen.
**Actual Behavior**
What actually happened.
**Environment**
- OS: [e.g., macOS 13.0]
- PHP Version: [e.g., 8.2.10]
- Laravel Version: [e.g., 12.0]
- Database: [e.g., MySQL 8.0.33]
**Additional Context**
Any other information about the problem.Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful
- List any similar features in other systems (if applicable)
We actively welcome your pull requests! Here's the process:
- Fork the repository and create your branch from
main - Make your changes following our coding standards
- Add tests if you've added functionality
- Update documentation if you've changed APIs or added features
- Ensure the test suite passes (
composer test) - Run code formatting (
./vendor/bin/pint) - Write a clear commit message
- Submit your pull request
- PHP 8.2 or higher
- Composer
- Node.js 18+ and npm
- MySQL 8.0+ or PostgreSQL 13+
- Git
# Fork and clone the repository
git clone https://github.com/inventoros/inventoros.git
cd inventoros
# Install dependencies
composer install
npm install
# Set up environment
cp .env.example .env
php artisan key:generate
# Configure your database in .env, then migrate
php artisan migrate
# Run the development server
composer dev# Run all tests
composer test
# Run specific test types
php artisan test --testsuite=Feature
php artisan test --testsuite=Unit
# Run with coverage (requires xdebug)
php artisan test --coverageWe use Laravel Pint for code formatting:
# Format all code
./vendor/bin/pint
# Check formatting without changes
./vendor/bin/pint --test- Follow PSR-12 coding standards
- Use type hints for parameters and return types
- Write descriptive variable and function names
- Add PHPDoc blocks for classes and complex methods
- Keep methods focused and single-purpose
<?php
namespace App\Services;
use App\Models\Product;
use App\Exceptions\InsufficientStockException;
class InventoryService
{
/**
* Reduce stock quantity for a product.
*
* @throws InsufficientStockException
*/
public function reduceStock(Product $product, int $quantity): void
{
if ($product->stock < $quantity) {
throw new InsufficientStockException(
"Insufficient stock for product: {$product->name}"
);
}
$product->decrement('stock', $quantity);
}
}- Use ES6+ syntax
- Follow Vue 3 Composition API patterns
- Use TypeScript for type safety (when applicable)
- Keep components small and focused
- Use meaningful component and variable names
<script setup>
import { ref, computed } from 'vue'
const props = defineProps({
product: {
type: Object,
required: true
}
})
const quantity = ref(0)
const isInStock = computed(() => {
return props.product.stock > 0
})
const handleAddToCart = () => {
// Implementation
}
</script>
<template>
<div class="product-card">
<h3>{{ product.name }}</h3>
<p v-if="isInStock">In Stock: {{ product.stock }}</p>
<p v-else class="text-red-500">Out of Stock</p>
</div>
</template>- Use migrations for all schema changes
- Write descriptive migration names:
create_products_table,add_sku_to_products_table - Add foreign key constraints where appropriate
- Index columns used in WHERE clauses or joins
- Use factories for test data
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->string('sku')->unique();
$table->string('name');
$table->text('description')->nullable();
$table->integer('stock')->default(0);
$table->decimal('price', 10, 2);
$table->foreignId('category_id')
->nullable()
->constrained()
->nullOnDelete();
$table->timestamps();
$table->softDeletes();
$table->index('sku');
$table->index('category_id');
});
}
public function down(): void
{
Schema::dropIfExists('products');
}
};- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
feat: add barcode scanning support
- Implement barcode scanner integration
- Add barcode field to products table
- Create barcode validation service
Closes #123
feat:New featurefix:Bug fixdocs:Documentation only changesstyle:Code style changes (formatting, semicolons, etc.)refactor:Code refactoringperf:Performance improvementstest:Adding or updating testschore:Maintenance tasks, dependency updates
- Write tests for all new features
- Maintain or improve code coverage
- Use descriptive test method names
- Follow the Arrange-Act-Assert pattern
- Mock external dependencies
<?php
namespace Tests\Feature;
use App\Models\Product;
use App\Models\User;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ProductManagementTest extends TestCase
{
use RefreshDatabase;
public function test_user_can_create_product(): void
{
// Arrange
$user = User::factory()->create();
$productData = [
'sku' => 'TEST-001',
'name' => 'Test Product',
'price' => 99.99,
'stock' => 10,
];
// Act
$response = $this->actingAs($user)
->post('/api/products', $productData);
// Assert
$response->assertStatus(201);
$this->assertDatabaseHas('products', [
'sku' => 'TEST-001',
'name' => 'Test Product',
]);
}
}- Update README.md if you change functionality
- Document all public APIs and methods
- Add inline comments for complex logic
- Update CHANGELOG.md following Keep a Changelog format
- Create or update relevant docs in the
/docsdirectory
If you're developing a plugin for Inventoros:
- Follow the plugin API conventions (documentation coming soon)
- Include a
plugin.jsonmanifest file - Provide clear installation instructions
- Write tests for your plugin
- Document configuration options
Don't hesitate to ask questions! You can:
- Open an issue with the "question" label
- Start a discussion in GitHub Discussions
- Reach out to the maintainers
Contributors will be recognized in:
- The project README
- Release notes for significant contributions
- Our community acknowledgments
Thank you for contributing to Inventoros!