This is a React application that allows users to search for cities and view weather details.
- Search for cities using the OpenWeatherMap API.
- Display weather details for the selected city.
- Toggle between metric and imperial units.
- Modern UI with reactive components.
-
Clone the repository:
git clone [repository-url] cd [repository-directory]
add .env.local which values are given in the email.
-
Install the dependencies:
pnpm install
-
Set up environment variables:
- Create a
.env
file in the root directory. - Add the OpenWeatherMap API key:
VITE_OPENWEATHERMAP_API_KEY=your_api_key_here
- Create a
-
Start the development server:
pnpm run dev
- Run
pnpm run dev
to start the development server. - Run
pnpm run build
to build the application for production. - Run
pnpm run test
to run the test.
- Add a loading indicator.
- Add more tests.
- I would use react-testing-library to test some of the components. but i would use e2e testing to test the whole application. my favorite tool for e2e testing is cypress and playwright.