Skip to content

guilhermeslk/laravel-realtime-chat

Repository files navigation

Laravel Realtime Chat

Build Status Code Climate

A realtime chat sample written in Laravel 4.2 + Redis + Node.js + Socket.io.

Um exemplo de chat realtime escrito em Laravel 4.2 + Redis Node.js + Socket.io (instruções somente em inglês).

Live example available at: http://chat.guilhermeslk.com.br :)

Requirements

Laravel 4.2
MySQL
Redis
Node.js
NPM

How to install

Step 1: Clone this repo

$ git clone https://github.com/guilhermeslk/laravel-realtime-chat.git

Step 2: Install composer packages

$ cd laravel-realtime-chat
$ composer install

Step 3: Configure Database

Edit your database.php to match your local database settings.

    ...
	'connections' => array(

		'mysql' => array(
			'driver'    => 'mysql',
			'host'      => '<HOST>',
			'database'  => '<DATABASE>',
			'username'  => '<USERNAME>',
			'password'  => '<PASSWORD>',
			'charset'   => 'utf8',
			'collation' => 'utf8_unicode_ci',
			'prefix'    => '',
		),
    ...

Step 4: Migrate & Populate Database

Run these commands to create and populate your database:

$ php artisan migrate
$ php artisan db:seed

Step 5: Install NPM dependencies

CD into the nodejs folder and run npm install in order to have the all dependencies installed.

$ cd nodejs
$ npm install

Step 6: Run PHP's built-in development server

$ cd ..
$ php artisan serve

Step 7: Start Redis Server

$ redis-server

Step 8: Start the "Realtime" server (nodejs/server.js)

$ ./realtime.sh

That's it! Now you should be ready to go!

About

Realtime Chat w/ Laravel + Redis + Node.js + Socket.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •