Skip to content

A fully-featured Pinterest clone built with the MERN stack (MongoDB, Express, React, Node.js), featuring user authentication, image uploads, interactive pins, comments, like/unlike, follow/unfollow and user profiles

Notifications You must be signed in to change notification settings

faisal-din/pinterest-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Œ - A Pinterest Clone by Faisal Din

A fully-featured Pinterest clone built with the MERN stack (MongoDB, Express, React, Node.js), featuring user authentication, image uploads, interactive pins, comments, like/unlike, follow/unfollow and user profiles.

✨ Features

πŸ” Authentication & Authorization

  • Secure user registration and login system
  • Password encryption with bcryptJS
  • JWT token-based authentication
  • Protected routes for authenticated users

πŸ“± User Interface

  • Responsive design that works on all devices
  • Complete Pinterest-style landing page for non-authenticated users
  • Complete Explore page where users can view all pins and also based on different categories
  • Intuitive navigation with dynamic navbar based on user authentication status
  • Masonry layout for pins display

πŸ“Œ Pin Management

  • Create pins with image uploads (via Cloudinary)
  • View all pins on the home feed
  • Search functionality to find specific pins
  • Detailed individual pin pages
  • Edit and delete pins (for pin owners)
  • Like and unline pins

πŸ’¬ Social Features

  • Comment on pins
  • Delete your own comments
  • Follow/unfollow other users
  • View user profiles

πŸ› οΈ Technologies Used

Frontend

  • React.js
  • React Router for navigation
  • Context API for state management
  • Axios for API requests
  • Tailwind CSS for styling

Backend

  • Node.js
  • Express.js
  • MongoDB (with Mongoose)
  • JWT for authentication
  • bcryptJS for password hashing

Storage

  • Cloudinary for image uploads and storage

πŸ“ Future Improvements

  • Implement notifications system
  • Add pin collections/boards
  • Add save and unsave pin
  • Add social sharing options
  • Implement infinite scrolling for pins

πŸ“Έ Screenshots

Landing Page

Landing Page

Explore Page

Explore Page

Login Page

Login Page

Sign-Up Page

Sign-Up Page

Home Feed

Home Feed

Pin Detail Page

Pin Detail

Create Pin Page

Create Pin

Edit Pin Page

Edit Pin

User Profile

User Profile

Edit User Profile

Edit User Profile

πŸš€ Getting Started

Prerequisites

  • Node.js
  • MongoDB
  • Cloudinary account

Installation

  1. Clone the repository
git clone https://github.com/yourusername/pinspire.git
cd pinspire
  1. Install dependencies for both frontend and backend
# Install backend dependencies
cd backend
npm install

# Install frontend dependencies
cd ../frontend
npm install
  1. Create a .env file in the backend directory with the following variables
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
JWT_EXPIRE=jwt expiry period i,e 1d, 7d etc
NODE_ENV=production
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
  1. Start the development servers
# Start backend server (from backend directory)
npm run dev

# Start frontend server (from frontend directory)
npm start
  1. Open your browser and go to http://localhost:3000

πŸ“‹ API Endpoints

Authentication

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Login user
  • POST /api/auth/logout - Logout user

User

  • GET /api/auth/me - Get user profile
  • GET /api/auth/user/:id - Get user profile by id
  • PUT /api/auth/profile - Update user profile
  • POST /api/auth/follow/:id - Follow or Unfollow a user by ID

Pins

  • GET /api/pins - Get all pins
  • GET /api/pins/:id - Get a specific pin
  • POST /api/pins/create - Create a new pin
  • PUT /api/pins/:id - Update a pin
  • DELETE /api/pins/:id - Delete a pin
  • PUT /api/pins/:id/toggleLike - Like and Unlike a pin

Comments

  • GET /api/pins/:pinId/comments - Get All comments
  • GET /api/pins/:pinId/comments/:id - Get a single comment
  • POST /api/pins/:pinId/comments/create - Add/Create a comment
  • PUT /api/pins/:pinId/comments/:id - Update a comment
  • DELETE /api/pins/:pinId/comments/:id - Delete a comment

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

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“ž Contact


⭐ If you find this project helpful, please give it a star on GitHub! ⭐

About

A fully-featured Pinterest clone built with the MERN stack (MongoDB, Express, React, Node.js), featuring user authentication, image uploads, interactive pins, comments, like/unlike, follow/unfollow and user profiles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages