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

- 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
- 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
- Node.js with Express.js
- MongoDB database with Mongoose ODM
- JWT for authentication
- ImageKit for image processing and storage
- React: UI library
- React Router: Client-side routing
- Zustand: Lightweight state management
- TanStack Query: Data fetching and caching
- CSS: Custom styling
- 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
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/
βββ 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
- Node.js (v14 or higher)
- MongoDB
- ImageKit account
- Clone the repository
git clone https://github.com/yourusername/pinterest-clone.git
cd pinterest-clone- Install backend dependencies
cd Backend
npm install- Install frontend dependencies
cd ../Frontend
npm install- Create a
.envfile 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
- Start the backend server
npm start- Start the frontend development server
cd ../Frontend
npm run dev- Open your browser and navigate to
http://localhost:5173
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.
The application uses JWT tokens stored in HTTP-only cookies for secure authentication. Registration and login forms are provided in the AuthPage component.
Users can:
- Follow/unfollow other users
- Like and save pins
- Comment on pins
- Create and organize boards for saved pins
The application is designed to work across various screen sizes, with responsive layouts for the pin grid and post views.
Instructions for running tests (coming soon)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspiration: Pinterest
- Icons and assets from [source]