- Book Review Application
The Book Review Application is a web-based platform where users can register, log in, and submit reviews for various books. Users can also view, edit, and delete their reviews, as well as see average ratings for each book.
-
User Authentication:
- Secure registration and login using Laravel Breeze.
- Only authenticated users can manage reviews.
-
Book Management:
- List of predefined books with details such as title, author, description, genre, isbn, and a cover image.
-
Review Management:
- Users can add, edit, or delete their reviews.
- Reviews include ratings (1-5 stars) and comments.
-
Review Display:
- Reviews are listed below each book.
- Displays the average rating for each book.
-
Responsive Design:
- User-friendly and mobile-compatible interface built with Tailwind CSS.
- Backend: Laravel 11 (PHP Framework)
- Frontend: Blade templates with Alpine.js and Tailwind CSS
- Database: MySQL
- Authentication: Laravel Breeze
- Dev Tools:
- NPM for frontend assets
- PHP 8.x or higher
- Composer
- MySQL
- Node.js and npm
-
Clone the Repository:
git clone https://github.com/faisalalisayyed/laravel-book-reviews cd laravel-book-reviews
-
Install Dependencies:
composer install npm install npm run dev
-
Set Up Environment Variables:
- Copy the
.env.example
file to.env
:cp .env.example .env
- Configure the database credentials in the
.env
file:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_username DB_PASSWORD=your_password
- Copy the
-
Generate the Application Key:
php artisan key:generate
-
Run Migrations and Seeders:
php artisan migrate --seed
-
Start the Development Server:
php artisan serve
Access the application at http://localhost:8000.
Column | Type | Description |
---|---|---|
id | bigint | Primary key |
title | string | Title of the book |
author | string | Author of the book |
description | text | Description of the book |
genre | string | Genre of the book |
cover_image | string | URL to cover image |
created_at | timestamp | Timestamp |
updated_at | timestamp | Timestamp |
Column | Type | Description |
---|---|---|
id | bigint | Primary key |
book_id | bigint | Foreign key to books table |
user_id | bigint | Foreign key to users table |
rating | tinyInteger | Rating (1-5 stars) |
review_text | text | Review content |
created_at | timestamp | Timestamp |
updated_at | timestamp | Timestamp |
- Managed by Laravel's authentication system.
- Register/Login:
- Register for an account or log in or use the test account
- email: text@example.com and password: Test1234
- View Books:
- Browse the list of books with details and average ratings.
- Add Reviews:
- Submit a review with a rating and optional comment.
- Manage Reviews:
- Edit or delete your reviews.
Here are some screenshots of the application:
- Add unit tests for key features.
- Document API endpoint using Postman or Swagger.
This project is licensed under the MIT License.
Feel free to fork the repository and submit pull requests for new features or bug fixes. Contributions are welcome!