This project is a web application that allows users to search for images and view results fetched from an API. Built with React and Tailwind CSS, the app provides a smooth and responsive interface for image searching.
Before running the project, ensure you have the following installed:
Follow these steps to set up and run the project locally:
Create a new folder and set up the React app:
mkdir image-search-app
cd image-search-app
npx create-react-app .
Install Tailwind CSS and related dependencies:
npm i -D tailwindcss postcss-cli autoprefixer
Initialize Tailwind CSS with a full configuration:
npx tailwind init tailwind.js --full
Create the PostCSS configuration file:
touch postcss.config.js
Start the development server:
npm run start
Update package.json
:
In your package.json
, modify the scripts
section to include CSS build and watch commands:
"scripts": {
"start": "npm run watch:css && react-scripts start",
"build": "npm run build:css && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"build:css": "postcss src/assets/tailwind.css -o src/assets/main.css",
"watch:css": "postcss src/assets/tailwind.css -o src/assets/main.css"
}
Configure Tailwind in your project:
tailwind.css
is properly set up in src/assets
.@tailwind base;
@tailwind components;
@tailwind utilities;
This project is licensed under the MIT License - see the LICENSE file for details.