Welcome to the WebBuilder repository. This document provides a comprehensive guide to setting up and running the project locally.
- Prerequisites
- Installation
- Configuration
- Database Setup
- Running the Project
- Testing
- Contributing
- License
Ensure you have the following software installed on your machine:
Follow these steps to set up the project locally:
-
Clone the repository:
git clone https://github.com/YuketsuSh/web-builder.git cd web-builder
-
Install PHP dependencies:
composer install
-
Install Node.js dependencies:
npm install
-
Environment Variables:
Copy the
.env.example
file to.env
:cp .env.example .env
-
Generate Application Key:
php artisan key:generate
-
Set up your
.env
file:Configure your database and other environment settings in the
.env
file.DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database DB_USERNAME=your_username DB_PASSWORD=your_password # Other configurations...
-
Run Migrations:
Make sure your database is created, then run the migrations:
php artisan migrate
-
Seed the Database (Optional):
If you have seeders, run them to populate your database with initial data:
php artisan db:seed
-
Compile Assets:
Compile your assets (CSS, JavaScript):
npm run build
-
Start the Development Server:
Start the Laravel development server:
php artisan serve
The application will be accessible at
http://localhost:8000
.
Run the test suite to ensure everything is working correctly:
php artisan test
Thank you for considering contributing to WebBuilder! Please read the contribution guidelines for details on our code of conduct and the process for submitting pull requests.
This project is open-sourced software licensed under the MIT license.
This project uses Laravel Breeze for authentication scaffolding. Ensure you install and configure it as follows:
-
Install Laravel Breeze:
composer require laravel/breeze --dev
-
Install Breeze's backend and frontend scaffolding:
php artisan breeze:install npm install && npm run dev
-
Run Migrations for Breeze:
php artisan migrate
This project uses Spatie's Laravel Permission package for role and permission management.
-
Publish the configuration file:
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
-
Run the Migrations:
php artisan migrate
-
Clear Cache:
After setting up roles and permissions, clear the cache to reflect changes:
php artisan cache:clear
After setting up the project and creating a user account, you need to assign the admin role to a user. Follow these steps:
-
Open Tinker:
Laravel Tinker is a powerful REPL for the Laravel framework. Open Tinker by running:
php artisan tinker
-
Find the User:
Find the user you want to assign the admin role to. Replace email@example.com with the user's email.
$user = App\Models\User::where('email', 'email@example.com')->first();
-
Assign the Admin Role:
Assign the
admin
role to the user. Ensure the role exists in your roles table. If it does not exist, you will need to create it first.$user->assignRole('admin');
-
Exit Tinker:
Exit the Tinker console by typing
exit
.
Thank you for using my project ! If you have any questions or need further assistance, feel free to open an issue or contact me on discord or discord username (yuketsu).