Skip to content

This is the practical of Distributed system where we are to made a minimalist app alike LinkedIn. Then we'll scale it through distributed system

Notifications You must be signed in to change notification settings

ahmedfahad04/Mini-LinkedIn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini LinkedIn - Distributed System Project

🚀 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.

Project Branches

  • 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.

Key Features

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)

How to Run Locally

  1. Clone the project:

    git clone https://github.com/ahmedfahad04/Distributed-System.git
  2. Navigate to the project directory:

    cd Distributed-System

Database Setup

  • 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:

    sudo systemctl status mongod

    If MongoDB is not running, start it:

    sudo systemctl start mongod

Running the Application

Frontend

  • Navigate to the frontend directory:

    cd frontend
  • Install dependencies:

    npm install
  • Start the frontend app:

    npm start

Backend

  • 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 the Post.js file where we have used the URL to show the image. Secondly, in the backend folder's imageUploadController.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

Tech Stack

  • Client: React, TailwindCSS
  • Server: Node, Express
  • Database: Minio, MongoDB

Enjoy exploring Mini LinkedIn! 😃👥🌟

About

This is the practical of Distributed system where we are to made a minimalist app alike LinkedIn. Then we'll scale it through distributed system

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages