Skip to content

Repository files navigation

EamagineWeather

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.

Features

  • 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

Tech Stack

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

Getting Started

Prerequisites

  • Node.js 18 or higher
  • Go 1.22 or higher
  • PostgreSQL
  • Redis (optional for development)

Frontend Setup

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

Backend Setup

cd 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.go

Environment Variables

Copy .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-key

Backend (.env)

DATABASE_URL=postgresql://user:password@localhost:5432/eamagine_weather
REDIS_URL=redis://localhost:6379
BMKG_API_BASE_URL=https://api.bmkg.go.id/publik

Project Structure

eamagineweather/
├── backend/
│   ├── internal/
│   │   ├── config/
│   │   ├── handler/
│   │   ├── repository/
│   │   └── service/
│   ├── schema.prisma
│   └── main.go
├── src/
│   ├── components/
│   ├── hooks/
│   ├── lib/
│   ├── stores/
│   └── types/
└── public/

API Endpoints

Weather

  • GET /api/v1/weather/current/:regionCode - Get current weather
  • GET /api/v1/weather/forecast/:regionCode - Get weather forecast
  • GET /api/v1/weather/search?q=query - Search locations

Regions

  • GET /api/v1/regions - List all regions
  • GET /api/v1/regions/:code - Get region details
  • GET /api/v1/regions/popular - Get popular regions

User

  • GET /api/v1/users/favorites - Get favorite locations
  • POST /api/v1/users/favorites - Add favorite location
  • DELETE /api/v1/users/favorites/:regionId - Remove favorite location

Development

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.

Deployment

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.

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

About

A modern full-stack weather application providing real-time Indonesian weather data through BMKG API integration. Built with React 19, TypeScript, Tailwind CSS, and Golang backend with Prisma ORM.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages