A modern web application for exploring artworks from The Metropolitan Museum of Art collection. Built with React, TypeScript, and Tailwind CSS.
- Vercel Link: [https://art-explorer-nine.vercel.app/]
- Browse Artworks: Explore thousands of artworks with infinite scroll
- Advanced Search: Search by artist name or culture
- Favorites: Save and manage your favorite artworks
- Detailed View: View high-resolution images and detailed information
- Dark Mode: Toggle between light and dark themes
- Responsive Design: Optimized for mobile, tablet, and desktop
- Scroll Restoration: Maintains scroll position when navigating back
- Accessibility: WCAG compliant with keyboard navigation and screen reader support
- React 18 - UI library
- TypeScript - Type safety
- Vite - Build tool and dev server
- TanStack Query (React Query) - Data fetching and caching
- React Router - Client-side routing
- Zustand - State management (favorites)
- Tailwind CSS v4 - Styling
- Axios - HTTP client
- Met Museum API - Data source
- Clone the repository:
git clone <repository-url>
cd agositnho_teles_jr- Install dependencies:
npm install- Start development server:
npm run dev- Open in browser:
http://localhost:5173
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
src/
βββ assets/ # SVG icons and images
βββ components/ # Reusable UI components
β βββ Buttons/ # Button components (Back, Hamburger, DayNight)
β βββ Gallery/ # Gallery grid and cards
β βββ Header/ # Header, Logo, Navigation
β βββ Layout/ # Page layouts
β βββ SearchBar/ # Search input and results counter
βββ hooks/ # Custom React hooks
β βββ useMetMuseumArtworks.ts
β βββ useFavoritesArtworks.ts
β βββ useScrollRestoration.ts
β βββ useSearchState.ts
β βββ useToggle.ts
β βββ usePrefetchMetObject.ts
βββ pages/ # Page components
β βββ Home.tsx
β βββ Favorites.tsx
β βββ ArtDetails/
βββ services/ # API clients
β βββ metMuseumApi.ts
βββ stores/ # Zustand stores
β βββ useFavoritesStore.ts
βββ styles/ # CSS and themes
β βββ components/
β βββ themes.css
βββ types/ # TypeScript type definitions
β βββ metMuseum.ts
βββ utils/ # Utility functions
β βββ transformers.ts
βββ App.tsx # Root component
- Uses TanStack Query for efficient data fetching and caching
- Prefetches artwork details on hover for instant navigation
- 5-minute stale time for API responses
- Automatic retry on failed requests
- Loads 15 artworks per page
- Intersection Observer API for scroll detection
- Smooth loading states with skeleton screens
- Maintains performance with memoized components
- Persistent storage using localStorage via Zustand
- Optimistic UI updates
- Separate view for favorite artworks
- Real-time sync across components
- Class-based dark mode with Tailwind CSS v4
- Persists preference to localStorage
- Smooth transitions between themes
- Custom color palette for consistent branding
- Saves scroll position to sessionStorage
- Restores position when returning from detail pages
- Multiple restoration attempts for reliability
- Clears position on search/reset
- Single Responsibility: Each component/hook has one clear purpose
- Open/Closed: Easy to extend without modifying existing code
- Dependency Inversion: Components depend on abstractions (hooks), not implementations
- React.memo for expensive components
- useCallback for stable function references
- useMemo for derived data
- Code splitting with React.lazy (ready for future use)
- Image lazy loading and decoding optimization
- Semantic HTML elements
- ARIA attributes (roles, labels, states)
- Keyboard navigation support
- Focus management
- Screen reader friendly
- Sufficient color contrast ratios
Uses The Metropolitan Museum of Art Collection API:
Endpoints:
GET /search- Search artworks by queryGET /objects/{objectID}- Get artwork details
Features:
- Fallback search strategy (artist/culture β general)
- Error handling with Promise.allSettled
- Response transformation to normalized format
- Retry logic for failed requests
- Tailwind CSS v4 with CSS variables
- Custom color palette in
themes.css - Component-scoped styles in
@layer components - Responsive breakpoints (sm, md, lg, xl)
- Dark mode variants with
dark:prefix
- Strict mode enabled
- Path aliases configured (
@/) - Type-safe API responses
- Shared type definitions in
/types
- Fast HMR (Hot Module Replacement)
- Optimized build output
- Asset handling (SVG, images)
- Path resolution
- Modern browsers (Chrome, Firefox, Safari, Edge)
- ES2020+ features
- CSS Grid and Flexbox
- Intersection Observer API
npm run buildOutput will be in dist/ folder.
npm run preview- Vercel (recommended)
- Netlify
- GitHub Pages
- Any static hosting service
- Met Museum API has rate limits (no auth required, but throttled)
- Some artworks may not have images (filtered out)
- API response times can vary
- Search is case-insensitive for better UX
This project is for educational/portfolio purposes. Artwork data provided by The Metropolitan Museum of Art Collection API.
Agostinho Ferreira Teles Jr.
- LinkedIn: [https://www.linkedin.com/in/atelesjr/]
- GitHub: [https://github.com/atelesjr]
- The Metropolitan Museum of Art for providing the API
- React team for excellent documentation
- TanStack Query for powerful data fetching
- Tailwind CSS team for the utility-first framework
Built with β€οΈ using React + TypeScript + Vite