Skip to content

fadeel7/Project2-photo-gallery-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Basic Photo Gallery App

A modern, cloud-powered photo gallery application showcasing seamless integration between React frontend and AWS S3 cloud storage.

Live Demo React AWS S3 Tailwind CSS


Overview

A fully responsive photo gallery web application that demonstrates cloud integration, modern frontend development, and professional UI/UX design. Built as a learning project to master AWS services, React development, and production deployment workflows.

Live Demo: View the Gallery


Key Features

User Experience

  • Responsive Image Grid - Adaptive 3-column layout (desktop), 2-column (tablet), 1-column (mobile)
  • Smooth Scroll Animations - Images fade in elegantly as you scroll using Intersection Observer API
  • Interactive Lightbox Viewer - Full-screen image viewing with sleek dark overlay
  • Keyboard Navigation - Arrow keys (←/β†’) to browse images, ESC to close
  • Hover Effects - Images zoom and reveal metadata on hover

Functionality

  • Real-time Search - Instant filtering by image filename
  • Category Filtering - Toggle between All, Nature, Architecture, and Abstract
  • Image Download - One-click download from lightbox viewer
  • Loading States - Skeleton screens for optimal perceived performance
  • Empty State Handling - User-friendly messages when no results found

Performance & Technology

  • AWS S3 Storage - Scalable, cost-effective image hosting
  • CloudFront CDN - Global content delivery with HTTPS
  • Lazy Loading - Images load on-demand for faster initial page load
  • Optimized Build - Vite bundler for lightning-fast development and production builds
  • Modern React - Hooks (useState, useEffect, custom hooks) and functional components

Demo

Gallery View

Gallery Grid Clean, responsive grid layout with category badges and hover effects

Lightbox Viewer

Lightbox Full-screen image viewer with navigation controls and metadata

Mobile Experience

Mobile View Fully responsive design adapts beautifully to all screen sizes


πŸ› οΈ Tech Stack

Category Technologies
Frontend Framework React 18
Build Tool Vite 7
Styling Tailwind CSS 3
Cloud Storage AWS S3
CDN AWS CloudFront
API Integration AWS SDK for JavaScript v3
Deployment AWS S3 Static Hosting
Version Control Git & GitHub

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User Browser  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         ↓ HTTPS
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   CloudFront    β”‚ ← Global CDN (Fast delivery worldwide)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  S3 (Website)   β”‚ ← React App (HTML, CSS, JS)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β”‚ AWS SDK
         ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  S3 (Images)    β”‚ ← Image Storage (JPEG, PNG)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

photo-gallery-app/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/              # React Components
β”‚   β”‚   β”œβ”€β”€ PhotoCard.jsx        # Individual image card with hover effects
β”‚   β”‚   β”œβ”€β”€ CategoryFilter.jsx   # Category filter buttons
β”‚   β”‚   β”œβ”€β”€ Lightbox.jsx         # Full-screen image viewer
β”‚   β”‚   β”œβ”€β”€ SearchBar.jsx        # Search input with clear button
β”‚   β”‚   β”œβ”€β”€ LoadingSkeleton.jsx  # Loading placeholder components
β”‚   β”‚   └── EmptyState.jsx       # No results message
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── s3Service.js         # AWS S3 API integration
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── useScrollAnimation.js # Custom scroll-triggered animation hook
β”‚   β”œβ”€β”€ App.jsx                  # Main application component
β”‚   β”œβ”€β”€ main.jsx                 # React entry point
β”‚   └── index.css                # Tailwind directives & global styles
β”œβ”€β”€ public/                      # Static assets
β”œβ”€β”€ .env.example                 # Environment variables template
β”œβ”€β”€ .gitignore                   # Git ignore rules
β”œβ”€β”€ index.html                   # HTML template
β”œβ”€β”€ package.json                 # Dependencies & scripts
β”œβ”€β”€ tailwind.config.js           # Tailwind configuration
β”œβ”€β”€ postcss.config.js            # PostCSS configuration
β”œβ”€β”€ vite.config.js               # Vite bundler configuration
└── README.md                    # This file

Getting Started

Prerequisites

Installation

  1. Clone the repository
   git clone https://github.com/fadeel7/Project2-photo-gallery-app.git
   cd Project2-photo-gallery-app
  1. Install dependencies
   npm install
  1. Set up environment variables

    Create a .env file in the root directory:

   VITE_AWS_REGION=us-east-1
   VITE_AWS_ACCESS_KEY_ID=your_access_key_here
   VITE_AWS_SECRET_ACCESS_KEY=your_secret_key_here
   VITE_S3_BUCKET_NAME=your_bucket_name_here
