🚀 Welcome to Mini LinkedIn, a minimalist clone of social media (like LinkedIn) that represents basic operations like adding posts along with images, user registration, and log in with proper authentication and authorization ensured with JWT Tokens.
Our target is to build a monolithic application first. Later we'll convert it into a microservice for scalability and other production-related purposes.
-
Main (Current): The complete monolithic version of our Mini-Linkedin. Here the frontend and backend is organized separetly and you'll find the execution instruction here.
-
Micro - 1: In this branch, we initially divided our app into 3 different Services. Then, we containerized them using Dockerfile and Docker Compose to ensure that your services are distinctly running perfectly.
-
Microservice: In this branch, instead of running 3 pairs of Dockerfile and Docker Compose for 3 services, we have used One single docker-compose file in root directory to host the entire app (both frontend & backend). However, the frontend is still not connected with Nginx.
-
Final: In this branch, we finally deployed the Frontend in Production mode. That's why you'll see both a Dockerfile and Docker Compose in the root directory where this Dockerfile helps to connect our frontend with Nginx.
This version of the app supports the following features:
✅ Registering user
✅ Login user
✅ Authenticating User using JWT Token
✅ Making Post along with Image
✅ Uploading & Showing images from Minio
✅ Notification for newly created posts
✅ Redirecting to the particular post by clicking notifications
✅ Notification Mark as read feature enabled
✅ Notification Cleaner (clear already read notifications every 30 minutes)
-
Clone the project:
git clone https://github.com/ahmedfahad04/Distributed-System.git
-
Navigate to the project directory:
cd Distributed-System
-
Configure the .env folder with the following fields:
ACCESS_TOKEN='************************' REFRESH_TOKEN='************************' ACCESS_TOKEN_EXPIRES='1h' REFRESH_TOKEN_EXPIRES='2d'
-
Install and start Minio:
- Follow this guide to install Minio on your Linux machine.
- Start the Minio server:
sudo ./minio server /minio
-
Install and start MongoDB:
- Follow the official MongoDB installation documentation to install MongoDB on your local machine.
- Ensure MongoDB is running:
sudo systemctl status mongod
If MongoDB is not running, start it:
sudo systemctl start mongod
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the frontend app:
npm start
-
Navigate to the backend directory:
cd backend
-
Install dependencies:
npm install
-
Start the backend server:
npm start
CAUTION:
-
Each time you run the Minio server, a new IP address will be assigned. Therefore, you have to change this IP in the code in two places. Firstly, in the
frontend
folder, make changes to thePost.js
file where we have used the URL to show the image. Secondly, in thebackend
folder'simageUploadController.js
file where the endpoint of Minio is defined. -
You need to UPDATE the POLICIES to PUBLIC so that the image URL can be accessed from anywhere. You have to update it from the Minio Console that runs on the web at this URL:
http://<url>/buckets/<bucket-name>/admin/summary
- Client: React, TailwindCSS
- Server: Node, Express
- Database: Minio, MongoDB
Enjoy exploring Mini LinkedIn! 😃👥🌟