Skip to content

treyan94/chat-laravel

Repository files navigation

Laravel Vue Chat

Laravel Vue Chat is a demo project used originally for an interview task. It uses Laravel 10 for the backend, Vue 3 for the frontend, and marries the two using Inertia.js. This project provides features of a holistic chat application, with an optional AI chatbot powered by OpenAI's GPT.

Laravel is a robust MVC PHP framework, Vue.js is a progressive JavaScript framework for building user interfaces, and Inertia.js is a library that combines the best of both to create a single-page application.

Prerequisites

Before you begin, ensure you have the following installed on your local development machine:

  • PHP 8.1 or later
  • Composer - A PHP dependency management tool.
  • Node.js and NPM - Node.js is a server-side JavaScript runtime environment. NPM is a package manager for Node.js.

Installation

Follow these steps to setup the Laravel Vue Chat:

  1. Clone the repository:

    git clone https://github.com/treyan94/chat-laravel.git
  2. Navigate into the project directory:

    cd chat-laravel
  3. Install the Composer dependencies:

    composer install
  4. Install the NPM dependencies:

    npm install
  5. Create a copy of your .env.example file and rename it to .env. This file houses all your environment variables.

    cp .env.example .env

    Obtain your API keys for Pusher which is used for enabling real-time bidirectional communication and optionally for OpenAI if you plan on using the AI Chatbot.

    Note: Be sure you enter your Pusher API keys BEFORE proceeding to the next step.

  6. Build your frontend assets:

    npm run build
  7. Generate and set your application key:

    php artisan key:generate
  8. Set up the database in your .env file. If you are using SQLite, you first need to create a new SQLite database file. This can be done with the touch command in your terminal:

    touch database/database.sqlite

    After creating the file, update your .env to reflect these database settings:

    DB_CONNECTION=sqlite
    DB_DATABASE=/absolute/path/to/database/database.sqlite
    

    Remember to replace /absolute/path/to/database/database.sqlite with the actual path to your sqlite database file. Your SQLite database is now ready for the migrations.

  9. Execute the database migrations and seeding:

    php artisan migrate --seed
  10. Bootstrap the queue worker:

    php artisan queue:work
  11. Fire up the application:

    php artisan serve

Upon successful setup, you will be able to access the application from your specified port, usually: http://localhost:8000.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages