An open API service indexing awesome lists of open source software.

https://github.com/ragini-pandey/graphql-weather-app

Next.js weather dashboard powered by GraphQL, Apollo Client, Tremor charts and TailwindCSS
https://github.com/ragini-pandey/graphql-weather-app

appolo-client graphql nextjs stepzen tailwindcss typescript

Last synced: about 1 month ago
JSON representation

Next.js weather dashboard powered by GraphQL, Apollo Client, Tremor charts and TailwindCSS

Awesome Lists containing this project

README

          

# GraphQL Weather App ๐ŸŒค๏ธ

An **interactive weather app** built with **Next.js**, **TypeScript**, **GraphQL**, and **StepZen** โ€” delivering **real-time weather data** through seamless **GraphQL queries**.
The app features a **modern, responsive dashboard** powered by **Apollo Client**, **Tremor charts**, and **Tailwind CSS**, providing a clean and insightful visualization of live weather metrics.

## ๐Ÿ–ผ๏ธ Screenshots

![Intro Screen](https://github.com/ragini-pandey/graphql-weather-app/blob/master/public/Screenshot-1.png)
![Loading Screen](https://github.com/ragini-pandey/graphql-weather-app/blob/master/public/Screenshot-2.png)
![Dashboard Screen](https://github.com/ragini-pandey/graphql-weather-app/blob/master/public/Screenshot-3.png)

------------------------------------------------------------

## ๐Ÿงญ Table of Contents

- Features
- Tech Stack
- Project Structure
- Getting Started
- Prerequisites
- Environment Variables
- Installation & Running
- GraphQL Schema & Queries
- Key Modules & Architecture
- Scripts

------------------------------------------------------------

## ๐Ÿ” Features

- Fetch current weather for a given location
- Use GraphQL API (via StepZen) to query weather data
- Search by city name
- Display temperature, humidity, wind, etc.
- Clean, responsive UI

------------------------------------------------------------

## ๐Ÿงฑ Tech Stack

- Next.js (with TypeScript)
- React + hooks
- GraphQL / StepZen
- Apollo Client (or GraphQL client)
- Styling: Tailwind CSS
- API key management via environment variables

------------------------------------------------------------

## ๐Ÿ“ Project Structure

```
.
โ”œโ”€โ”€ app/ # Next.js app route components
โ”œโ”€โ”€ components/ # UI components
โ”œโ”€โ”€ graphql/ # GraphQL queries / schema
โ”œโ”€โ”€ lib/ # Helper utilities (API client)
โ”œโ”€โ”€ public/ # Static assets
โ”œโ”€โ”€ stepzen/ # StepZen config / endpoint setup
โ”œโ”€โ”€ .eslintrc.json
โ”œโ”€โ”€ next.config.js
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tailwind.config.js
โ”œโ”€โ”€ tsconfig.json
โ””โ”€โ”€ README.md
```

------------------------------------------------------------

## ๐Ÿš€ Getting Started

### Prerequisites

- Node.js (v14+)
- A host or test account for StepZen (or GraphQL endpoint)
- Weather API key (e.g. OpenWeatherMap, etc.)

### Environment Variables

Create a `.env.local` file in the project root:

```env
OPENAI_API_KEY=your_openai_api_key
API_URL=your_stepzen_endpoint_url
NEXT_PUBLIC_STEPZEN_API_KEY=your_stepzen_api_key
```

### Installation & Running

```bash
# Install dependencies
npm install

# Start development server
npm run dev
# Open http://localhost:3000

# Build & run production
npm run build && npm start
```

------------------------------------------------------------

## ๐Ÿ”Ž GraphQL Schema & Queries

- The GraphQL schema defines a `Weather` query (or similar) to fetch weather data
- Queries take location (city name, coordinates) as arguments
- Returns fields like: temperature, humidity, windSpeed, weatherDescription

You can inspect the GraphQL playground at your StepZen endpoint for more details.

------------------------------------------------------------

## ๐Ÿงฉ Key Modules & Architecture

- lib/apollo-client.ts โ€” sets up GraphQL client with endpoint & auth
- graphql/queries โ€” GraphQL query files (e.g. GET_WEATHER.gql)
- components/WeatherCard โ€” displays weather details
- app/page.tsx โ€” UI for search & display
- State & UI logic handled via React hooks

------------------------------------------------------------

## ๐Ÿงช Scripts

| Script | Description |
|--------|--------------------------|
| dev | Start dev server |
| build | Build for production |
| start | Run production server |
| lint | Run ESLint |

------------------------------------------------------------