CT-Pifacia is a Coding Test project from Pifacia that I took as a study case to demonstrate modern web development skills. This comprehensive Inventory Management System is built with Laravel 12 and cutting-edge web technologies, showcasing best practices in PHP development, database design, and modern frontend implementation.
This project serves as a practical demonstration of:
- Modern Laravel Development: Utilizing Laravel 12 with latest PHP 8.2+ features
- Full-Stack Development Skills: From backend API to responsive frontend
- Enterprise-Level Architecture: Implementing patterns suitable for production applications
- Code Quality Standards: Following PSR-12, testing with Pest PHP, and comprehensive documentation
- Security Best Practices: Role-based permissions, audit logging, and secure authentication
The application provides a robust solution for managing items, categories, and users with advanced features like role-based permissions, audit logging, file attachments, and data import/export capabilities.
- π¦ Item Management: Complete CRUD operations for inventory items
- π·οΈ Category Management: Organize items with hierarchical categories
- π₯ User Management: Comprehensive user administration with role-based access
- π Authentication & Authorization: Laravel Jetstream with role-based permissions
- π Audit Logging: Track all changes and user activities
- π€ Import/Export: Excel-based data import and export functionality
- ποΈ File Attachments: Media library integration for item attachments
- ποΈ Soft Delete: Safe deletion with restore capabilities
- π± Responsive Design: Modern UI with Tailwind CSS and Livewire
- β‘ Real-time Updates: Live interface updates with Livewire
This project was originally developed as a coding test from Pifacia and has been taken as a comprehensive study case to demonstrate:
- Complex Database Relationships: UUID-based models with proper foreign key constraints
- Advanced Authentication: Multi-role system with granular permissions
- File Management: Secure file uploads with media library integration
- Data Processing: Excel import/export with validation and error handling
- Performance Optimization: Efficient queries, caching, and queue processing
- Testing Strategy: Comprehensive test suite using modern Pest PHP framework
- Laravel 12 Mastery: Latest framework features and best practices
- Modern PHP Development: PHP 8.2+ features, typing, and standards
- Frontend Integration: Livewire for reactive interfaces without complex JavaScript
- Security Implementation: Authentication, authorization, and data protection
- DevOps Practices: Development workflows, testing, and deployment strategies
- Full-stack web development
- Database design and optimization
- API development and documentation
- Modern UI/UX implementation
- Code quality and testing
- Technical documentation
- Git workflow and version control
- Laravel 12.x - Modern PHP framework
- PHP 8.2+ - Latest PHP features
- SQLite/MySQL - Database support
- Laravel Jetstream - Authentication scaffolding
- Laravel Sanctum - API authentication
- Livewire 3.x - Dynamic frontend components
- Tailwind CSS 3.x - Utility-first CSS framework
- Blade Components - Reusable UI components
- Heroicons - Beautiful SVG icons
- Vite - Fast build tool and dev server
- Spatie Laravel Permission - Role and permission management
- Laravel Auditing - Model change tracking
- Spatie Media Library - File upload and management
- Maatwebsite Excel - Import/export functionality
- Laravel Horizon - Queue monitoring (dev)
- Pest PHP - Modern testing framework
- PHP: 8.2 or higher
- Composer: Latest version
- Node.js: 18.x or higher
- NPM: Latest version
- Database: SQLite (included) or MySQL/PostgreSQL
git clone https://github.com/zoelabbb/ct-pifacia.git
cd ct-pifaciacomposer installnpm install# Copy environment file
cp .env.example .env
# Generate application key
php artisan key:generate# Create SQLite database (default)
touch database/database.sqlite
# Run migrations with seeders
php artisan migrate --seedphp artisan storage:link# Development
npm run dev
# Production
npm run build# Option 1: Use the built-in development command (recommended)
composer run dev
# Option 2: Manual setup
# Terminal 1: Start Laravel server
php artisan serve
# Terminal 2: Start queue worker
php artisan queue:listen
# Terminal 3: Start Vite dev server
npm run dev
# Terminal 4: Monitor logs (optional)
php artisan pail --timeout=0# Build assets for production
npm run build
# Configure web server (Nginx/Apache) to point to public/ directoryAfter setting up the application, you can access it using these pre-configured demo accounts:
Email: [email protected]
Password: admintest
Access Level: Full system access
Features Available:
- β Full item management (CRUD)
- β Category management
- β User management & roles
- β Audit logs access
- β Import/Export functionality
- β System administration
Email: [email protected]
Password: stafftest
Access Level: Limited access
Features Available:
- β View items and categories
- β Limited administrative functions
- β No user management access
- Start the application:
composer run devorphp artisan serve - Open browser: Navigate to
http://localhost:8000 - Login: Use any of the demo accounts above
- Explore: Try different features based on your role
π‘ Pro Tip: The login page includes quick-fill buttons for easy demo access!
The application uses Laravel Jetstream with Spatie Laravel Permission for comprehensive authentication and authorization:
- Administrator: Full system access
- Manager: Limited administrative access
- User: Basic item viewing access
- Categories:
view,create,edit,delete - Items:
view,create,edit,delete - Users:
view,create,edit,delete(Admin only) - Roles:
view,create,edit,delete(Admin only)
- CRUD Operations: Create, read, update, delete items
- Category Assignment: Link items to categories
- File Attachments: Upload and manage item images/documents
- Soft Delete: Items can be safely deleted and restored
- Bulk Operations: Import/export via Excel files
- Price Management: Decimal precision pricing
- Status Control: Active/inactive item states
- Metadata: JSON-based additional item information
- Publishing: Schedule item publication dates
- UUID-based identification
- Name and description
- Category relationship
- Price (decimal with 2 places)
- Active status (boolean)
- Metadata (JSON)
- Publication date
- File attachments
- Audit trail
- Hierarchical Structure: Parent-child category relationships
- CRUD Operations: Full category management
- Status Control: Active/inactive categories
- Item Relationships: Track items per category
- User CRUD: Complete user administration
- Role Assignment: Assign roles to users
- Profile Management: User profile information
- Account Status: Enable/disable accounts
Track all model changes with detailed audit logs:
- User Actions: Who made changes
- Timestamps: When changes occurred
- Change Details: What was modified
- IP Tracking: Source of changes
- Bulk Item Creation: Import items from Excel files
- Validation: Data validation during import
- Error Reporting: Detailed import results
- Filtered Exports: Export with filters
- Formatted Data: Professional Excel formatting
- Scheduled Exports: Automated export generation
- id (UUID, Primary Key)
- category_id (UUID, Foreign Key)
- name (String)
- description (Text, Nullable)
- price (Decimal 10,2)
- is_active (Boolean, Default: true)
- meta (JSON, Nullable)
- published_at (Timestamp, Nullable)
- attachments (JSON, Nullable)
- deleted_at (Timestamp, Nullable) -- Soft Delete
- created_at, updated_at (Timestamps)- id (UUID, Primary Key)
- name (String, Unique)
- description (Text, Nullable)
- is_active (Boolean, Default: true)
- published_at (Timestamp, Nullable)
- created_at, updated_at (Timestamps)-
Environment Configuration:
# Set production environment APP_ENV=production APP_DEBUG=false # Configure database DB_CONNECTION=mysql DB_HOST=your-host DB_DATABASE=your-database DB_USERNAME=your-username DB_PASSWORD=your-password
-
Build and Optimize:
# Install production dependencies composer install --optimize-autoloader --no-dev # Build assets npm run build # Optimize Laravel php artisan config:cache php artisan route:cache php artisan view:cache
-
Run Migrations:
php artisan migrate --force
-
Web Server Configuration:
- Point document root to
public/directory - Configure URL rewriting for Laravel
- Set appropriate file permissions
- Point document root to
.env: Environment variablesconfig/app.php: Application settingsconfig/database.php: Database configurationconfig/permission.php: Role/permission settingsconfig/audit.php: Audit logging configuration
We welcome contributions! Please follow these steps:
- Fork the Repository
- Create a Feature Branch:
git checkout -b feature/amazing-feature - Commit Changes:
git commit -m 'Add amazing feature' - Push to Branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow PSR-12 coding standards
- Write tests for new features
- Update documentation as needed
- Follow semantic versioning for releases
This project is open-sourced software licensed under the MIT License.
Zoelabbb
- GitHub: @zoelabbb
- Project Link: https://github.com/zoelabbb/ct-pifacia
This repository contains a coding test originally from Pifacia that I completed and expanded upon as a comprehensive study case. The project demonstrates modern Laravel development practices and serves as a portfolio piece showcasing full-stack development capabilities.
Note: This is a study case implementation based on a coding test scenario. The project has been enhanced with additional features, comprehensive documentation, and best practices to serve as a learning resource and portfolio demonstration.
Built with β€οΈ using Laravel 12 & Modern Web Technologies
A Coding Test Study Case from Pifacia
