Enterprise-Grade ERP Solution | Laravel 12 + Next.js 16 | Full-Stack TypeScript/PHP
ACCSYSTEM ERP is a comprehensive, enterprise-grade Enterprise Resource Planning (ERP) system designed for small to medium-sized businesses. Built with modern technologies, it integrates all core business functions into a unified platform.
| Feature | Benefit |
|---|---|
| Unified Platform | Seamlessly integrates Sales, Purchases, Inventory, Finance, HR, and Payroll |
| Real-Time Data | Instant updates across all modules with automatic ledger postings |
| ZATCA Compliant | Full Saudi Arabia e-invoicing compliance with QR code generation |
| Multi-Language | Arabic (RTL) and English interface support |
| Role-Based Access | Granular permissions with multi-level approval workflows |
| Audit Trail | Complete transaction history and change tracking |
| Modern Stack | Laravel 12 backend with Next.js 16 frontend |
- PHP 8.2+ with extensions:
sqlite3,mbstring,xml,bcmath,json,curl - Composer (latest)
- Node.js 20+ and npm
- Git
# 1. Clone the repository
git clone <your-repo-url> ACCSYSTEM-erp
cd ACCSYSTEM-erp
# 2. Backend Setup
cd src
composer install
cp .env.example .env
php artisan key:generate
touch database/database.sqlite
php artisan migrate
php artisan db:seed
# or reset and reseed
php artisan migrate:fresh --seed
# 3. Frontend Setup
cd ../public
npm install
# 4. Run the application
# Terminal 1 - Backend
cd src && php artisan serve
# Terminal 2 - Frontend
cd public && npm run dev
# 5. Access the ERP
# Open http://localhost:3000
# Default login: admin / adminFor complete documentation, see the /docs folder:
| Document | Description |
|---|---|
| USER_GUIDE.md | π Bilingual user manual (Arabic/English) for non-technical users |
| TECHNICAL_DOCUMENTATION.md | π§ Complete technical architecture and developer guide |
| API_REFERENCE.md | π REST API documentation with examples |
| DATABASE_SCHEMA.md | ποΈ Full database schema with ERD diagrams |
| DOCUMENTATION_INDEX.md | πΊοΈ Documentation navigation guide |
| Module | Description | Key Features |
|---|---|---|
| Sales & POS | Point of Sale and invoicing | Cash/credit sales, ZATCA e-invoicing, barcode/QR |
| Purchases | Procurement management | Multi-level approval, supplier management |
| Inventory | Stock management | FIFO/Average costing, expiry tracking, reorder alerts |
| AR (Receivables) | Customer credit management | Aging reports, payment tracking, customer ledger |
| AP (Payables) | Supplier payment management | Payment scheduling, supplier ledger |
| General Ledger | Double-entry bookkeeping | Chart of accounts, journal vouchers, trial balance |
| Financial Reports | Comprehensive reporting | Balance Sheet, P&L, Cash Flow, Comparative Analysis |
| HR & Payroll | Employee management | Multi-level approval, salary processing, allowances |
| Fixed Assets | Asset lifecycle | Depreciation (SL/DB), disposal tracking |
| Multi-Currency | International transactions | Exchange rates, multi-currency invoicing |
| Fiscal Periods | Period management | Opening/closing periods, period locking |
| Accrual Accounting | Advanced accounting | Prepayments, unearned revenue, payroll accruals |
| Feature | Description |
|---|---|
| Dashboard | Real-time KPIs, sales trends, inventory alerts |
| Role Management | Customizable roles with granular permissions |
| Audit Trail | Complete transaction logging |
| Document Sequences | Automatic numbering for invoices, vouchers |
| Batch Processing | Background job processing |
| Government Fees | Configurable fees (Kharaj, taxes) |
βββββββββββββββββββββββββββββββββββββββ
β NEXT.JS FRONTEND (Port 3000) β
β React 19 + TypeScript + Tailwind β
βββββββββββββββββββ¬ββββββββββββββββββββ
β REST API (JSON)
βββββββββββββββββββΌββββββββββββββββββββ
β LARAVEL BACKEND (Port 8000) β
β PHP 8.2 + MVC + Service Layer β
βββββββββββββββββββ¬ββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββββ
β DATABASE (SQLite/MySQL) β
β 52 Tables, Full ACID Compliance β
βββββββββββββββββββββββββββββββββββββββDesign Patterns:
- Backend: Service Layer, Repository (Eloquent), Form Requests, Middleware
- Frontend: Component-based, Custom Hooks, Utility-first CSS
ACCSYSTEM-erp/
β
βββ src/ # Laravel Backend (API)
β βββ app/
β β βββ Http/Controllers/Api/ # 35 Controllers
β β βββ Models/ # 50 Eloquent Models
β β βββ Services/ # 11 Business Services
β β βββ Helpers/ # Utility Functions
β βββ database/migrations/ # 52 Migration Files
β βββ routes/api.php # API Routes
β βββ ...
β
βββ public/ # Next.js Frontend
β βββ app/ # App Router Pages
β β βββ auth/ # Authentication
β β βββ system/ # Dashboard, Settings, Reports
β β βββ sales/ # Sales & Invoicing
β β βββ purchases/ # Purchases & Expenses
β β βββ finance/ # GL, Accounts, Periods
β β βββ hr/ # HR & Payroll
β β βββ navigation/ # Navigation Landing Page
β βββ components/ # Reusable Components
β βββ lib/ # API, Types, Utilities
β βββ ...
β
βββ docs/ # Documentation
βββ USER_GUIDE.md
βββ TECHNICAL_DOCUMENTATION.md
βββ API_REFERENCE.md
βββ DATABASE_SCHEMA.md
βββ DOCUMENTATION_INDEX.mdFull Stack (Recommended):
# Terminal 1 - Backend
cd src
php artisan serve
# Terminal 2 - Queue Worker (for background jobs)
cd src
php artisan queue:listen
# Terminal 3 - Frontend
cd public
npm run devWith Composer Script (Backend only):
cd src
composer dev
# Runs: API, Queue, Logs concurrentlyBackend (Laravel):
# Create migration
php artisan make:migration create_table_name
# Run migrations
php artisan migrate
# Create controller
php artisan make:controller Api/MyController
# Clear cache
php artisan config:clearFrontend (Next.js):
- Edit files in
public/app/ - Auto-reloads on save
- Add types to
lib/types.ts - Build:
npm run build
Backend:
cd src
php artisan testFrontend:
- Testing framework: Jest + React Testing Library (configurable)
52 Tables Covering:
| Category | Tables |
|---|---|
| Auth & Users | users, sessions, roles, modules, role_permissions, login_attempts |
| Inventory | products, categories, purchases, purchase_requests, inventory_costing, inventory_counts |
| Sales | invoices, invoice_items, zatca_einvoices, sales_returns, sales_return_items |
| AR/AP | ar_customers, ar_transactions, ap_suppliers, ap_transactions |
| Finance | chart_of_accounts, general_ledger, fiscal_periods, journal_vouchers |
| HR & Payroll | employees, departments, payroll_cycles, payroll_items, payroll_transactions, employee_documents, employee_allowances, employee_deductions |
| Advanced | assets, asset_depreciation, prepayments, unearned_revenue, reconciliations, currencies, currency_denominations |
| System | settings, document_sequences, batch_processing, batch_items, recurring_transactions, telescope, government_fees, invoice_fees |
- Authentication: Session-based with secure tokens
- Authorization: Role-based permissions (RBAC)
- Validation: Laravel Form Requests
- SQL Injection: Protected via Eloquent ORM
- XSS: React auto-escaping + custom utilities
- Password Hashing: Bcrypt (12 rounds)
Backend:
# Set environment
APP_ENV=production
APP_DEBUG=false
# Use production database (MySQL/PostgreSQL)
DB_CONNECTION=mysql
# Optimize
composer install --optimize-autoloader --no-dev
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Run migrations
php artisan migrate --force
# for clear database and magigration it again and seed
php artisan migrate:refresh --seed
# Set up queue worker with SupervisorFrontend:
# Build
npm run build
# Run production server
npm start
# Or deploy to Vercel/NetlifySee TECHNICAL_DOCUMENTATION.md for detailed deployment instructions.
Base URL: http://localhost:8000/api
Authentication:
- Header:
X-Session-Token: {your_token} - Obtain via:
POST /api/login
Key Endpoints:
| Endpoint | Method | Description |
|---|---|---|
/login |
POST | User authentication |
/invoices |
GET, POST | Invoice management |
/purchases |
GET, POST | Purchase management |
/products |
GET, POST | Product management |
/trial_balance |
GET | Trial balance report |
/reports/balance_sheet |
GET | Balance sheet |
/reports/profit_loss |
GET | P&L statement |
/payroll/generate |
POST | Generate payroll cycle |
/employees |
GET, POST | Employee management |
See API_REFERENCE.md for complete API documentation.
| Component | Technology |
|---|---|
| Framework | Laravel 12 |
| Language | PHP 8.2+ |
| Database | SQLite (dev), MySQL/PostgreSQL (prod) |
| ORM | Eloquent |
| Queue | Database driver |
| Cache | Database driver |
| Component | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript 5 |
| UI Library | React 19 |
| Styling | Tailwind CSS 4 |
| HTTP Client | Fetch API |
Common Issues:
| Problem | Solution |
|---|---|
| "No encryption key" | php artisan key:generate |
| Database error | Check .env DB settings, ensure DB exists |
| 500 API error | Check storage/logs/laravel.log |
| Frontend can't connect | Verify backend running on port 8000 |
| 401 Unauthorized | Clear localStorage, re-login |
| Changes not reflecting | Clear cache: php artisan config:clear |
See TECHNICAL_DOCUMENTATION.md for detailed troubleshooting.
MIT License - See LICENSE file for details.
- Fork the repository
- Create 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 Pull Request
See CONTRIBUTING.md for detailed contribution guidelines.
- Documentation: See
/docsfolder - Issues: Submit via GitHub Issues with detailed logs
- Logs: Check
src/storage/logs/laravel.log
Built with β€οΈ using Laravel & Next.js
Developed by: Emran Nasser && AI Agents