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

https://github.com/ryanlarge13/native-weather

Expo Router and Open Meteo join forces
https://github.com/ryanlarge13/native-weather

Last synced: 8 months ago
JSON representation

Expo Router and Open Meteo join forces

Awesome Lists containing this project

README

          

# ๐ŸŒค๏ธ Expo Weather App

[![Built with Expo](https://img.shields.io/badge/built%20with-expo-1f2024.svg?logo=expo)](https://expo.dev/)
[![React Native](https://img.shields.io/badge/framework-react--native-61dafb.svg?logo=react)](https://reactnative.dev/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![TypeScript](https://img.shields.io/badge/language-TypeScript-blue.svg?logo=typescript)](https://www.typescriptlang.org/)
[![SQLite](https://img.shields.io/badge/database-SQLite-lightgrey.svg?logo=sqlite)](https://www.sqlite.org/)
[![Location API](https://img.shields.io/badge/location-enabled-success.svg)](#)

---

## ๐Ÿ“š Table of Contents

- [๐Ÿ“ฑ Features](#-features)
- [๐Ÿš€ Tech Stack](#-tech-stack)
- [๐Ÿง  Architecture Overview](#-architecture-overview)
- [๐Ÿ“‚ Project Structure Highlights](#-project-structure-highlights)
- [๐Ÿ› ๏ธ Setup & Usage](#๏ธ-setup--usage)
- [๐Ÿงช Notes](#-notes)
- [๐Ÿ“ธ Screenshots](#-screenshots)
- [๐Ÿ“ Future Improvements](#-future-improvements)
- [๐Ÿ“„ License](#-license)

---

## ๐Ÿ“ฑ Features

- ๐Ÿ“ Auto-detects device location using permissions
- ๐Ÿ™๏ธ Supports static city selection from `cities.json`
- ๐ŸŒฆ๏ธ Shows:
- Current weather conditions
- 24-hour hourly forecast
- 7-day forecast
- ๐ŸŽจ Theme support (orange, blue, green)
- ๐Ÿ’พ SQLite-based settings storage (theme, temperature unit, accuracy)
- ๐ŸŽž Animated transitions using Moti

---

## ๐Ÿš€ Tech Stack

- [Expo](https://expo.dev/)
- [React Native](https://reactnative.dev/)
- [Moti](https://moti.fyi/)
- [expo-location](https://docs.expo.dev/versions/latest/sdk/location/)
- [expo-sqlite](https://docs.expo.dev/versions/latest/sdk/sqlite/)
- TypeScript

---

## ๐Ÿง  Architecture Overview

The app revolves around the `Index` screen which:

- Initializes app state
- Loads saved settings from SQLite
- Requests and handles location permissions
- Loads weather data from local dummy data or (optionally) an API
- Renders:
- Current weather (``)
- Weather details (``)
- Hourly forecast (``)
- Weekly forecast (``)

---

## ๐Ÿ“‚ Project Structure Highlights

```

.
โ”œโ”€โ”€ assets/
โ”‚ โ”œโ”€โ”€ images/icons/ # Weather icons
โ”‚ โ””โ”€โ”€ cities.json # City coordinates map
โ”œโ”€โ”€ components/
โ”‚ โ”œโ”€โ”€ Today.tsx
โ”‚ โ”œโ”€โ”€ TodaysInfo.tsx
โ”‚ โ”œโ”€โ”€ Hourly.tsx
โ”‚ โ””โ”€โ”€ Day.tsx
โ”œโ”€โ”€ hooks/
โ”‚ โ””โ”€โ”€ useTabAnimation.ts
โ”œโ”€โ”€ utils/
โ”‚ โ”œโ”€โ”€ api.ts
โ”‚ โ”œโ”€โ”€ dayStringMap.ts
โ”‚ โ”œโ”€โ”€ weatherCodes.ts
โ”‚ โ””โ”€โ”€ dummyData.ts
โ””โ”€โ”€ index.tsx # Main screen logic

```

---

## ๐Ÿ› ๏ธ Setup & Usage

### Prerequisites

- Node.js
- Expo CLI

### Getting Started

```bash
git clone https://github.com/yourusername/weather-app.git
cd weather-app
npm install
npx expo start
```

- Ensure your emulator or mobile device has **location services enabled**
- The local SQLite database (`myApp.db`) should contain a `Settings` table

---

## ๐Ÿงช Notes

- Weather data is loaded from `utils/dummyData.ts`

> You can replace `M_FetchWeather()` logic to call a real API (like OpenWeatherMap)

- If location access is denied, the app falls back to manually selected cities

---

## ๐Ÿ“ธ Screenshots

> _(Add screenshots here if available)_
> For example:
>
> - ![Today Screen](./screenshots/today.png)
> - ![Weekly Forecast](./screenshots/weekly.png)

---

## ๐Ÿ“ Future Improvements

- ๐ŸŒ Replace dummy data with real-time API integration
- ๐Ÿงญ Fallback handling if location services fail
- ๐Ÿ›  Add user-facing Settings screen
- ๐ŸŒ Multi-language (i18n) support

---

## ๐Ÿ“„ License

This project is licensed under the [MIT License](LICENSE).