# Handover Documentation for The CallQ
**Project Overview:**
This handover document provides detailed information about setting up and running a PHP Laravel project that uses the Blade templating engine for the front end and Webpack Mix for building Sass and JavaScript resources. The document covers the necessary applications and configurations to run the project locally.
**Prerequisites:**
Before you can run the project locally, ensure you have the following prerequisites installed on your system:
1. **PHP**: Make sure you have PHP installed. The project may have specific PHP version requirements. Match your PHP version to the production environment.
2. **Composer**: Laravel projects require Composer for package management. You can install Composer from https://getcomposer.org.
3. **Node.js and npm**: Node.js and npm are required for managing JavaScript dependencies. Install them from https://nodejs.org.
4. **MariaDB Databases**: You will need three MariaDB databases for the project:
- thecallq
- asteriskdb (for CDR and CEL data)
- freepbx (used to resolve extensions)
**Getting Started:**
1. Clone the project repository to your local machine.
2. In the project root directory, run `composer install` to install PHP dependencies.
3. Run `npm install` to install JavaScript dependencies.
4. Make sure to match the versions of npm and PHP with the production environment.
5. Copy the `.env` file from the production environment or use the provided `.env` template. This file contains database configuration and other environment-specific settings.
6. Configure your database connections in the `config/database.php` file.
**Running the Project Locally:**
1. Start the development server by running the following command:
```bash
php artisan serve
```
This will start the Laravel development server, and you can access the project at `http://localhost:8000`.
2. Front-end Resources:
- The project has two folders for front-end resources: "resources" and "public."
- You directly modify files in the "resources" folder.
- The "public" folder is generated automatically when you build resources using Webpack Mix.
3. Webpack Mix:
- The `webpack.mix.js` file defines the mapping from the "resources" folder to the "public" folder.
4. Building Assets:
- To build assets (Sass and JavaScript), use the following commands:
- `npm run dev`: This is used before committing code, and it compiles assets.
- `npm run hot`: This starts a server that listens for file changes and builds assets online. Use this during development.
Note: `npm run dev` may take some time, which is why `npm run hot` is used for a faster development workflow.
**Database Usage:**
Developers can use either Eloquent ORM or raw database queries without models. All database configuration is available in the `.env` file and is not stored in source control.
Ensure you have set up the three MariaDB databases mentioned earlier: "thecallq," "asteriskdb" for CDR and CEL data, and "freepbx" for resolving extensions.
**Deploying to Production:**
There is actually no particular pipelines for deployment. We use convention in this case where we merge code commits to `production` branch, and pull these changes back on the production server.
**Important Note:** You need to perform packing of all resources in advance before pushing on `production` branch to ensure a seamles deployment with just a `git pull` command.
### Conclusion
This document provides an overview of how to set up and run the Laravel project locally, including essential prerequisites and configurations.