Skip to content

This Laravel-based forum uses Laravel Jetstream, Vue 3 (Composition API), and Inertia.js to deliver a modern, SPA-like experience. Built with a focus on Test Driven Development (TDD) using Pest PHP, it features Algolia-powered search, rich text editing with Tiptap, and robust user interactions.

Notifications You must be signed in to change notification settings

jareerzeenam/laravel-forum

Repository files navigation

Laravel Forum

Laravel Forum


This is a Laravel Jetstream project built with Vue 3 ( Composition API) and Inertia.js. The application follows Test Driven Development (TDD) principles using Pest PHP.

Features

User Authentication: Provided by Laravel Jetstream with Inertia.js and Vue 3.

CRUD Operations for Posts:

  • Create, Read, Update, and Delete posts.
  • Advanced filtering and pagination.
  • Search posts by title and content.
  • Filter posts by category.

Post Interactions:

  • Like/Dislike posts.
  • Add comments to posts.
  • Like/Dislike comments.
  • Disable editing of comments after 1 hour using Laravel Policies.

Advanced Search:

Rich Text Editor:

  • Implemented with the Tiptap headless editor to provide a robust WYSIWYG editor for creating and editing posts.

Performance Optimization:

  • Optimized database queries to avoid extra calls and load only necessary relationships.
  • Leveraged lazy loading and selected specific fields to prevent data overload.

Authorization:

  • Used Laravel Policies to handle various authorizations throughout the application.

Installation

Follow these steps to get the project up and running on your local machine.

  1. Clone the repository:

    git clone https://github.com/jareerzeenam/laravel-forum.git
    cd laravel-forum
  2. Install dependencies:

    composer install
    npm install
  3. Set up the environment:

    • Copy the .env.example file to .env:
      cp .env.example .env
    • Update the .env file with your database credentials and other settings.
  4. Generate the application key:

    php artisan key:generate
  5. Run migrations:

    php artisan migrate
  6. Seed the database:

     php artisan db:seed
  7. Install and configure Algolia (for search):

    • Register for an Algolia account and get your API keys.
    • Add your Algolia credentials to the .env file:
      ALGOLIA_APP_ID=your-app-id
      ALGOLIA_SECRET=your-algolia-secret
      
  8. Run the Laravel queue worker:

    • Laravel uses queues to handle background tasks. Ensure the queue worker is running to push updates to Algolia when a post is created, deleted, or edited:
      php artisan queue:work
    • You can also use a process manager like Supervisor to keep the queue worker running continuously in production.
  9. Run the development server:

    php artisan serve
    npm run dev

Testing

This project uses Pest PHP for testing. To run the test suite, use the following command:

php artisan test

Usage

  • Access the application via the development server.
  • Register or log in to start using the application.
  • You can create, edit, and manage posts, as well as interact with other users' posts through likes and comments.
  • Ensure the Laravel queue worker is running to sync your posts with Algolia for search indexing.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes or enhancements.

License

This project is open-source and available under the MIT license.


About

This Laravel-based forum uses Laravel Jetstream, Vue 3 (Composition API), and Inertia.js to deliver a modern, SPA-like experience. Built with a focus on Test Driven Development (TDD) using Pest PHP, it features Algolia-powered search, rich text editing with Tiptap, and robust user interactions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages