This repository contains the code and documentation for the Distributed Systems Lab project - MiniFacebook. The project aims to demonstrate the process of developing a Monolithic structure for a social media platform and then transitioning it into a distributed system with three separate services: User Service, Story Service, and Status Service. Additionally, the project explores the use of a server proxy (NGINX) for load balancing, Docker for containerization of services, and Docker Compose for orchestration.
The repository is organized into the following directories:
miniFacebook/
: Contains the frontend code for the MiniFacebook application.server/
: Includes the backend services for User Service, Story Service, Status Service, and the frontend client used in orchestration.user/
: Contains the code for the User Service, responsible for managing user accounts and profiles.story/
: Includes the code for the Story Service, responsible for handling user stories.status/
: Contains the code for the Status Service, responsible for managing user statuses.client/
: Contains the frontend client code for the MiniFacebook application.nginx.config
: Includes the NGINX configuration file for load balancing and reverse proxy setup.docker-compose.yml
: The Docker Compose file for orchestrating the services.
To set up the project locally, follow the steps below:
- Clone the repository:
git clone https://github.com/jaf107/Distributed-Systems-Lab.git
cd distributed-systems-lab
-
Follow the instructions in each service directory (
user/
,story/
,status/
, andclient/
) to set up and run the respective services. -
Use Docker Compose to orchestrate the services using the
docker-compose.yml
file:
docker-compose up
In the initial version of the MiniFacebook application, the frontend and backend services are tightly coupled into a monolithic structure. This version provides a foundation for understanding the core functionalities and interactions of the platform.
The repository evolves from the monolithic version to a distributed system architecture. The services (user/
, story/
, status/
) are broken down into separate components to achieve better scalability, maintainability, and fault isolation.
The nginx.config
file in the server/
directory contains the configuration for the NGINX server proxy. NGINX is used to perform load balancing and act as a reverse proxy to distribute incoming requests among the various services in the distributed system.
Each service (user/
, story/
, status/
, and client/
) is dockerized for easy deployment and isolation of dependencies. Docker allows us to package the application along with its dependencies into containers, ensuring consistent behavior across different environments.
The docker-compose.yml
file in the server/
directory allows for easy orchestration of all the services using Docker Compose. Docker Compose simplifies the process of defining and running multi-container Docker applications.
Contributions to this project are welcome! If you have any bug fixes, improvements, or new features to add, please follow the standard Git workflow:
- Fork the repository.
- Create a new branch for your changes.
- Make the necessary changes and commit them.
- Push your changes to your forked repository.
- Submit a pull request to this repository with a detailed description of your changes.
This project is licensed under the MIT License, which allows for both personal and commercial use with proper attribution.
Feel free to update this Readme file with more detailed instructions, diagrams, and additional information as the project evolves. Happy coding!