Git Product home page Git Product logo

jareerzeenam / laravel-forum Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 575 KB

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.

PHP 52.15% JavaScript 1.01% CSS 0.03% Vue 46.30% Blade 0.51%
algolia-search inertiajs laravel laravel-scout lazy-loading pestphp php8 policies tiptap-editor vue3

laravel-forum's Introduction

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.


laravel-forum's People

Contributors

jareerzeenam avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.