Welcome to the Weather AI App repository! This repository contains an application built with Next.js that utilizes the ChatGPT API to provide weather details for a chosen city. The weather data is obtained from the StepZen API, and you will need to set up environment variables to configure the application.
Before getting started, make sure you have the following prerequisites installed on your machine:
- Node.js (version 18.15.0 or higher)
- npm (version 9.6.0 or higher)
- Git
To use this repository and run the Weather AI App locally, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/lamiaagabriel/ai-weather-app.git
-
Change into the project directory:
cd ai-weather-app
-
Install the dependencies:
yarn
-
Create the necessary environment variables. Open a text editor and create a new file named
.env
in the root directory of the project. -
Copy and paste the following content into the
.env
file:app_title='Weather AI' # ------------------------ # GraphQL Stepzen API # ------------------------ API_URL=http://localhost:5001/api/weather-ai # API_URL=https://kochbihar.stepzen.net/api/weather-ai/__graphql STEPZEN_API_KEY= # ------------------------ # ChatGPT API # ------------------------ OPENAI_API_KEY=
-
Provide values for the environment variables:
app_title
: Set your desired title for the AI Weather App.API_URL
: Set the URL of the StepZen API. If you're running it locally, usehttp://localhost:5001/api/weather-ai
. If it's hosted elsewhere, replace the URL accordingly.STEPZEN_API_KEY
: Obtain your StepZen API key and paste it here.OPENAI_API_KEY
: Obtain your OpenAI API key and paste it here.
-
Save the
.env
file. -
Start the development server:
yarn dev
The Weather AI App should now be accessible at http://localhost:3000. You can choose a city on the home page and view the weather details provided by the ChatGPT API.
If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make the necessary changes in your branch.
- Commit and push your changes.
- Submit a pull request.
This project is licensed under the MIT License.