Skip to content

A Book Review Application build in laravel 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.

License

Notifications You must be signed in to change notification settings

faisalalisayyed/laravel-book-reviews

Repository files navigation

Book Review Application

Table of Contents

Overview

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.

Features

  • 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.

Tech Stack

  • 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

Installation and Setup

Prerequisites

  • PHP 8.x or higher
  • Composer
  • MySQL
  • Node.js and npm

Steps

  1. Clone the Repository:

    git clone https://github.com/faisalalisayyed/laravel-book-reviews
    cd laravel-book-reviews
  2. Install Dependencies:

    composer install
    npm install
    npm run dev
  3. 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
  4. Generate the Application Key:

    php artisan key:generate
  5. Run Migrations and Seeders:

    php artisan migrate --seed
  6. Start the Development Server:

    php artisan serve

    Access the application at http://localhost:8000.

Database Schema

Books Table

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

Reviews Table

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

Users Table

  • Managed by Laravel's authentication system.

How to Use

  1. Register/Login:
    • Register for an account or log in or use the test account
    • email: text@example.com and password: Test1234
  2. View Books:
    • Browse the list of books with details and average ratings.
  3. Add Reviews:
    • Submit a review with a rating and optional comment.
  4. Manage Reviews:
    • Edit or delete your reviews.

Screenshots

Here are some screenshots of the application:

Home Page

Home Page 1 Home Page 2

Register and Login Page

register page login page

Profile Page

profile page 1 profile page 2

Book Details with Reviews

Book Details

Filter and Sort tab

filter 1 filter 2

Add Review Page

add review review added

edit Review Page

edit review review updated

delete Review Page

delete review review deleted

Future Enhancements

  • Add unit tests for key features.
  • Document API endpoint using Postman or Swagger.

License

This project is licensed under the MIT License.

Contribution

Feel free to fork the repository and submit pull requests for new features or bug fixes. Contributions are welcome!

About

A Book Review Application build in laravel 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.

Topics

Resources

License

Stars

Watchers

Forks

Languages