PixelFlow is a responsive image search application built with React and TypeScript, powered by the Unsplash API. Features a beautiful masonry layout, dark/light theme toggle, and seamless search experience. This project was created for practicing React hooks, global state management, and API integration.
View Live on Netlify:
PixelFlow - Unsplash Image Gallery
| 💻 Desktop View with Light & Dark Theme |
| 📱 Mobile View with Light & Dark Theme |
| Responsive design with theme toggle and masonry layout |
- Image Search - Search for high-quality images from Unsplash API
- Masonry Layout - Responsive grid layout that adapts to different screen sizes
- Dark/Light Theme - Toggle between dark and light themes with system preference detection
- Responsive Design - Optimized for both desktop and mobile devices
- React Query - Efficient data fetching and caching with background updates
- TypeScript - Full type safety for better development experience
- Accessibility - Accessible form and images with proper alt texts
| Tool / Library | Purpose |
|---|---|
| ⚡ Vite | Fast build tool & dev server |
| ⚛️ React 18 | Component-based UI |
| 🟦 TypeScript | Type safety and developer experience |
| 🎯 Context API | Global state management |
| 🔍 React Query | Data fetching and caching |
| 🖼️ React Responsive Masonry | Masonry layout for images |
| 📋 React Icons | Icon library for theme toggle |
| 🎨 CSS3 | Custom properties, transitions, Grid |
| 🌅 Unsplash API | High-quality image database |
- Context API Implementation for global state sharing (theme and search term)
- Complex State Logic managing theme, search term, and API data
- Custom Hook Creation (
useGlobalContext) with TypeScript
- React Query for efficient data fetching, caching, and background updates
- Axios for making HTTP requests
- TypeScript Interfaces for API response types
- Environment Variables for secure API key management
- Masonry Layout for dynamic image grids using react-responsive-masonry
- Smooth Transitions for theme switching and hover effects
- Responsive Breakpoints with mobile-first approach
- Loading and Error States for better user feedback
- Lazy Loading Images for performance optimization
- Efficient Re-renders with React Query and proper state management
- System Theme Detection respecting user preferences
- Local Storage for theme persistence across sessions
src/
├── components/
│ ├── Gallery.tsx # Displays images in masonry layout
│ ├── SearchForm.tsx # Search input and form
│ └── ThemeToggle.tsx # Dark/light theme toggle button
├── contexts/
│ ├── AppContext.tsx # React context creation
│ └── AppProvider.tsx # Global state provider
├── hooks/
│ └── useGlobalContext.ts # Custom context hook
└── main.tsx # App entry point
- Node.js ≥ 18.0.0
- npm or yarn package manager
- Clone the repository
git clone https://github.com/pro804/Pixel-Flow.git- Navigate to the project directory
cd Pixel-Flow- Install dependencies
npm install- Create a .env file in the root directory and add your Unsplash API key:
VITE_API_KEY=your_unsplash_api_key_here- Start the development server
npm run dev- Open http://localhost:5173 to view it in the browser.
npm run dev— Runs the development server (Vite)npm run build— Builds the app for productionnpm run preview— Previews the production build locally
This project was created for educational purposes as part of a React learning journey. This project is licensed under the MIT License. See the LICENSE file for details.
-
Unsplash for providing the amazing image API
-
John Smilga for the original project idea and design