Skip to content

🎨 A modern Pinterest clone built with Next.js 15, React 19, and TypeScript. Features infinite scroll, Google OAuth, Unsplash API integration, and beautiful responsive design. Discover, save, and organize millions of high-quality images effortlessly.

Notifications You must be signed in to change notification settings

PouyaBirvand/MegaPinterest

Repository files navigation

Pinterest Logo MegaPinterest

Discover endless inspiration in a beautifully crafted Pinterest clone

Next.js React TypeScript Tailwind CSS


✨ Features

🎯 Pin Discovery
Explore millions of high-quality images from Unsplash
πŸ“Œ Pin Creation
Create and share your own pins effortlessly
πŸ“‹ Board Management
Organize pins into custom boards
πŸ” Smart Search
Find exactly what you're looking for
πŸ‘€ Google Authentication
Secure login with Google OAuth
πŸŒ™ Dark/Light Mode
Toggle between themes seamlessly
πŸ“± Responsive Design
Perfect on all devices
⚑ Lightning Fast
Optimized performance with Next.js 15

πŸ–ΌοΈ Screenshots

Home Page Pin Details Board View Profile Page

πŸ› οΈ Tech Stack

Frontend Backend/API Styling Tools
Next.js Unsplash API Tailwind TypeScript
React Google OAuth Framer Motion ESLint
Radix UI Local Storage CSS3 Prettier

πŸ—οΈ Architecture

🎯 Simple & Effective

This project uses a client-side only architecture with:

  • Unsplash API as the sole backend service for images
  • Custom Google OAuth implementation for authentication
  • Local Storage for data persistence
  • No traditional database - keeping it lightweight and fast!

πŸ”„ Data Flow

User Authentication β†’ Google OAuth β†’ Local Storage
Image Data β†’ Unsplash API β†’ React State β†’ UI Components
User Actions β†’ Local Storage β†’ State Updates

πŸš€ Quick Start

Prerequisites

Make sure you have the following installed:

  • Node.js (v18 or higher)
  • npm or yarn
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/PouyaBirvand/megapinterest.git
    cd megapinterest
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Set up environment variables

    cp .env.example .env.local

    Fill in your API keys:

    NEXT_PUBLIC_UNSPLASH_ACCESS_KEY=your-unsplash-access-key
    NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-id
    NEXTAUTH_URL=http://localhost:3000
    NEXTAUTH_SECRET=your-secret-key
  4. Get your API keys

  5. Run the development server

    npm run dev
    # or
    yarn dev
  6. Open your browser Navigate to http://localhost:3000


πŸ“ Project Structure

megapinterest/
β”œβ”€β”€ πŸ“ app/                    # Next.js 13+ App Router
β”‚   β”œβ”€β”€ πŸ“ auth/              # Authentication pages
β”‚   β”œβ”€β”€ πŸ“ boards/            # Board management
β”‚   β”œβ”€β”€ πŸ“ explore/           # Explore page
β”‚   β”œβ”€β”€ πŸ“ pin/               # Pin details
β”‚   β”œβ”€β”€ πŸ“ pin-builder/       # Pin creation
β”‚   β”œβ”€β”€ πŸ“ profile/           # User profiles
β”‚   β”œβ”€β”€ πŸ“ saved/             # Saved pins
β”‚   └── πŸ“ settings/          # User settings
β”œβ”€β”€ πŸ“ components/            # Reusable components
β”‚   β”œβ”€β”€ πŸ“ boards/           # Board components
β”‚   β”œβ”€β”€ πŸ“ comments/         # Comment system
β”‚   β”œβ”€β”€ πŸ“ explore/          # Explore components
β”‚   β”œβ”€β”€ πŸ“ home/             # Home page components
β”‚   β”œβ”€β”€ πŸ“ layout/           # Layout components
β”‚   β”œβ”€β”€ πŸ“ pin/              # Pin components
β”‚   β”œβ”€β”€ πŸ“ pin-builder/      # Pin creation components
β”‚   β”œβ”€β”€ πŸ“ profile/          # Profile components
β”‚   β”œβ”€β”€ πŸ“ saved/            # Saved pins components
β”‚   β”œβ”€β”€ πŸ“ settings/         # Settings components
β”‚   └── πŸ“ ui/               # UI components
β”œβ”€β”€ πŸ“ contexts/             # React contexts
β”œβ”€β”€ πŸ“ hooks/                # Custom hooks
β”‚   β”œβ”€β”€ πŸ“ boardhooks/       # Board-related hooks
β”‚   β”œβ”€β”€ πŸ“ explorehooks/     # Explore-related hooks
β”‚   β”œβ”€β”€ πŸ“ pinhooks/         # Pin-related hooks
β”‚   └── useGoogleAuth.ts     # Custom Google Auth hook
β”œβ”€β”€ πŸ“ lib/                  # Utility functions
└── πŸ“ types/                # TypeScript types

🎯 Key Features Breakdown

🏠 Home Feed

  • Infinite scroll masonry layout
  • Real-time image loading from Unsplash API
  • Smart caching with local storage
  • Responsive grid system

πŸ“Œ Pin Management

  • Save pins from Unsplash to personal boards
  • Create custom boards and organize pins
  • Local storage persistence
  • Fast search and filtering

πŸ‘€ Authentication System

  • Custom Google OAuth implementation
  • No external auth libraries - built from scratch
  • Secure token management
  • Persistent login sessions

🎨 UI/UX Excellence

  • Pinterest-inspired design
  • Smooth animations with Framer Motion
  • Dark/Light theme support
  • Mobile-first responsive design

πŸ”§ Available Scripts

Command Description
npm run dev Start development server with Turbopack
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint
npm run format Format code with Prettier
npm run format:check Check code formatting

🌟 Performance Optimizations

  • ⚑ Next.js 15 with Turbopack for faster builds
  • πŸ–ΌοΈ Image Optimization with Next.js Image component
  • πŸ”„ Infinite Scrolling for better UX
  • πŸ“± Mobile-first responsive design
  • 🎨 Tailwind CSS for optimal styling
  • πŸ’Ύ Local Storage for instant data access
  • πŸš€ Client-side rendering for fast interactions

πŸ”‘ API Integration

Unsplash API Features Used:

  • Search Photos - Find images by keywords
  • Random Photos - Get random high-quality images
  • Photo Details - Fetch detailed photo information
  • Collections - Browse curated photo collections
  • User Photos - Get photos from specific photographers

Custom Google OAuth:

  • Manual implementation without external libraries
  • Token management with secure storage
  • User profile integration
  • Session persistence across browser sessions

🀝 Contributing

We love contributions! Here's how you can help:

  1. Fork the repository
  2. Create a 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.


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

Pouya

Pouya

Portfolio GitHub LinkedIn


πŸ™ Acknowledgments


Made with ❀️ and lots of πŸ€–

If you found this project helpful, please give it a ⭐

About

🎨 A modern Pinterest clone built with Next.js 15, React 19, and TypeScript. Features infinite scroll, Google OAuth, Unsplash API integration, and beautiful responsive design. Discover, save, and organize millions of high-quality images effortlessly.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •