README
Weather Dashboard with Redis Cache
A learning experiment to understand containerization, microservices, and Kubernetes orchestration. This project implements a weather service with Redis caching to explore cloud-native development practices.
Overview
This project serves as a hands-on learning experience for:
- Containerization with Docker
- Kubernetes deployment and orchestration
- Microservices architecture
- Caching strategies with Redis
- Go API development
- Infrastructure as Code
Technologies Used
Core Technologies
- Go (Golang): Backend API development
- Redis: Caching layer
- Docker: Containerization
- Kubernetes: Container orchestration
Libraries and Frameworks
gorilla/mux: HTTP routinggo-redis/redis: Redis client for Gominikube: Local Kubernetes development
Tools and Services
- Docker Hub: Container registry
- kubectl: Kubernetes CLI tool
- Bash scripting: Deployment automation
- Visual Studio Code: Development environment
Architecture
graph TD
Client[Client] --> LB[LoadBalancer]
LB --> WS1[Weather Service Pod 1]
LB --> WS2[Weather Service Pod 2]
LB --> WS3[Weather Service Pod 3]
WS1 --> Redis[Redis Cache Pod]
WS2 --> Redis
WS3 --> Redis
Features
- RESTful API for weather information
- Redis caching with TTL
- Horizontal scaling with Kubernetes
- Health check endpoints
- Environment-based configuration
- Automated deployment process
Prerequisites
- Go 1.21 or higher
- Docker
- Kubernetes cluster (or Minikube)
- kubectl configured
- Redis
Quick Start
bash
git clone https://github.com/yourusername/weather-dashboard.git
cd weather-dashboard
bash
WEATHER_API_KEY=your_api_key
REDIS_HOST=localhost
REDIS_PORT=6379
PORT=8080
bash
chmod +x deploy.sh
./deploy.sh
bash
# Get service URL
minikube service weather-service --url
# Test endpoints
curl http://<service-url>/api/weather/london
curl http://<service-url>/api/health
curl http://<service-url>/api/cache/stats
API Endpoints
GET /api/weather/{location}: Get weather for a locationGET /api/health: Health check endpointGET /api/cache/stats: Redis cache statisticsGET /api/cache: List cached keys
Development Notes
This project was created as a learning experience to understand:
- How to structure a Go microservice
- Implementing caching strategies
- Kubernetes deployment patterns
- Container orchestration practices
- DevOps automation
Acknowledgments
- Kubernetes documentation
- Go community
- Redis documentation
- Docker tutorials
- Anthropic
Contact
Created by Jonathan Leahy - feel free to contact me!