Create .env
file in the project root folder with the following contents:
API_KEY=<YOUR OPENWEATHER API KEY>
Install dependencies using pnpm
packet manager:
pnpm install
Launch the project in the development mode using: pnpm dev
Go to localhost:3000
in your browser
OpenWeather API key can be obtained for free after signing up on the official website. The free tier allows for 1,000,000 API calls per month.
This application was created using the following technologies:
API requests are performed using Next.js feature called 'Server Actions'. It allows you to make requests on the server side. I decided to use this approach to not share the API key with the Client. Because of that, the website can be hosted publicly without the need to worry about leaking the key.