This is the Backend API for the ERP system, built with Laravel 12. It provides endpoints for managing Customers, Products, Categories, Invoices, and Payments.
- PHP 8.2+
- Composer
- MySQL
- Clone the repository
- Run
composer install - Copy
.env.exampleto.env - Configure database in
.env - Run
php artisan key:generate - Run
php artisan migrate - Run
php artisan db:seed - Serve the application:
php artisan serve
Ensure these are set in your .env:
APP_URL=http://your-domain.com
SANCTUM_STATEFUL_DOMAINS=your-frontend-domain.com,localhost:3000
CORS_ALLOWED_ORIGINS=http://localhost:3000,https://your-frontend-domain.com
SESSION_DRIVER=database
CACHE_DRIVER=databaseSee API_DOCS.md for detailed endpoint descriptions.
This API uses Laravel Sanctum for authentication.
- Register:
POST /api/v1/auth/register - Login:
POST /api/v1/auth/login - Logout:
POST /api/v1/auth/logout(Bearer Token required)
- Customers: Manage customer data with tax info.
- Products: Manage inventory, prices, costs, and stock.
- Categories: Hierarchical category system.
- Invoices: Create invoices with automatic totals calculation and stock deduction.
- Payments: Track payments against invoices.
- Dashboard: Stats and reporting endpoints.