Skip to content

mohankumaronly/LinkedIn-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

97 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ό MERN LinkedIn Clone

MERN Frontend Backend Database Auth Deployment Docker Status

A full-stack LinkedIn-style social platform built using the MERN stack, featuring secure authentication, user profiles, post feeds, and social networking features.


πŸ”— Live Demo


πŸ“Έ Screenshots


🏠 Landing Page

Landing Landing


πŸ” Authentication

Login Register


πŸ“° Feed

Feed Feed


πŸ‘€ Profile

User Profile Public Profile


🌍 Explore Users

Explore


πŸ”” Notifications

Notifications


βš™οΈ Settings

Settings


πŸ’¬ Chat (🚧 Work in Progress)

Chat


🧠 Project Overview

This project replicates core LinkedIn functionalities, focusing on:

  • Secure authentication system
  • User profile management
  • Feed-based content sharing
  • Social graph (follow/unfollow)
  • Scalable and modular architecture

πŸš€ Features


πŸ” Authentication (βœ… Production Ready)

πŸ” Reused from: πŸ‘‰ https://github.com/mohankumaronly/Authentication_using_MERN

  • Email + Password login
  • Google OAuth 2.0
  • JWT Access & Refresh Tokens
  • HTTP-only cookie-based authentication
  • Email verification system
  • Forgot / Reset password flow
  • Persistent login (/me)
  • Secure logout & token rotation

πŸ‘€ Profile System (βœ…)

  • Create & update profile
  • Upload avatar (Cloudinary)
  • Public / private profile visibility
  • View other users' profiles

πŸ“° Posts & Feed (βœ…)

  • Create post
  • Edit & delete post
  • Like posts
  • Global feed
  • User-specific posts

🀝 Social Features (βœ…)

  • Follow / Unfollow users
  • Followers / Following list
  • Connection statistics

πŸ’¬ Comments (🚧)

  • Partially implemented

πŸ’¬ Realtime Chat (🚧)

  • Backend structure ready
  • WebSocket integration in progress

🧱 Tech Stack


πŸ–₯️ Backend

  • Node.js + Express
  • MongoDB + Mongoose
  • JWT Authentication
  • Google OAuth 2.0
  • Cloudinary (media uploads)
  • Nodemailer / Brevo (emails)
  • Rate Limiting + Security Middleware

🌐 Frontend

  • React (Vite)
  • React Router v6
  • Context API
  • Axios (interceptors)
  • Tailwind CSS

βš™οΈ DevOps & Deployment

  • Docker & Docker Compose
  • Render (Backend - Free Tier)
  • Vercel (Frontend)
  • Nginx (Frontend container)

πŸ” Authentication Flow

Login / OAuth
β†’ Access Token (httpOnly cookie)
β†’ Refresh Token (stored in DB + cookie)
β†’ Access expires
β†’ Silent refresh (/refresh-token)
β†’ Retry request

πŸ“‚ Project Structure


πŸ“¦ Backend

backend/
│── server.js
│── package.json
│── Dockerfile
│── Dockerfile.dev
│── .env
β”‚
β”œβ”€β”€ configuration/
β”‚   └── db.js
β”‚
β”œβ”€β”€ middlewares/
β”‚   β”œβ”€β”€ rate.limiter.js
β”‚   └── token.verification.js
β”‚
β”œβ”€β”€ modules/
β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ routers/
β”‚   β”‚   └── validators/
β”‚   β”‚
β”‚   β”œβ”€β”€ profile/
β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   └── routers/
β”‚   β”‚
β”‚   β”œβ”€β”€ posts/
β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   └── routes/
β”‚   β”‚
β”‚   └── chat/   (WIP)
β”‚       β”œβ”€β”€ controllers/
β”‚       β”œβ”€β”€ models/
β”‚       └── routes/
β”‚
└── utils/
    β”œβ”€β”€ cloudinary.js
    β”œβ”€β”€ sendEmail.js
    └── Emails/

🎨 Frontend

frontend/
│── Dockerfile
│── Dockerfile.dev
│── vite.config.js
│── vercel.json
β”‚
β”œβ”€β”€ public/
β”‚   └── assets
β”‚
└── src/
    │── App.jsx
    │── main.jsx
    β”‚
    β”œβ”€β”€ assets/
    β”œβ”€β”€ common/
    β”œβ”€β”€ components/
    β”œβ”€β”€ context/
    β”‚   └── AuthContext.jsx
    β”‚
    β”œβ”€β”€ Hooks/
    β”œβ”€β”€ layouts/
    β”‚   └── LayoutComponents/
    β”‚
    β”œβ”€β”€ pages/
    β”‚   β”œβ”€β”€ Auth/
    β”‚   β”œβ”€β”€ Home/
    β”‚   β”œβ”€β”€ posts/
    β”‚   β”œβ”€β”€ payment/ (not used)
    β”‚   └── NotFound/
    β”‚
    β”œβ”€β”€ Routers/
    β”‚   └── AppRouters.jsx
    β”‚
    └── services/
        β”œβ”€β”€ api.js
        β”œβ”€β”€ auth.service.js
        β”œβ”€β”€ post.service.js
        β”œβ”€β”€ profile.service.js
        └── chat.service.js

🐳 Docker Setup

Development

docker-compose -f docker-compose.dev.yml up --build

Production

docker-compose up --build

πŸ§ͺ Running Locally

git clone https://github.com/your-username/linkedin-clone.git
cd linkedin-clone

# Backend
cd backend
npm install
npm run dev

# Frontend
cd frontend
npm install
npm run dev

πŸ”’ Security Highlights

  • HTTP-only cookies (XSS protection)
  • Refresh token rotation
  • Rate limiting
  • Secure OAuth flow
  • Input validation

🚧 Roadmap

  • βœ… Authentication
  • βœ… Profiles
  • βœ… Posts
  • 🚧 Comments
  • 🚧 Chat (WebSockets)
  • ⏳ Notifications improvements
  • ⏳ Search system

⭐ Key Highlights

  • πŸ” Production-ready authentication system
  • 🧱 Modular backend architecture
  • ⚑ Clean & scalable frontend
  • 🐳 Dockerized setup (dev + prod)
  • 🌐 Fully deployed (Render + Vercel)

πŸ‘¨β€πŸ’» Author

Mohan Kumar


πŸ“œ License

MIT License

Releases

No releases published

Packages

 
 
 

Contributors

Languages