Welcome to BookLover Microservices, a mono-repo microservices project built with Laravel. This project is designed to handle user, book, and social functionalities through independent microservices. The API Gateway serves as a single entry point, simplifying client communication, improving security, and enabling load balancing. The architecture is scalable, modular, and supports independent deployment of microservices.
- Overview
- Features
- Prerequisites
- Getting Started
- Microservices
- API Gateway
- Configuration
- Testing
- Contributing
- License
BookLover Microservices is a distributed system that breaks down the traditional monolithic application into smaller, independent services. This architecture provides several advantages, including:
- Scalability: Each microservice can be scaled independently, allowing for efficient resource utilization.
- Modularity: Microservices are independently deployable and maintainable, promoting a modular and organized codebase.
- Security: Microservices communicate through the API Gateway, enforcing a centralized point for security measures such as authentication and authorization.
- Load Balancing: The API Gateway handles incoming requests and distributes them to the appropriate microservices, ensuring load balancing and high availability.
- User Microservice: Manages user-related functionalities, including authentication and user profile management.
- Book Microservice: Handles book-related operations such as adding, updating, and retrieving book information.
- Social Microservice: Supports social interactions, including comments, likes, and user connections.
Before you begin, ensure you have the following:
- Docker installed
- Docker Compose installed
- Laravel development environment set up
- Clone the repository:
git clone https://github.com/firasabdelaziz/BookLoverMicroServices.git
cd BookLoverMicroServices
- Build and run the services:
sh startMicroservices.sh
- Access the services:
- API Gateway: http://localhost:8000
- User Microservice: http://localhost:8001
- Book Microservice: http://localhost:8002
- Social Microservice: http://localhost:8003
- Manages user-related functionalities.
- Endpoints:
/users
: Retrieve user information./auth
: User authentication.
- Handles book-related operations.
- Endpoints:
/books
: Retrieve book information./books/add
: Add a new book.
- Supports social interactions.
- Endpoints:
/comments
: Retrieve comments for a book./likes
: Manage likes for a book./connections
: Manage user connections.
The API Gateway serves as the single entry point for client communication. It routes requests to the respective microservices based on the provided endpoint.
- API Gateway Endpoint: http://localhost:8000
The software architecture of BookLover Microservices is visualized using the Context, Containers, Components, and Code approach. This approach provides a comprehensive understanding of the system's architecture:
Context: Describes the external elements interacting with the system, such as users, external services, and other systems.
Containers: Identifies the high-level containers (e.g., microservices) and their interactions within the system.
Components: Breaks down each container into individual components, representing classes, modules, or packages.
Code: Represents the detailed code-level view, illustrating how components are implemented.
Adjust the configuration files in each microservice's directory (userService
, bookService
, socialService
) to customize settings such as database connections, environment variables, and service ports.
If you'd like to contribute to this project, please follow the CONTRIBUTING.md guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.