Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tope19/microservices-with-symfony
This project consists of two microservices, "users" and "notifications", communicating via a message bus. The services are orchestrated using Docker Compose.
https://github.com/tope19/microservices-with-symfony
Last synced: about 15 hours ago
JSON representation
This project consists of two microservices, "users" and "notifications", communicating via a message bus. The services are orchestrated using Docker Compose.
- Host: GitHub
- URL: https://github.com/tope19/microservices-with-symfony
- Owner: Tope19
- Created: 2024-02-23T16:35:12.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-23T22:31:37.000Z (9 months ago)
- Last Synced: 2024-04-23T16:22:33.565Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Microservices Application with Docker
This project consists of two microservices, "users" and "notifications", communicating via a message bus. The services are orchestrated using Docker Compose.
## Overview
The microservices architecture allows for scalable, decoupled, and independently deployable components, enabling efficient development and maintenance of complex systems. In this setup, the "users" service handles user data submission, while the "notifications" service processes and logs the received data.
## Symfony
Symfony is a PHP web application framework used for building the microservices in this project. It provides a robust set of tools and features for developing scalable and maintainable applications.
## Docker Compose Configuration
The `docker-compose.yml` file defines the services and their configurations:
### Services
- **Redis**: Acts as the message broker for communication between microservices.
- **Users Service**: Handles user data submission via POST requests and dispatches events to the message broker.
- **Notifications Service**: Consumes events from the message broker and logs the received data.### Ports
- **Users Service**: Exposed on port 8000.
- **Notifications Service**: Exposed on port 8001.### Volumes
- Both services mount volumes for log storage to persist logs outside the containers.
## Task Description
The microservices application follows these requirements:
1. **User Service**:
- Exposes an endpoint `POST /users` to receive user data (`{"email","firstName","lastName"}`) and stores it in the database.
- Upon data submission, generates an event and sends it through the message broker to the "notifications" service.2. **Notifications Service**:
- Consumes events from the message broker.
- Logs the received data in a log file.3. **Test Coverage**:
- The codebase is covered with unit, integration, and functional tests to ensure reliability and correctness.## Instructions
### Setup and Testing
1. **Clone the Repository**:
```bash
git clone https://github.com/Tope19/microservices-with-symfony2. **Navigate to the Project Directory**:
```bash
cd microservicesdocker-compose build
docker-compose up -d# For Users Service
docker-compose exec users php bin/phpunit testdocker-compose down
### API Endpoints
http://localhost:8000/api/v1/users/create