Skip to content

Koooowal/pinterest-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Pinterest Clone

A full-stack web application that mimics core Pinterest functionality, allowing users to discover, save, and share visual content. Koowal Pinterest

πŸ“‹ Features

  • User Authentication: Register and login functionality with JWT authentication
  • Content Discovery: Browse visual content in a Pinterest-style masonry grid layout
  • Profile Management: View and edit user profiles
  • Social Interactions: Follow users, like and save pins, comment on posts
  • Content Creation: Upload and customize images with text overlays
  • Content Organization: Create boards to organize saved pins
  • Search Functionality: Search for pins by title or tags

πŸ—οΈ Architecture

Frontend

  • React.js with React Router for client-side navigation
  • State management with Zustand (editorStore, authStore)
  • React Query for data fetching and caching
  • Lazy loading for optimized performance

Backend

  • Node.js with Express.js
  • MongoDB database with Mongoose ODM
  • JWT for authentication
  • ImageKit for image processing and storage

πŸ”§ Technical Stack

Frontend

  • React: UI library
  • React Router: Client-side routing
  • Zustand: Lightweight state management
  • TanStack Query: Data fetching and caching
  • CSS: Custom styling

Backend

  • Node.js: Runtime environment
  • Express.js: Web framework
  • MongoDB: NoSQL database
  • Mongoose: ODM for MongoDB
  • JWT: Authentication
  • bcrypt.js: Password hashing
  • Sharp: Image processing
  • ImageKit: Image hosting and transformations

πŸ“ Project Structure

Frontend

Frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Components/
β”‚   β”‚   β”œβ”€β”€ Editor/             # Image editing functionality
β”‚   β”‚   β”œβ”€β”€ Gallery/            # Pin display grid
β”‚   β”‚   β”œβ”€β”€ Image/              # Image component
β”‚   β”‚   β”œβ”€β”€ LeftBar/            # Navigation sidebar
β”‚   β”‚   β”œβ”€β”€ TopBar/             # Top navigation bar
β”‚   β”‚   β”œβ”€β”€ PostInteractions/   # Like, save functionality
β”‚   β”‚   β”œβ”€β”€ Comments/           # Comments section
β”‚   β”‚   └── Boards/             # User boards display
β”‚   β”œβ”€β”€ Routes/
β”‚   β”‚   β”œβ”€β”€ AuthPage/           # Login/Register
β”‚   β”‚   β”œβ”€β”€ CreatePage/         # Pin creation
β”‚   β”‚   β”œβ”€β”€ HomePage/           # Main feed
β”‚   β”‚   β”œβ”€β”€ Layouts/            # Page layouts
β”‚   β”‚   β”œβ”€β”€ PostPage/           # Single pin view
β”‚   β”‚   β”œβ”€β”€ ProfilePage/        # User profile
β”‚   β”‚   └── SearchPage/         # Search results
β”‚   β”œβ”€β”€ Utility/
β”‚   β”‚   β”œβ”€β”€ apiRequest.js       # API client
β”‚   β”‚   β”œβ”€β”€ authStore.js        # Authentication state
β”‚   β”‚   └── editorStore.js      # Editor state
β”‚   β”œβ”€β”€ main.jsx                # App entry point
β”‚   └── index.css               # Global styles

Backend

Backend/
β”œβ”€β”€ Controller/
β”‚   β”œβ”€β”€ board.controller.js     # Board management
β”‚   β”œβ”€β”€ comment.controller.js   # Comment functionality
β”‚   β”œβ”€β”€ pin.controller.js       # Pin CRUD operations
β”‚   └── user.controller.js      # User authentication & profile
β”œβ”€β”€ Models/
β”‚   β”œβ”€β”€ board.model.js          # Board schema
β”‚   β”œβ”€β”€ comment.model.js        # Comment schema
β”‚   β”œβ”€β”€ follow.model.js         # User follows
β”‚   β”œβ”€β”€ like.model.js           # Pin likes
β”‚   β”œβ”€β”€ pin.model.js            # Pin schema
β”‚   β”œβ”€β”€ save.model.js           # Saved pins
β”‚   └── user.model.js           # User schema
β”œβ”€β”€ Routes/
β”‚   β”œβ”€β”€ board.route.js          # Board endpoints
β”‚   β”œβ”€β”€ comment.route.js        # Comment endpoints
β”‚   β”œβ”€β”€ pin.route.js            # Pin endpoints
β”‚   └── user.route.js           # User endpoints
β”œβ”€β”€ Utilities/
β”‚   └── connectDB.js            # Database connection
└── index.js                    # Server entry point

πŸš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB
  • ImageKit account

Installation

  1. Clone the repository
git clone https://github.com/yourusername/pinterest-clone.git
cd pinterest-clone
  1. Install backend dependencies
cd Backend
npm install
  1. Install frontend dependencies
cd ../Frontend
npm install
  1. Create a .env file in the Backend directory with the following variables:
PORT=3000
MONGODB_URI=your_mongodb_connection_string
JWT_TOKEN=your_secret_jwt_key
CLIENT_URL=http://localhost:5173
IMAGEKIT_PUBLIC_KEY=your_imagekit_public_key
IMAGEKIT_PRIVATE_KEY=your_imagekit_private_key
IMAGEKIT_URL_ENDPOINT=your_imagekit_url_endpoint
  1. Start the backend server
npm start
  1. Start the frontend development server
cd ../Frontend
npm run dev
  1. Open your browser and navigate to http://localhost:5173

πŸ’‘ Key Features Explained

Image Upload and Editing

The application allows users to upload images and customize them with text overlays. The Editor component provides a workspace with text positioning, color selection, and canvas customization.

Authentication Flow

The application uses JWT tokens stored in HTTP-only cookies for secure authentication. Registration and login forms are provided in the AuthPage component.

Social Interactions

Users can:

  • Follow/unfollow other users
  • Like and save pins
  • Comment on pins
  • Create and organize boards for saved pins

Responsive Design

The application is designed to work across various screen sizes, with responsive layouts for the pin grid and post views.

πŸ§ͺ Testing

Instructions for running tests (coming soon)

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

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

πŸ™ Acknowledgments

  • Inspiration: Pinterest
  • Icons and assets from [source]

About

Full-stack Pinterest clone with masonry grid, image editor, boards, social interactions (follow, like, save) and search. Built with React, Node.js, MongoDB.

Topics

Resources

License

Stars

Watchers

Forks

Contributors