Prerequisites
Before you begin, ensure you have the following installed:- Node.js & NPM - Required for frontend asset compilation
- Git - For version control
- A code editor - VS Code, PHPStorm, or your preferred IDE
- MySQL (optional) - If not using SQLite
Installing PHP and Composer
The ServITech Backend requires PHP 8.2 or higher and Composer for dependency management.Install PHP and Composer
Choose the installation command for your operating system:
After installation completes, restart your terminal for changes to take effect.
Cloning the Repository
Clone the ServITech Backend repository and navigate to the project directory:Environment Configuration
Create Environment File
Copy the example environment file:
On Windows without
cp, manually create a .env file and copy the contents from .env.example.Generate Application Key
Generate the Laravel application encryption key:This automatically updates the
APP_KEY in your .env file.Database Configuration
The application supports both SQLite (default) and MySQL.- SQLite (Recommended for Development)
- MySQL
SQLite is configured by default. No additional setup needed:The SQLite database file will be created automatically at
.env
database/database.sqlite when you run migrations.Key Environment Variables
Here are the most important variables to configure in your.env file:
Application Settings
.env
Performance Settings
.env
PHP_CLI_SERVER_WORKERS- Number of worker processes for the development serverBCRYPT_ROUNDS- Password hashing cost (higher = more secure but slower)
Session Configuration
.env
Queue and Cache
.env
Mail Configuration
.env
In development, emails are logged to
storage/logs/laravel.log by default. Configure SMTP settings for production.API Documentation
.env
Installing Dependencies
Install both PHP and Node.js dependencies:If
composer install fails, try running composer update to resolve dependency conflicts.Troubleshooting
PHP Extension Missing
Error:extension not found
Solution: Install required PHP extensions:
Composer Memory Limit
Error:Allowed memory size exhausted
Solution: Increase PHP memory limit:
Permission Issues (Linux/macOS)
Error:Permission denied when writing to storage/logs
Solution: Set proper permissions:
Node.js Version Issues
Error:Unsupported Node.js version
Solution: Use a Node version manager (nvm):
Next Steps
Running Locally
Start the development server and all required services
Database Migrations
Set up your database schema and seed test data