Skip to content

A react spa to preview most recent public images on flickr and bee able to search them by tag keyword. Also make a Wordpress Gutenburg plugin from it.

Notifications You must be signed in to change notification settings

gitmaz/flickr-preview

Repository files navigation

Flickr Feed Viewer

A modern, responsive React.js application for viewing and searching Flickr's public photo feeds. Built with clean code, professional styling, and excellent user experience.

Features

  • 🔍 Real-time Search: Instant search results as you type with debouncing
  • 🖼️ Image Gallery: Beautiful grid layout with hover effects and smooth animations
  • 👤 Author Information: Display photographer names with links to their Flickr profiles
  • 🏷️ Tag System: Show relevant tags for each photo
  • 📱 Responsive Design: Works perfectly on desktop, tablet, and mobile devices
  • Performance Optimized: Lazy loading, skeleton screens, and efficient API calls
  • 🎨 Modern UI: Professional design with gradients, shadows, and smooth transitions

Technical Implementation

Architecture

  • React 18 with functional components and hooks
  • Component-based architecture with clear separation of concerns
  • Service layer for API integration
  • CSS modules for scoped styling
  • Responsive design with mobile-first approach

Key Components

  1. App.js - Main application component managing state and coordination
  2. SearchBar.js - Real-time search input with debouncing and loading states
  3. ImageGrid.js - Responsive grid layout with loading skeletons and empty states
  4. ImageCard.js - Individual image display with hover effects and metadata
  5. flickrService.js - API service handling JSONP requests to Flickr

API Integration

  • Uses Flickr's public feed JSONP API
  • Implements proper error handling and loading states
  • Supports tag-based searching
  • Extracts high-resolution image URLs for full-size viewing

Getting Started

Prerequisites

  • Node.js (version 14 or higher)
  • npm or yarn package manager

Installation

  1. Clone or download the project files

  2. Install dependencies:

    npm install
  3. Start the development server:

    npm start
  4. Open http://localhost:3000 to view the application

Building for Production

npm run build

This creates an optimized production build in the build folder.

How to Use the App

🚀 Getting Started

  1. Start the Application:

    npm start

    The app will open at http://localhost:3000

  2. Initial Load: The app automatically loads recent Flickr photos when you first visit

🔍 Searching for Photos

  1. Automatic Search:

    • Type any keyword in the search box (placeholder: "Search in tags")
    • Searches only in photo tags, not titles or descriptions
    • Search requires at least 4 characters to trigger
    • Results appear automatically after 2 seconds of no typing (debouncing)
    • No search button needed - typing triggers search automatically
    • Allows uninterrupted typing of longer words - search only triggers when you stop typing
  2. Search Tips:

    • Tag-based search: Only finds photos that are explicitly tagged with your keyword
    • Use specific tag terms for better results (e.g., "landscape", "portrait", "street")
    • Try different keywords if you don't find what you're looking for
    • Clear the search by clicking the "X" button to return to recent photos
    • Note: Photos with keywords only in titles (not tagged) won't appear in results

🖼️ Viewing Images

  1. Browse the Gallery:

    • Photos are displayed in a responsive grid layout
    • Hover over images to see a "View Full Size" overlay
    • Images load lazily for better performance
  2. View Full Resolution:

    • Click on any image thumbnail to open the full-size version in a new tab
    • This opens the high-resolution image directly from Flickr
  3. Image Information:

    • Each image shows the title, author, and relevant tags
    • Author names are clickable links to their Flickr profiles

👤 Exploring Authors

  1. Author Profiles:
    • Click on any author name to visit their Flickr profile
    • Opens in a new tab to keep your current search results

🏷️ Understanding Tags

  1. Tag System:
    • Tags appear below each image
    • Shows up to 10 most relevant tags
    • Tags help you understand the photo's content and context

📱 Mobile Experience

  1. Responsive Design:
    • The app automatically adapts to your screen size
    • Touch-friendly interface on mobile devices
    • Optimized grid layout for different screen sizes

Performance Features

  1. Loading States:

    • Skeleton screens appear while images load
    • Loading spinner in search bar during API calls
    • Smooth transitions and animations
  2. Error Handling:

    • If an image fails to load, you'll see a friendly error message
    • Network errors are handled gracefully with retry options

🎯 Pro Tips

  • Keyboard Navigation: Use Tab to navigate through interactive elements
  • Accessibility: The app includes proper ARIA labels for screen readers
  • Performance: Images load progressively for faster initial page load
  • Offline: The app gracefully handles network issues

🔧 Troubleshooting

App won't start?

  • Make sure you've run npm install first
  • Check that Node.js version 14+ is installed
  • Try clearing your browser cache

No search results?

  • Check your internet connection
  • Try different search terms
  • The Flickr API might be temporarily unavailable

Images not loading?

  • Some images might be temporarily unavailable
  • Try refreshing the page
  • Check if your network blocks Flickr domains

Code Quality Features

  • Comprehensive Comments: All components and functions are well-documented
  • Error Handling: Graceful error states with user-friendly messages
  • Loading States: Skeleton screens and spinners for better UX
  • Accessibility: Proper ARIA labels and keyboard navigation
  • Performance: Debounced search, lazy loading, and optimized re-renders
  • Clean Code: Consistent naming conventions and modular structure

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

API Reference

The application uses Flickr's public feed API:

  • Endpoint: https://api.flickr.com/services/feeds/photos_public.gne
  • Format: JSONP
  • Search: Tag-based filtering only
  • Rate Limiting: No API key required for public feeds

Public Endpoint Limitations

⚠️ Important: The Flickr public feed API has several limitations:

  1. Recent Photos Only:

    • Only returns the most recently uploaded public photos
    • No access to historical photos or older uploads
    • Content is limited to what's been uploaded recently
  2. Tag-Based Search Only:

    • Search only works with photo tags, not titles or descriptions
    • Photos with keywords only in titles won't appear in search results
    • Only finds photos explicitly tagged by photographers
  3. No Advanced Filtering:

    • No date range filtering
    • No user-specific filtering
    • No geographic filtering
    • Limited to basic tag matching
  4. For Full Search Capabilities:

    • Use Flickr's full Search API (flickr.photos.search) for title/description search
    • Requires API key registration
    • Supports date ranges, user filtering, and text-based search

Contributing

This is a demonstration project showcasing React.js best practices for:

  • Component architecture
  • API integration
  • Responsive design
  • User experience
  • Code organization

License

This project is for demonstration purposes. Please respect Flickr's terms of service when using their API.

About

A react spa to preview most recent public images on flickr and bee able to search them by tag keyword. Also make a Wordpress Gutenburg plugin from it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published