A full-stack MERN (MongoDB, Express.js, React, Node.js) mini-Facebook clone with real-time features powered by Socket.IO, built with modern best practices in authentication, UI, and state management.
- User Authentication using JWT (access + refresh tokens).
- Login with Google OAuth2.
- Create, like, and comment on posts.
- Like comments as well.
- Photo upload with preview when creating a post.
- View each post in a modal, similar to Facebook.
- Real-time synchronization of:
- Post creation
- Likes/unlikes
- Comment creation
- Comment likes
- JWT-based:
- Access Token: stored in memory (expires in 15 mins)
- Refresh Token: stored in HttpOnly cookie (expires in 7 days)
- Managed globally with
AuthContextin React.
- TanStack React Query for caching and managing async data.
- Axios for API calls.
- Socket.IO for real-time communication (frontend + backend).
- React Hook Form for forms and validation.
- Global
ModalContextfor modal state management.
Built with React + Tailwind CSS
@tanstack/react-query– for fetching and cachingaxios– API requestsreact-hook-form– form handlingsocket.io-client– real-time event handling@react-oauth/google– Google loginjwt-decode,moment,sweetalert2, etc.
Built with Node.js + Express + MongoDB (Mongoose)
bcryptjs– password hashingjsonwebtoken– JWT creation & verificationcookie-parser– parsing HttpOnly cookiesmulter– handling file uploadssocket.io– real-time communicationgoogle-auth-library– OAuth2 validation