This project is a web app that displays images of dogs based on different criteria, such as random images by breed, a list of images by breed, random images by breed and sub-breed, and a list of images by breed and sub-breed. The app is built using React.js and TypeScript, and it interacts with the Dog API to fetch dog-related data.
You can view the live demo of this project here.
- Display random dog image by breed.
- Display a list of dog images by breed.
- Display random dog image by breed and sub-breed.
- Display a list of dog images by breed and sub-breed.
- Responsive layout for various screen sizes.
- Dockerized version available for easy deployment.
Before you begin, ensure you have met the following requirements:
- Node.js installed on your local machine
- npm or yarn package manager installed
- Docker (for running the Dockerized version)
-
Clone the repository:
git clone https://github.com/muhammadshiraz/deliveristo-frontend.git cd deliveristo-frontend
-
Install dependencies:
npm install
-
Run the development server:
npm run start
The app will be running at
http://localhost:3000
.
- Click on the navigation links to view different categories of dog images.
- Click the "Refresh" button to load new random images.
- Enjoy exploring different dog breeds and sub-breeds!
This project includes a Dockerfile for containerization. To run the app using Docker, follow these steps:
-
Build the Docker image:
docker build -t deliveristo-frontend .
-
Run the Docker container:
docker run -d -p 80:80 deliveristo-frontend
The app will be accessible at
http://localhost
.
This project is set up for deployment to GitHub Pages. To deploy the app, follow these steps:
-
Update
package.json
homepage field:Update the
"homepage"
field inpackage.json
to match your GitHub Pages URL.{ "homepage": "https://yourusername.github.io/deliveristo-frontend", // ... }
-
Deploy to GitHub Pages:
npm run deploy
The app will be deployed to GitHub Pages and will be accessible at the specified URL.
This project includes unit tests and end-to-end tests. You can run the tests using the following commands:
-
Run unit tests:
npm test
-
Run end-to-end tests:
npm run test:e2e
- React.js: JavaScript library for building user interfaces.
- TypeScript: Superset of JavaScript that adds static types to the language.
- Redux: State management library for managing the app's state.
- React Router: Declarative routing for React.js applications.
- Axios: Promise-based HTTP client for making requests to the Dog API.
- Jest and Testing Library: Testing framework and utilities for writing unit and end-to-end tests.
The project structure is organized as follows:
src/
: Contains the source code files.components/
: Reusable React components.containers/
: Components that connect to Redux store.services/
: API service functions.store/
: Redux store setup (reducers, actions, etc.).styles/
: CSS and styling files.utils/
: Utility functions and helpers.
public/
: Static assets and HTML template.
If you'd like to contribute to this project, please follow these guidelines:
- Fork the repository and clone it to your local machine.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
. - Make your changes and commit them:
git commit -m 'Description of changes'
. - Push your changes to the branch:
git push origin feature-name
. - Create a pull request on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to reach out if you have any questions or need further assistance. Happy coding!