Skip to content

hamdi-ben-yaflah/weather-app

Repository files navigation

Weather App

This is a weather application built with Next.js using openweathermap API.

Live Demo

Prerequisites

Before you begin, ensure you have met the following requirements:

Installing Weather App

To install Weather App, follow these steps:

  1. Clone the repository:
git clone https://github.com/yourusername/weather-app.git
  1. Navigate into the project directory:
cd weather-app
  1. Install the dependencies:
npm install

Using Weather App

To use Weather App, follow these steps:

  1. Create .env file and insert your openweathermap api key, check .env.example

  2. Start the development server:

npm run dev
  1. Open your web browser and navigate to http://localhost:3000.

With Docker

  1. Build the docker image with:
docker build . -t 'insert image name'
  1. Run the image with:
docker run -p 3000:3000 'image name'
  1. Open your web browser and navigate to http://localhost:3000.

Running Tests

This project uses Jest for unit testing / component testing and Cypress for end-to-end testing.

To run the Jest tests:

npm run test

To run the Cypress tests:

  1. Build and start the application:
npm run build & npm run start
  1. run cypress tests:
npm run cypress:run