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.
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:
- Integrated with Laravel Scout and Algolia for advanced search functionality.
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.
Follow these steps to get the project up and running on your local machine.
-
Clone the repository:
git clone https://github.com/jareerzeenam/laravel-forum.git cd laravel-forum
-
Install dependencies:
composer install npm install
-
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.
- Copy the
-
Generate the application key:
php artisan key:generate
-
Run migrations:
php artisan migrate
-
Seed the database:
php artisan db:seed
-
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
-
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.
- 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:
-
Run the development server:
php artisan serve npm run dev
This project uses Pest PHP for testing. To run the test suite, use the following command:
php artisan test
- 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.
Contributions are welcome! Please open an issue or submit a pull request for any changes or enhancements.
This project is open-source and available under the MIT license.