Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🌤 Weather Forecast App

Giới thiệu

Dự án này là ứng dụng dự báo thời tiết gồm Frontend (React) và Backend (Node.js + Express). Ứng dụng cho phép:

  • Tìm kiếm thành phố
  • Gợi ý thành phố khi nhập (autocomplete)
  • Xem nhiệt độ, độ ẩm, mô tả thời tiết theo thời gian thực
  • Dữ liệu được lấy từ OpenWeather API.

1. Công nghệ sử dụng

  • Frontend

    • React
    • Axios
    • Tailwind CSS
    • Custom Hooks (useDebounce, useCitySuggestions)
  • Backend

    • Node.js
    • Express
    • Axios
    • dotenv
    • OpenWeather API

2. Cài đặt & chạy Backend

Mở Terminal và di chuyển vào thư mục backend:

Cài đặt node_modules:

cd backend
npm install

Tạo file .env

PORT=3001
WEATHER_API_KEY=your_openweather_api_key

Lấy API key tại: https://openweathermap.org/api

Chạy server

npm run dev

Backend sẽ chạy tại:

http://localhost:3001

3. Cài đặt & chạy Frontend

Di chuyển vào thư mục frontend:

cd frontend
npm install

Chạy server

npm run dev

Backend sẽ chạy tại:

http://localhost:3000

4. Tính năng nổi bật

- Autocomplete thành phố (debounce input)
- Gọi API tối ưu, tránh spam request
- UI đơn giản, thân thiện
- Custom React Hooks giúp tách logic rõ ràng

5. Ghi chú

- Frontend & Backend chạy độc lập
- Có thể cấu hình proxy hoặc deploy riêng
- Phù hợp để học React Hooks, API handling và Node.js Express

Chúc bạn cài đặt thành công! 🚀

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages