This documentation provides a comprehensive overview of a forum website built using Laravel 11, Vue 3, and Inertia.js. The application allows users to create posts and comments with rich text and markdown support. Authentication is handled via Jetstream's starter kit, ensuring secure and efficient user management.
- PHP 8.1+
- Composer
- Node.js and NPM
- MySQL or PostgreSQL
-
Clone the repository:
git clone [email protected]:MustafaM257/forum.git cd forum
-
Install dependencies:
composer install npm install npm run dev
-
Set up environment file:
cp .env.example .env
-
Configure database in
.env
file:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database DB_USERNAME=your_username DB_PASSWORD=your_password
-
Run migrations and seeders:
php artisan migrate --seed
-
Serve the application:
php artisan serve
Ensure to configure other services and settings in the .env
file according to your requirements, such as mail services, broadcasting, and cache drivers.
- User Authentication: Managed by Laravel Jetstream.
- Posts and Comments: Users can create posts and comments with rich text and markdown.
- Real-time Updates: Utilizing Inertia.js for smooth single-page application behavior.
- Resourceful Routes: CRUD operations for posts and comments.
- Rich Text Editing: Integrated rich text and markdown support for posts and comments.
The application follows a clean architecture approach, emphasizing separation of concerns and modularity.
app/Models
: Eloquent models.app/Http/Controllers
: Controllers handling HTTP requests.app/Providers
: manage data to be provided to frontendapp/Policies
: Authorization policies.resources/js
: Vue 3 components and Inertia pages.resources/views
: Blade templates for initial HTML.
Resources are used to transform models into JSON responses, ensuring a clear separation between the model data and the JSON structure exposed to the API.
app/Http/Resources/PostResource.php
app/Http/Resources/CommentResource.php
app/Http/Resources/UserResource.php
Policies manage the authorization logic for different actions within the application. Ensure policies are registered in the AuthServiceProvider
.
app/Policies/PostPolicy.php
app/Policies/CommentPolicy.php
- Register: Users can register via the registration form.
- Login: Registered users can log in to access their account.
- Password Reset: Users can reset their passwords via email.
- Create Post: Authenticated users can create new posts.
- Edit/Delete Post: Users can edit or delete their own posts.
- Comment on Post: Authenticated users can comment on posts.
- Edit/Delete Comment: Users can edit or delete their own comments.
We welcome contributions! Please fork the repository and submit pull requests.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is open-source and licensed under the MIT License. It is provided "as is" without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.