Skip to content

redhat127/chat-app-laravel

Repository files navigation

Chat App - Laravel + Inertia (react)

A modern real-time chat application built with Laravel, providing seamless communication between users with real-time messaging capabilities.

Table of Contents

Features

  • Real-time messaging between users
  • User authentication and authorization
  • Responsive web interface
  • Message history and persistence
  • Online/offline user status
  • Notification system
  • Clean and intuitive UI

Prerequisites

Before you begin, ensure you have the following installed:

  • PHP 8.2 or higher
  • Composer
  • Bun
  • PostgreSQL database
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/redhat127/chat-app-laravel.git
cd chat-app-laravel
  1. Install PHP dependencies:
composer install
  1. Install JavaScript dependencies:
bun install
  1. Create environment configuration file:
cp .env.example .env
  1. Generate application key:
php artisan key:generate
  1. Create a symbolic link to the storage directory:
php artisan storage:link

Configuration

  1. Update your .env file with database credentials:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=chat_app_laravel_db
DB_USERNAME=postgres
DB_PASSWORD=
  1. Configure broadcasting for real-time features:
php artisan install:broadcasting

When prompted, choose Reverb as your broadcasting driver. This will automatically configure the necessary environment variables for real-time messaging.

  1. Run database migrations and seed the database:
php artisan migrate --seed

Usage

  1. Compile assets for development:
bun run dev
  1. Start the development server:
php artisan serve
  1. Start the Reverb broadcasting server (in a separate terminal):
php artisan reverb:start --debug
  1. Start the queue listener (in another separate terminal):
php artisan queue:listen

The application will be available at http://localhost:8000

Architecture

The application is structured as follows:

  • Backend: Laravel framework handles API endpoints, database operations, and business logic
  • Frontend: React with Inertia.js for server-driven single-page application experience
  • Database: PostgreSQL stores user information, messages, and conversations
  • Broadcasting: Real-time events powered by Laravel Reverb

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions, please open an issue on the GitHub repository.


Happy chatting! 💬

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published