Skip to content

McMerger/LunaWeather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LunaWeather

A modern full-stack weather application with real-time data, detailed forecasts, and intelligent insights. Built with Next.js and Kotlin/Ktor for seamless local and Docker deployment.

Features

  • Real-time weather from OpenMeteo for any city worldwide
  • 5-day forecast with detailed temperature and conditions
  • Global location search
  • Intelligent "feels like" descriptions and recommendations
  • Dark/light theme support
  • Favorite locations and customization
  • Responsive glassmorphism UI design

Quick Start

Docker (Recommended)

npm run docker:up          # Start containers
npm run docker:logs        # View logs
npm run docker:down        # Stop containers

Access at: http://localhost:3000 (Frontend) | http://localhost:8080 (Backend)

Local Development

Prerequisites: Node.js 20+, Java JDK 17+

# Install and configure
npm install
cp .env.example .env

# Start (Linux/Mac)
chmod +x start.sh && ./start.sh

# Start (Windows)
start.bat

# Manual start
./run-backend.sh          # Terminal 1
npm run dev               # Terminal 2

Access at: http://localhost:9002 (Frontend) | http://localhost:8080 (Backend)

Tech Stack

Frontend: Next.js 15, TypeScript, Tailwind CSS, shadcn/ui
Backend: Kotlin, Ktor, SQLite, Exposed
APIs: OpenMeteo (weather), Nominatim (geocoding)

Configuration

Copy .env.example to .env and configure:

Local:

NEXT_PUBLIC_API_URL=http://localhost:8080
NODE_ENV=development

Docker: Automatically configured via docker-compose.yml

Available Scripts

Development:

npm run dev              # Start dev server (Turbopack)
npm run build            # Build for production
npm start                # Start production server
npm run lint             # Run ESLint

Docker:

npm run docker:build     # Build images
npm run docker:up        # Start containers
npm run docker:down      # Stop containers
npm run docker:logs      # View logs
npm run docker:clean     # Remove all containers/volumes

Backend:

./run-backend.sh         # Build and run
./gradlew build          # Build only

API Endpoints

  • GET /weather?city=<city_name> - Current weather and forecast
  • POST /weather/rating - Submit rating (Body: { "rating": number, "city": string })

Troubleshooting

Backend won't start:

  • Verify Java 17+: java -version
  • Check port 8080 availability

Frontend can't connect:

  • Verify backend is running: curl http://localhost:8080/weather?city=London
  • Check .env has correct NEXT_PUBLIC_API_URL

Docker issues:

  • Ensure Docker is running
  • Check port conflicts: docker ps
  • View logs: npm run docker:logs

Production Deployment

docker-compose build --no-cache
docker-compose up -d
docker-compose logs -f

Configure reverse proxy, SSL/TLS, and security headers as needed.

Credits

Contributors

This project was developed as a collaborative team effort:

  • Mailles - Frontend & Integration (Next.js development and backend integration)
  • Backend Team - Two collaborators responsible for Kotlin/Ktor backend and API design

License

MIT License

About

Modern full-stack weather app with real-time data, detailed forecasts, and smart insights, built with Next.js and Kotlin/Ktor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors