A React web application for exploring dog breeds and viewing random images of different dog breeds. Built with Vite and React, this application fetches data from the Dog CEO API to provide an interactive dog breed browsing experience.
- Browse all available dog breeds in a grid layout
- View sub-breeds for breeds that have them
- Click on any breed to see random images
- Refresh to get new random images of the selected breed
- Responsive design for desktop and mobile devices
- Fast development and build with Vite
- React 19 - UI library for building the interface
- React Router DOM 7 - Client-side routing
- Vite 7 - Build tool and dev server
- Dog CEO API - Free API for dog breed information and images
- Netlify - Deployment platform with SPA support
- Clone the repository:
git clone https://github.com/netlify-templates/dogs-explorer
cd dogs-explorer- Install dependencies:
npm installRun the development server:
npm run devThe application will be available at http://localhost:5173 (or the port shown in your terminal).
npm run dev- Start the development servernpm run build- Build the production-ready applicationnpm run preview- Preview the built application locallynpm run lint- Run ESLint to check code quality
-
Home page: Fetches and displays all available dog breeds from the Dog CEO API in a responsive grid layout. Shows sub-breeds if available.
-
Breed detail page: When a breed is selected, displays a random image of that breed. Users can refresh to get new random images.
-
Routing: Uses React Router for seamless navigation between the home page and individual breed pages.
This application uses the Dog CEO API:
/api/breeds/list/all- Get list of all breeds/api/breed/{breed}/images/random- Get random image of a specific breed
The application is configured for deployment on Netlify with:
- Automatic builds from the main branch
- SPA routing support (redirects all routes to index.html)
- Production build output to the
distfolder
To deploy:
- Push your code to GitHub
- Connect your repository to Netlify
- Netlify will automatically build and deploy using the configuration in
netlify.toml
ISC License - See package.json for details
- Dog CEO API for providing the free dog breed API
- Vite for the fast build tooling
- React for the UI library