A comprehensive Laravel-based web application for managing construction projects, financial operations, suppliers, subcontractors, and all related business processes. This system provides a complete solution for construction companies to track projects, manage accounts, handle purchases and sales, and maintain detailed records of all business activities.
- Overview
- Features
- Technology Stack
- Requirements
- Installation
- Configuration
- Database Setup
- Project Structure
- Key Modules
- User Roles & Permissions
- Usage
- Development
- Contributing
- License
Alsfoan is a full-featured project management system designed specifically for construction and engineering companies. It enables businesses to:
- Manage multiple construction projects with detailed tracking
- Handle financial operations including accounts, expenses, purchases, and sales
- Maintain supplier and subcontractor relationships
- Track materials and their price history
- Manage documents and official correspondence
- Generate price offers and manage project terms
- Handle maintenance requests
- Provide role-based access control for different user types
The system is built with Arabic language support and follows Laravel best practices for scalability and maintainability.
- Project Creation & Tracking: Create and manage construction projects with detailed information including location, financing, costs, and profit calculations
- Project Terms: Define and manage project terms with associated costs
- Project Images: Upload and manage multiple images per project
- Project Payments: Track payments associated with projects
- Project Status: Monitor project status and progress
- Account Management: Create and manage accounts for suppliers, subcontractors, projects, and admin
- Account Transactions: Track all financial transactions between accounts
- Account Transfers: Transfer funds between different accounts
- Expense Tracking: Record and manage expenses with tax calculations
- Purchase Management: Track purchases from suppliers and subcontractors
- Sales Management: Record and manage sales transactions
- Payment Processing: Handle various payment types (bank, cash, cheque, card)
- Supplier Management: Maintain supplier database with contact information, tax details, and contract information
- Subcontractor Management: Manage subcontractor information and relationships
- Account Association: Link accounts to suppliers and subcontractors for financial tracking
- Material Catalog: Maintain a catalog of materials with pricing
- Price History: Track material price changes over time
- Material Types: Categorize materials by type
- Document Types: Define custom document types
- Document Storage: Upload and manage documents with expiry dates
- Entity Association: Link documents to various entities (suppliers, subcontractors, etc.)
- Price Offers: Create and manage price offers for new projects
- Recipients Management: Track price offer recipients
- Official Letters: Generate and manage official correspondence
- New Project Prices: Manage pricing for new project proposals
- Maintenance Requests: Create and track maintenance requests
- Status Tracking: Monitor maintenance request status (new, transferred, done)
- User Assignment: Assign maintenance requests to users
- Role-Based Access Control (RBAC): Implemented using Spatie Laravel Permission
- Multiple User Roles: Admin, Accountant, Engineer, and Client roles
- Permission Management: Granular permission system for all features
- User Management: Create, edit, and manage user accounts
- PHP 8.1+: Modern PHP with type hints and attributes
- Laravel 10.10: Robust PHP framework for web applications
- Laravel Sanctum: API authentication
- Laravel Fortify: Authentication services
- Laravel Jetstream: Application scaffolding with Livewire
- Livewire: Full-stack framework for building dynamic interfaces
- Spatie Laravel Permission: Role and permission management
- Intervention Image: Image processing and manipulation
- Guzzle HTTP: HTTP client for external API calls
- Vite: Next-generation frontend build tool
- Bootstrap 4: CSS framework for responsive design
- jQuery: JavaScript library for DOM manipulation
- DataTables: Advanced tables with sorting, filtering, and pagination
- Select2: Enhanced select boxes
- Summernote: WYSIWYG editor
- SweetAlert2: Beautiful alert dialogs
- Chart.js: Data visualization
- FullCalendar: Calendar widget
- DateRangePicker: Date range selection
- Font Awesome: Icon library
- MySQL/MariaDB: Relational database management system
- Eloquent ORM: Laravel's database abstraction layer
- Laravel Pint: Code style fixer
- PHPUnit: Testing framework
- Laravel Sail: Docker development environment
- PHP >= 8.1
- Composer
- Node.js >= 16.x and NPM
- MySQL >= 5.7 or MariaDB >= 10.3
- Web server (Apache/Nginx)
- Git
git clone https://github.com/AwadGorg/alsfoan.git
cd alsfoancomposer installnpm installCopy the environment file and configure it:
cp .env.example .env
php artisan key:generateEdit the .env file with your database credentials and application settings:
APP_NAME=Alsfoan
APP_ENV=local
APP_KEY=base64:...
APP_DEBUG=true
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=alsfoan
DB_USERNAME=your_username
DB_PASSWORD=your_passwordCreate your database and run migrations:
php artisan migrate
php artisan db:seedThe seeder will create:
- Default roles (admin, accountant, engineer, client)
- Admin user account
- All necessary permissions
For development:
npm run devFor production:
npm run buildCreate a symbolic link for storage:
php artisan storage:linkphp artisan serveThe application will be available at http://localhost:8000
The application uses Laravel Fortify and Jetstream for authentication. Configure these in:
config/fortify.phpconfig/jetstream.php
Role and permission management is handled by Spatie Laravel Permission. Configuration is in:
config/permission.php
Configure file storage in config/filesystems.php. The default storage is set to public for uploaded files.
The application includes comprehensive database migrations for:
- Users & Authentication: Users, password resets, two-factor authentication
- Projects: Projects, project terms, project images, project payments
- Financial: Accounts, account transactions, expenses, payments
- Business Entities: Suppliers, subcontractors, materials, material price history
- Transactions: Purchases, sales
- Documents: Document types, documents
- Management: Maintenances, price offers, price offer recipients, new project prices, official letters, expense terms
- Permissions: Roles and permissions (via Spatie)
Run migrations:
php artisan migratealsfoan/
├── app/
│ ├── Actions/ # Fortify and Jetstream actions
│ ├── Console/ # Artisan commands
│ ├── Exceptions/ # Exception handlers
│ ├── Http/
│ │ ├── Controllers/
│ │ │ └── Dashboard/ # Main application controllers
│ │ ├── Middleware/ # Custom middleware
│ │ └── Requests/ # Form request validation
│ ├── Models/ # Eloquent models
│ ├── Providers/ # Service providers
│ └── View/
│ └── Components/ # Blade components
├── bootstrap/ # Application bootstrap files
├── config/ # Configuration files
├── database/
│ ├── factories/ # Model factories
│ ├── migrations/ # Database migrations
│ └── seeders/ # Database seeders
├── public/ # Public assets
│ ├── dist/ # Compiled assets
│ └── plugins/ # Third-party plugins
├── resources/
│ ├── css/ # Stylesheets
│ ├── js/ # JavaScript files
│ ├── lang/ # Language files (Arabic)
│ ├── markdown/ # Markdown content
│ └── views/ # Blade templates
│ ├── dashboard/ # Dashboard views
│ ├── auth/ # Authentication views
│ └── components/ # Reusable components
├── routes/ # Route definitions
├── storage/ # Storage directory
├── tests/ # Test files
└── vite.config.js # Vite configuration
Located in app/Http/Controllers/Dashboard/ProjectController.php
- Create, read, update, delete projects
- Manage project terms and images
- Track project payments
- Calculate project costs, values, and profits
Located in app/Http/Controllers/Dashboard/AccountController.php
- Manage financial accounts
- Track account transactions
- Transfer funds between accounts
- Print account statements
Located in app/Http/Controllers/Dashboard/SupplierController.php and SubcontractorController.php
- Manage supplier and subcontractor information
- Link accounts to entities
- Track purchases and expenses
Located in app/Http/Controllers/Dashboard/MaterialController.php
- Manage material catalog
- Track price history
- Categorize materials
Located in app/Http/Controllers/Dashboard/PurchaseController.php and SaleController.php
- Record purchases from suppliers/subcontractors
- Record sales transactions
- Calculate taxes and totals
Located in app/Http/Controllers/Dashboard/DocumentController.php
- Define document types
- Upload and manage documents
- Track document expiry dates
The system includes four main roles:
- Full access to all features
- User and role management
- System configuration
- Financial management (accounts, expenses, purchases, sales)
- Project viewing and editing
- Supplier and subcontractor management
- Document management
- Maintenance request management
- View projects
- View dashboard
- View assigned projects only
Permissions are managed through Spatie Laravel Permission package, allowing granular control over feature access.
- Navigate to the application URL (default:
http://localhost:8000) - Login with admin credentials (created during seeding)
- Access the dashboard to view overview statistics
- Navigate to Projects → Create New Project
- Fill in project details:
- Client selection
- Project name, location (city, region, plot number)
- Financing information (bank, amounts)
- Cost and value calculations
- Tax information
- Add project terms with associated costs
- Upload project images
- Save the project
- Navigate to Accounts
- Create accounts for suppliers, subcontractors, projects, or admin
- Set opening balances
- View account transactions
- Transfer funds between accounts
- Print account statements
- Navigate to Purchases → Create New Purchase
- Select supplier or subcontractor
- Choose associated project and project term
- Enter purchase details (invoice number, date, type)
- Add quantity, unit price, and tax percentage
- Save the purchase
- Navigate to Expenses → Create New Expense
- Select account and entity (supplier/subcontractor)
- Enter expense details
- Link to purchase if applicable
- Save the expense
php artisan testThe project uses Laravel Pint for code formatting:
./vendor/bin/pintSeed the database with default data:
php artisan db:seedOr seed specific seeders:
php artisan db:seed --class=RolesSeeder
php artisan db:seed --class=AdminSeederClear application cache:
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clearContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Please ensure your code follows Laravel coding standards and includes appropriate tests.
This project is open-sourced software licensed under the MIT license.
Awad Gorg
- GitHub: @AwadGorg
- Laravel Framework
- Laravel Jetstream & Fortify
- Spatie Laravel Permission
- All contributors and open-source libraries used in this project
For more information or support, please open an issue on the GitHub repository.