How pralayeshmukherjee/bookie works
Project Type and Purpose
• Bookie is a full-stack marketplace application that evolved from a digital library concept.
• It includes a React (Vite) frontend and a Spring Boot backend, with MySQL as the database.
• Core functionalities include user registration and login, book listings, inventory management for sellers, secure payments, and even an AI-powered chatbot for personalized recommendations.
Break Down the File Structure
• The project is distinctly separated into two major folders: “frontend” and “Backend.”
• In the backend directory, the structure is organized under a Maven project with defined packages for configuration (e.g., CORSConfig), DTOs, controllers, service layers, repositories, and entities. This clearly defines the MVC (Model-View-Controller) pattern in the backend’s architecture.
Key Components
• Frontend:
• User Interface Components: Breaking down components into “Landing,” “Login/Register” (for Librarian, Seller, User), “MainPages,” “ProductSection,” etc.
• Client-Side Routing & State Management: Recognize the role of React’s component hierarchy and context (as seen in the “Contexts” folder).
• Backend:
• Controllers: Multiple REST controllers (e.g., BooksController, LibrarianController, LibraryController, ChatController) that accept incoming HTTP requests.
• Service Layer: Business logic handling (BookService, SellerService, UserService, OTPService, etc.).
• Repository Layer: Data access objects interfacing with the MySQL database.
• DTOs: Data Transfer Objects which encapsulate request and response payloads.
• Entities: Mapping the data model (Book, User, Librarian, Library, etc.).
• Configuration: Important aspects like CORS and database connectivity.
• Database:
• MySQL as the central data store with schema support for books, users, librarians, sellers, etc.
Architectural Patterns and Design Principles
• The backend follows the MVC layered architecture with strongly separated concerns (controllers, services, repositories, and DTOs).
• The frontend is componentized using React’s best practices with emphasis on reusability (e.g., multiple login and register components).
• The system leverages RESTful APIs to communicate between the frontend and backend.
• For integration, expect components such as the AI-powered chatbot and upcoming features like payment gateway and map integration that may require external API services.