The BookStore is a multi-vendor online bookstore built using Laravel. It allows users (customers) to browse and purchase books from multiple sellers (publishers). The system supports book management, order processing, discounts, coupons, and user authentication with role-based access control.
you can use this NextJS project to test api
- Multi-Vendor Support: Publishers can manage their own books independently.
- Book Management: Add, update, delete, and restore books.
- Category Management: Organize books into categories.
- Order Management: Create and manage orders, apply discounts, and handle coupons.
- Authentication & Security: User login, registration, password reset, and email verification.
- Role-Based Access Control: Different roles for admins, publishers, and customers.
1. Auth Module
- Functionality: Handles user authentication, registration, password reset, and email verification.
- Features:
- Login for publishers and customers.
- Password reset via email.
- Email verification.
- Role-based access control (admin, publisher, customer).
2. Book Module
- Functionality: Manages books, including adding, updating, deleting, and restoring books.
- Features:
- Soft delete and restore functionality for books.
- Manage book details such as name, price, stock quantity, ISBN, publication date, etc.
- Link books to categories and publishers.
- Manage book cover images.
- Functionality: Manages categories for organizing books.
- Features:
- Create, update, and delete categories.
- Each category can have multiple books.
- Automatic slug generation for categories.
- Functionality: Manages publishers (sellers) and the books they publish.
- Features:
- Register and manage publisher accounts.
- Add and edit books for each publisher.
- Soft delete functionality for publishers.
5. Order Module
- Functionality: Manages customer orders.
- Features:
- Create and update orders.
- Apply discounts and coupons to orders.
- Calculate the total cost of orders.
- Create and update discounts.
- Generate unique coupon codes.
- Validate coupon codes.
6. Admin Module
- Functionality: Manages admins, publishers, and customers.
- Features:
- Add, update, and delete users.
- Soft delete and restore users.
- Manage roles and permissions.
The Helpers
class is a utility class designed to simplify the process of returning standardized JSON responses and logging errors in Laravel applications.
The CheckUserTokenAbility
middleware is responsible for verifying that incoming requests have the appropriate token abilities based on the URL path. It maps specific URL prefixes to guard names and checks if the authenticated user's token has the required abilities for the corresponding guard.
The Laravel framework is open-sourced software licensed under the MIT license.