A modern weather application providing real-time Indonesian weather data through BMKG (Badan Meteorologi, Klimatologi, dan Geofisika) API integration. Built with React, TypeScript, and Golang.
- Real-time weather data for all regions in Indonesia
- Weather forecasts updated every 3 hours for 3-day periods
- Interactive charts for temperature, humidity, wind speed, and cloud coverage
- Location search with autocomplete and favorites system
- Weather alerts for extreme conditions
- Glass morphism design with time-based gradient backgrounds
- Fully responsive for mobile and desktop
Frontend
- React 19 with TypeScript
- Vite for fast builds and HMR
- Tailwind CSS for styling
- Framer Motion for animations
- Zustand for state management
- Recharts for data visualization
- Radix UI for accessible components
Backend
- Golang 1.22 with Gin framework
- Prisma ORM with PostgreSQL
- Redis for caching
- RESTful API architecture
- Node.js 18 or higher
- Go 1.22 or higher
- PostgreSQL
- Redis (optional for development)
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run previewcd backend
# Install Go dependencies
go mod download
# Generate Prisma client
go run github.com/steebchen/prisma-client-go generate
# Push database schema
go run github.com/steebchen/prisma-client-go db push
# Start backend server
go run main.goCopy .env.example to .env and configure:
Frontend (.env)
VITE_API_BASE_URL=http://localhost:8080/api/v1
VITE_SUPABASE_URL=your-supabase-url
VITE_SUPABASE_ANON_KEY=your-supabase-keyBackend (.env)
DATABASE_URL=postgresql://user:password@localhost:5432/eamagine_weather
REDIS_URL=redis://localhost:6379
BMKG_API_BASE_URL=https://api.bmkg.go.id/publikeamagineweather/
├── backend/
│ ├── internal/
│ │ ├── config/
│ │ ├── handler/
│ │ ├── repository/
│ │ └── service/
│ ├── schema.prisma
│ └── main.go
├── src/
│ ├── components/
│ ├── hooks/
│ ├── lib/
│ ├── stores/
│ └── types/
└── public/
GET /api/v1/weather/current/:regionCode- Get current weatherGET /api/v1/weather/forecast/:regionCode- Get weather forecastGET /api/v1/weather/search?q=query- Search locations
GET /api/v1/regions- List all regionsGET /api/v1/regions/:code- Get region detailsGET /api/v1/regions/popular- Get popular regions
GET /api/v1/users/favorites- Get favorite locationsPOST /api/v1/users/favorites- Add favorite locationDELETE /api/v1/users/favorites/:regionId- Remove favorite location
The application uses Vite for hot module replacement during development. Backend auto-reloads can be set up using tools like Air or nodemon equivalent for Go.
Frontend: Can be deployed to Vercel, Netlify, or similar platforms that support static sites.
Backend: Can be deployed to Railway, Fly.io, or any platform that supports Go applications.
MIT License
Contributions are welcome! Please feel free to submit issues or pull requests.