**Security Note:** Never commit `.env` to Git! It's already in `.gitignore`.
  1. Run development server
   npm run dev
  1. Open in browser

    Navigate to http://localhost:5173


Deployment

Build for Production

npm run build

This generates an optimized production build in the dist/ folder.

Deploy to AWS S3

  1. Create S3 bucket with static website hosting enabled
  2. Configure bucket policy for public read access
  3. Upload dist/ contents to the bucket
  4. Set up CloudFront (optional but recommended for HTTPS and CDN)

Detailed deployment guide: View Documentation


Features Breakdown

Category Filtering

Switch between image categories (Nature, Architecture, Abstract) with smooth transitions. Active category is highlighted with a gradient button style.

Search Functionality

Real-time client-side search that filters images by filename. Includes a clear button (Γ—) that appears when text is entered.

Lightbox Viewer

  • Click any image to open full-screen view
  • Navigate with arrow keys (←/β†’) or on-screen buttons
  • Download images with single click
  • Displays image metadata (filename, category, size)
  • Shows current position (e.g., "3 / 15")
  • Close with ESC key or click outside

Scroll Animations

Uses Intersection Observer API to detect when images enter viewport and trigger fade-in animations. Improves perceived performance and adds polish.

Responsive Design

  • Desktop (>1024px): 3-column grid
  • Tablet (768px-1024px): 2-column grid
  • Mobile (<768px): 1-column grid
  • Touch-friendly interactions on mobile devices

Security Best Practices

βœ… Environment Variables - AWS credentials stored in .env (not in repo)
βœ… IAM Permissions - Read-only S3 access for frontend
βœ… CORS Configuration - Properly configured for browser requests
βœ… Bucket Policies - Public read access only for images
βœ… HTTPS - CloudFront provides SSL/TLS encryption
βœ… No Hardcoded Secrets - All sensitive data in environment variables


Troubleshooting

Images not loading?

  • βœ“ Verify AWS credentials in .env are correct
  • βœ“ Check S3 bucket CORS policy allows your domain
  • βœ“ Ensure S3 bucket policy permits public read (s3:GetObject)
  • βœ“ Confirm bucket region matches VITE_AWS_REGION

Build fails?

  • βœ“ Delete node_modules/ and package-lock.json
  • βœ“ Run npm install again
  • βœ“ Check Node.js version: node --version (should be v16+)

CloudFront shows old content?

  • βœ“ Create invalidation for /* in CloudFront console
  • βœ“ Wait 5-10 minutes for distribution to update

Performance Metrics

  • Lighthouse Score: 95+ (Performance, Accessibility, Best Practices)
  • First Contentful Paint: < 1.5s
  • Time to Interactive: < 3s
  • Bundle Size: ~150KB (gzipped)

Learning Outcomes

Through this project, I gained hands-on experience with:

  • AWS Services - S3 storage, CloudFront CDN, IAM permissions
  • Modern React - Hooks, component composition, state management
  • Tailwind CSS - Utility-first styling, responsive design
  • Build Tools - Vite configuration and optimization
  • Deployment - Production builds, static hosting, CDN setup
  • Security - Environment variables, IAM policies, CORS
  • Version Control - Git workflows, GitHub collaboration

Future Enhancements

  • Upload Feature - Allow users to upload images directly from UI
  • User Authentication - AWS Cognito for user accounts
  • Private Galleries - User-specific image collections
  • Image Optimization - AWS Lambda for automatic resizing
  • Thumbnails - Generate low-res previews for faster loading
  • Tags & Albums - Organize images with custom tags
  • Social Sharing - Share images on social media
  • Dark Mode - Toggle between light/dark themes
  • Drag & Drop Upload - Intuitive file upload interface

License

This project is open source and available under the MIT License.


Author

Fadeel Darkwa


Acknowledgments

  • Images: Sample images from Unsplash and Pexels
  • Icons: SVG icons designed inline with Heroicons style
  • Inspiration: Modern photo gallery designs from Dribbble and Behance
  • Learning Resources: AWS Documentation, React Docs, Tailwind CSS Docs

Contributing

Contributions, issues, and feature requests are welcome!

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Show Your Support

If you found this project helpful or learned something from it, please give it a ⭐️!


Built as part of my cloud + frontend development learning journey

About

A very basic photo gallery built with React and AWS S3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors