Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Pawa Weather App

A decoupled weather application built with Next.js (TypeScript) for the frontend and Laravel (latest) for the backend API. Weather data is sourced from OpenWeatherMap.


🧱 Tech Stack

Frontend

Backend


🧭 Features

  • 🔍 Search city weather using the Geocoding API
  • 🌡️ View current temperature and weather description
  • 🌤️ Display 3-day forecast
  • 🌬️ Wind status and 💧humidity information
  • 🌐 Switch between Celsius and Fahrenheit
  • 📅 Current date and location display
  • 📦 Decoupled architecture (frontend/backend separation)

🛠 Setup Instructions

Backend (Laravel)

  1. Clone the repository and navigate to the backend folder:
cd backend
composer install
  1. Create .env file and set the following:
OPENWEATHER_API_KEY=your_api_key_here
  1. Run the Laravel development server:
php artisan serve
  1. Laravel API endpoints:
  • GET /api/weather?city=Nairobi&units=metric
  • GET /api/forecast?city=Nairobi&units=metric

Frontend (Next.js)

  1. Navigate to the frontend folder:
cd frontend
npm install
  1. Set up environment variables in .env.local:
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api
  1. Start the dev server:
npm run dev
  1. Visit: http://localhost:3000

💡 Folder Structure Overview

Frontend

components/       # UI Components like SearchBox, WeatherCard
services/         # API service logic (calls Laravel)
types/            # TypeScript interfaces
tutils/           # Helper functions (unit conversion, formatting)
pages/            # index.tsx with main layout

Backend

Controllers/       # WeatherController for API logic
Services/          # OpenWeatherMap API communication
routes/api.php     # Defines weather routes

✅ TODO Checklist

  • Build Laravel API with city-based weather endpoints
  • Create frontend UI in Next.js using RippleUI
  • Connect frontend to backend via fetch API
  • Handle errors and loading states gracefully
  • Add support for unit switching (C/F)
  • Add mobile responsiveness (optional)
  • Add simple test case for API route (bonus)

📸 Wireframe Layout

  • Search box at the top
  • Current day's weather: icon, temperature, description, date, location
  • Forecast: Next 3 days
  • Weather details: wind, humidity
  • Toggle: Celsius / Fahrenheit

📦 Deployment Tips


🤝 Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages