Skip to content

vladimircuriel/bookhive

Repository files navigation

BookHive - Microservices E-Commerce

BookHive


BookHive is a microservices-based web platform for discovering, purchasing, and reviewing books, designed with high availability, scalability, and distributed traceability at its core.

Table of Contents

Features

  • Microservices-Based Architecture: Independent services built with Spring Boot and Spring Cloud, deployed autonomously and communicating through synchronous REST APIs.

  • Centralized Discovery & Configuration: Service registration via Spring Cloud Netflix Eureka and centralized configuration using Spring Cloud Config Server.

  • API Gateway: Spring Cloud Gateway provides a single entry point with dynamic routing, request filtering, load balancing, and security enforcement.

  • Book Catalog Management: Search and browse books by title, author, and genre. Catalog data is persisted in MongoDB and populated with sample data using DataFaker.

  • Shopping Cart & Orders: Full CRUD for cart items and orders, backed by a relational database (PostgreSQL) to ensure consistency and transactional integrity.

  • User Authentication & Authorization: Secured with Spring Security and JSON Web Tokens (JWT). Supports ADMIN and CLIENT roles with fine-grained access control.

  • User Reviews & Ratings: Users can publish and view book reviews and ratings, stored in PostgreSQL and linked to catalog entries.

  • Payment Integration: Electronic payments handled through PayPal, simulating real purchase flows within the platform.

  • Email Notifications & Billing: Transactional email service sends registration confirmations and purchase receipts. Invoices are generated as PDFs using JasperReports and delivered via SMTP.

  • Distributed Tracing & Observability: Zipkin integration across all services enables end-to-end request tracing and performance diagnostics.

  • Scalability & High Availability: Each microservice runs with multiple instances. Load distribution and health checks are handled by the API Gateway.

  • Modern Frontend Architecture: Built with Next.js App Router, combining Server Components and Client Components for optimal performance, SEO, and interactivity.

  • Global State Management: Lightweight global state handled with Zustand, primarily for shopping cart synchronization and UI state.

  • Secure Client–Server Communication: All inter-service and client requests are protected with HTTPS, JWT validation, and strict CORS policies enforced at the Gateway.

  • Containerized Deployment: All services, databases, and observability tools are containerized with Docker and orchestrated using Docker Compose, including replica definitions, networks, and shared volumes.

  • Environment-Based Configuration: Service ports, credentials, security settings, and external integrations are fully configurable via environment variables.

  • Tech Stack

    • Backend: Java, Spring Boot, Spring Cloud (Eureka, Gateway, Config), Spring Security, JWT
    • Databases: MongoDB, PostgreSQL
    • Frontend: Next.js, React, Tailwind CSS, Zustand
    • Observability: Zipkin
    • Payments & Reporting: PayPal, JasperReports
    • Containerization: Docker, Docker Compose

Application

A showcase is available in my portfolio!

Tools Used

  • Spring Boot Spring Boot: Core backend framework used to implement independent microservices for catalog, orders, reviews, authentication, notifications, and billing.

  • Spring Cloud Spring Cloud: Provides service discovery (Eureka), centralized configuration (Config Server), and API Gateway for routing, load balancing, and resilience.

  • Spring Security Spring Security: Handles authentication and authorization using role-based access control (ADMIN / CLIENT) across all microservices.

  • JWT JSON Web Tokens (JWT): Stateless authentication mechanism used to secure client requests and inter-service communication.

  • MongoDB MongoDB: NoSQL database used to store and index the book catalog, enabling flexible search by title, author, and genre.

  • PostgreSQL PostgreSQL: Relational database used for shopping carts, orders, user reviews, and transactional data.

  • Redis Redis: In-memory data store used for caching, session handling, and improving performance across distributed services.

  • Zipkin Zipkin: Distributed tracing system used to track requests across microservices and identify performance bottlenecks.

  • Next.js Next.js: Frontend framework using App Router, Server Components, and Client Components to deliver a performant and SEO-friendly user interface.

  • React React: Core UI library for building interactive components such as the catalog, shopping cart, checkout flow, and review system.

  • Zustand Zustand: Lightweight state management library used to maintain global client-side state, primarily for the shopping cart.

  • Tailwind CSS Tailwind CSS: Utility-first CSS framework used to build a modern, responsive, and consistent UI.

  • PayPal PayPal: External payment gateway integrated to handle electronic payments and simulate real-world purchase flows.

  • JasperReports JasperReports: Reporting engine used to generate PDF invoices and billing documents.

  • Docker Docker: Containerization platform used to package each microservice, database, and auxiliary tool.

  • Docker Compose Docker Compose: Orchestration tool defining and running the complete BookHive ecosystem with multiple services, replicas, networks, and volumes.

About

BookHive is a microservices-based bookstore e-commerce with payments, statistics, dashboards in a modern UI.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages