Skip to content

This project consists of two microservices, "users" and "notifications", communicating via a message bus. The services are orchestrated using Docker Compose.

Notifications You must be signed in to change notification settings

Tope19/microservices-with-symfony

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:
    git clone https://github.com/Tope19/microservices-with-symfony
    
  2. Navigate to the Project Directory:
    cd microservices
    

docker-compose build docker-compose up -d

For Users Service

docker-compose exec users php bin/phpunit test

docker-compose down

API Endpoints

http://localhost:8000/api/v1/users/create

About

This project consists of two microservices, "users" and "notifications", communicating via a message bus. The services are orchestrated using Docker Compose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published