Skip to content

Muhasix/cuaca_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌤️ Dashboard Cuaca Indonesia

Live GitHub last commit Python


🚀 Fitur

  • Ambil data cuaca otomatis dari OpenWeatherMap API
  • Mendukung multi-kota: Jakarta, Bandung, Surabaya, dll.
  • Simpan data ke PostgreSQL (lokal & Railway)
  • Dashboard real-time dengan auto-refresh
  • Otomatisasi fetch via cron di Railway

🖥️ Tampilan

screenshot


🗂️ Struktur Proyek

📁 Klik untuk lihat

cuaca\_project/
├── dashboard/
│   └── app.py                  # Dashboard Streamlit
├── data/                       # (Opsional jika pakai CSV)
│   ├── raw/
│   └── processed/
├── scripts/
│   ├── fetch\_data.py           # Ambil data cuaca ke DB
│   └── migrate\_to\_railway.py   # Migrasi manual dari lokal ke cloud
├── tools/
│   └── migrate\_to\_railway.py   # Bisa dipindah ke sini
├── .env                        # Env lokal (diabaikan Git)
├── migrate.env                 # Env Railway (jangan di-commit)
├── requirements.txt
├── .gitignore
└── README.md


⚙️ Instalasi Lokal

  1. Clone repo:
git clone https://github.com/Muhasix/cuaca_project.git
cd cuaca_project
  1. Buat virtual environment & aktifkan:
python3 -m venv env
source env/bin/activate
  1. Install dependency:
pip install -r requirements.txt
  1. Buat file .env dan isi:
OPENWEATHER_API_KEY=your_api_key
PGHOST=localhost
PGDATABASE=cuaca_db
PGUSER=cuaca_user
PGPASSWORD=cuaca_pass
PGPORT=5432
  1. Jalankan dashboard:
streamlit run dashboard/app.py

☁️ Deployment di Railway

  • Setup PostgreSQL dan Streamlit di Railway
  • Tambahkan variabel .env di Railway Environment tab
  • Gunakan Pre-deploy command untuk fetch_data.py
  • Gunakan Cron Schedule untuk auto-refresh data

📦 Migrasi Data Lokal ke Railway (opsional)

  1. Siapkan migrate.env:
PGHOST=your_railway_host
PGPORT=your_railway_port
PGUSER=postgres
PGPASSWORD=your_password
PGDATABASE=railway
  1. Jalankan migrasi dari lokal:
python scripts/migrate_to_railway.py

📄 Lisensi

MIT License — bebas digunakan, dimodifikasi, dan dikembangkan.


Sukses deploy? ✨ Update link dashboard-nya ya!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages