Local Setup and Installation
Relevant source files
The following files were used as context for generating this wiki page:
The local setup and installation process for this Laravel-based application involves configuring both PHP-side dependencies via Composer and frontend assets via NPM/Vite. The framework is designed to be accessible and provides a skeleton structure for building web applications with expressive syntax and pre-configured modules for routing, ORM, and background processing.
Sources: README.md:1-25, composer.json:1-10
Dependency Management and Core Requirements
The project relies on PHP 8.2 or higher as the primary runtime environment. It utilizes a dual-package management system where backend logic is handled by Composer and frontend assets/utilities are managed by NPM.
Backend Requirements
The application core is built on the Laravel framework (version 12.0) and includes Tinker for interactive REPL capabilities. Development-specific tools include PHPUnit for testing, Mockery for object simulation, and Sail for Docker-based environments.
Sources: composer.json:11-23
Frontend Requirements
Frontend compilation is driven by Vite. Dependencies include Tailwind CSS for styling and Axios for HTTP requests.
Sources: package.json:10-17
Installation Workflow
The installation process is automated through a comprehensive setup script defined in the project's orchestration file. This workflow ensures that the environment is synchronized, security keys are generated, and the database schema is prepared.
Automated Setup Steps
- PHP Dependency Installation: Executes
composer installto pull backend packages. - Environment Configuration: Checks for a
.envfile and copies.env.exampleif it does not exist. - Application Key Generation: Runs
php artisan key:generateto set theAPP_KEYfor encryption. - Database Migration: Executes
php artisan migrate --forceto build the initial schema. - Node Dependency Installation: Executes
npm installfor frontend packages. - Frontend Compilation: Runs
npm run buildto generate production assets via Vite.
Sources: composer.json:33-40
The following diagram illustrates the sequence of actions taken during the initial project setup:
The diagram shows the linear progression from backend dependency resolution to frontend asset building.
Sources: composer.json:33-40
Environment Configuration
Configuration is primarily managed through the .env file, with default fallbacks located in the config/ directory.
Core Application Settings
The application identity and environment state are defined in config/app.php. Key variables include:
| Variable | Description | Default |
|---|---|---|
APP_NAME | The name of the application | Laravel |
APP_ENV | Current environment (production/local) | production |
APP_DEBUG | Whether to show detailed error traces | false |
APP_URL | The root URL for CLI-generated links | http://localhost |
APP_KEY | 32-character string for encryption | null |
Sources: config/app.php:14-106
Database Configuration
The system supports multiple database drivers. By default, it is configured to use SQLite, which creates a local file at database/database.sqlite if it doesn't exist during project creation.
| Driver | Default Host | Default Port |
|---|---|---|
| SQLite | N/A | N/A |
| MySQL | 127.0.0.1 | 3306 |
| PostgreSQL | 127.0.0.1 | 5432 |
| SQL Server | localhost | 1433 |
Sources: config/database.php:40-120, composer.json:62-63
Development Environment and Tooling
For active development, the project provides a dev command that uses concurrently to run multiple services simultaneously.
Development Services
The npm run dev or composer run dev command initiates the following:
- Artisan Server: Local PHP development server via
php artisan serve. - Queue Worker: Listens for background jobs.
- Vite Server: Handles Hot Module Replacement (HMR) for CSS and JS assets.
- Pail: Provides real-time logging.
Sources: composer.json:41-44, package.json:6-9
Asset Compilation (Vite)
Vite is configured to watch for changes in Blade templates and JS/CSS files. It is explicitly configured to ignore compiled framework views to prevent unnecessary refresh cycles.
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
tailwindcss(),
],
server: {
watch: {
ignored: ['**/storage/framework/views/**'],
},
},
});
Sources: vite.config.js:5-18
Testing Environment
Testing is pre-configured via phpunit.xml. The environment is isolated from development settings to prevent data loss.
| Component | Test Environment Value |
|---|---|
DB_CONNECTION | sqlite |
DB_DATABASE | :memory: |
CACHE_STORE | array |
SESSION_DRIVER | array |
QUEUE_CONNECTION | sync |
Sources: phpunit.xml:21-35
Conclusion
Setting up the Laravel project locally requires a PHP 8.2+ environment and Node.js. By utilizing the provided composer run setup and composer run dev scripts, developers can quickly synchronize dependencies, configure local databases (defaulting to SQLite), and start a full-stack development environment including HMR and background job processing.