Contribution Guide
Thanks for contributing to Wirechat! We're excited to have you help improve the project. Here's how to get started:
-
Create a new branch before making any edits. Do not push directly to
main
. For example:fix/your-branch
orfeat/your-branch
. -
Try to limit changes to only the necessary files and lines. This helps keep things clean and makes reviewing easier.
-
Run tests to make sure your changes don’t break anything. Add new tests if you're adding features or fixing bugs.
-
Create your pull request with a clear description of what you've changed. Reference any related issues (e.g., "Fixes #123") and request a review from a maintainer.
Setting up your environment
- Create a new Laravel project in your workspace folder:
composer create-project laravel/laravel wirechat
cd wirechat
- Install dependencies and set up authentication (Laravel Breeze with Livewire):
composer require laravel/breeze --dev
php artisan breeze:install
Choose the Livewire stack when prompted.
- Set up websockets and broadcasting (using Reverb):
php artisan install:broadcasting
php artisan reverb:start
Note: The install:broadcasting
command might prompt you to install Laravel Reverb and necessary front-end packages like Echo. Accept if you don't have a WebSocket server set up.
in a separate terminal window run:
php artisan queue:work --queue=messages,default
- Start your development servers:
Backend server: php artisan serve
Frontend server: npm run dev
Installing WireChat
- Clone the Wirechat repository into the root of your project
git clone https://github.com/namumakwembo/wirechat.git
- Add the Wirechat path to the
autoload-dev
section of your maincomposer.json
{
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/",
"Namu\\WireChat\\": "wirechat/src/"
}
}
}
- Manually Register the Service Provider Open
bootstrap/providers.php
and add the service provider to the providers array:
'providers' => [
// Other service providers...
Namu\WireChat\WireChatServiceProvider::class,
],
- Install Wirechat and run migrations (from the root of your Laravel project)
php artisan wirechat:install
php artisan migrate
- Purge CSS classes by the following to
content
section intailwind.config.js
'./vendor/namu/wirechat/resources/views/**/*.blade.php',
'./vendor/namu/wirechat/src/Livewire/**/*.php'
6.Finally add the Chatable
trait to your User model:
use Illuminate\Foundation\Auth\User as Authenticatable;
use Namu\WireChat\Traits\Chatable;
class User extends Authenticatable
{
use Chatable;
...
}
After this setup, you can visit the route /chats
to start conversations, send messages, and more.
Making Changes
- navigate into the Wirechat directory and create a new branch:
cd wirechat
git checkout -b fix/your-branch-name
- After you're done making chanages , Run tests to make sure everything works as expected:
composer install
composer test
- Commit your changes and push to your branch:
git add .
git commit -m "Your descriptive commit message"
git push origin fix/your-branch-name
- Lastly Create the pull request on GitHub. Provide a clear title and detailed description of your changes. Reference any related issues.
Reporting Bugs and Suggesting Features
If you've found a bug or have a suggestion for a new feature, please open an issue on GitHub.
Thank you for contributing!