A modern, responsive photo gallery application built with Next.js 14, featuring internationalization, modal views, and elegant image displays.
- 📱 Responsive Design - Works seamlessly on desktop, tablet, and mobile devices
- 🌍 Internationalization - Multi-language support (English & Bengali)
- 🖼️ Modal Photo Viewer - Click on any photo to view in a beautiful modal overlay
- ⚡ Fast Loading - Optimized images with Next.js Image component and fallback handling
- 🎨 Modern UI - Clean design with Tailwind CSS
- 🔍 Photo Details - View photo metadata, author information, and engagement stats
- 📊 Error Handling - Graceful fallback for failed image loads
- Framework: Next.js 14.1.4
- Styling: Tailwind CSS 3.3.0
- Language: JavaScript/JSX
- Image Sources: Lorem Picsum & DiceBear APIs
- Internationalization: @formatjs/intl-localematcher & negotiator
- Development: ESLint, PostCSS, Autoprefixer
photofeed/
├── app/ # App Router directory
│ ├── [lang]/ # Internationalized routes
│ │ ├── dictionaries/ # Translation files
│ │ │ ├── en.json # English translations
│ │ │ └── bn.json # Bengali translations
│ │ ├── (.)photos/[id]/ # Intercepting route for modal
│ │ ├── photos/[id]/ # Photo detail pages
│ │ └── page.js # Home page
│ ├── api/ # API routes
│ │ └── photos/ # Photo API endpoints
│ ├── globals.css # Global styles
│ └── layout.js # Root layout
├── components/ # React components
│ ├── ImageWithFallback.jsx # Image component with error handling
│ ├── LanguageSwitcher.jsx # Language toggle component
│ ├── Logo.jsx # Logo component
│ ├── Modal.jsx # Modal overlay component
│ ├── Navbar.jsx # Navigation bar
│ ├── PhotoCard.jsx # Individual photo card
│ ├── PhotoDetails.jsx # Photo detail view
│ └── PhotoList.jsx # Photo grid layout
├── lib/ # Utility libraries
│ ├── image-data.js # Photo data source
│ └── image-utils.js # Image utility functions
├── public/ # Static assets
│ ├── icons/ # SVG icons
│ └── images/ # Static images
└── middleware.js # Internationalization middleware
-
Clone the repository
git clone <repository-url> cd photofeed
-
Install dependencies
npm install
-
Set up environment variables Create a
.env.localfile in the root directory:BASE_API_URL=http://localhost:3000/api
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
The app supports multiple languages through Next.js internationalization:
- English (
/en) - Default language - Bengali (
/bn) - Secondary language
Language detection is automatic based on browser preferences, with manual switching available via the language switcher component.
- Main Photos: Lorem Picsum - High-quality placeholder images
- User Avatars: DiceBear API - Generated avatar images
- Fallback Images: Local SVG placeholders for error handling
The project uses Tailwind CSS for styling with:
- Responsive design principles
- Dark/light mode considerations
- Custom color schemes
- Optimized for performance
- Mobile: < 768px
- Tablet: 768px - 1024px
- Desktop: > 1024px
Displays individual photos in a grid layout with:
- Image optimization
- Error handling with fallbacks
- Click-to-modal functionality
Full-screen overlay for photo viewing with:
- White background for better visibility
- Responsive design
- Easy navigation controls
Comprehensive photo information including:
- Author details and avatars
- Engagement metrics (views, shares, likes)
- Photo metadata and tags
Toggle between supported languages with:
- Flag icons for visual identification
- Smooth transitions
- Persistent language preference
npm run build
# Deploy to Vercelnpm run build
npm run start- Check internet connection
- Verify API endpoints are accessible
- Clear browser cache and restart development server
- Ensure translation files exist in
app/[lang]/dictionaries/ - Check middleware configuration
- Verify language codes match supported locales
- Ensure modal root element exists in DOM
- Check for conflicting CSS z-index values
- Verify JavaScript is enabled
| Variable | Description | Default |
|---|---|---|
BASE_API_URL |
API base URL | http://localhost:3000/api |
This project is private and not licensed for public use.
This is a private project. For internal development:
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit for review
For issues or questions, please contact the development team.
Built with ❤️ using Next.js and modern web technologies.