This repository features a Flask REST API for CRUD operations on weather and event data by date and city. Organized into microservices with a reusable template, it employs Docker for containerization, Elastic Stack for logging and monitoring, and Consul for service discovery and configuration. Each microservice is containerized for isolated, scalable deployment.
- Flask: Web framework for Python used to develop the REST API.
- Docker: Platform for containerization, ensuring portability across different environments.
- Elastic Stack: Suite for logging and monitoring, including Elasticsearch, Logstash, and Kibana.
- Consul: Tool for service discovery and configuration management.
- MySQL: Database used for storing event data.
- Redis: Database used for storing weather data.
- Docker and Docker Compose installed on your machine.
-
Clone the repository:
git clone https://github.com/username/repo-name.git cd repo-name
-
Build and run the Docker containers:
docker-compose up --build
To get information about a citybreak for a specific city and date:
GET /citybreak?city=<CITY>&date=<DATE>
To post weather data for a specific city and date:
curl -X POST http://localhost:8081/weather -d "city=<CITY>&temperature=<TEMP>&humidity=<HUMIDITY>&wind=<WIND>&date=<DATE>"
To post event data for a specific city and date:
curl -X POST http://localhost:5000/service_events -d "city=<CITY>&name=<EVENT_NAME>&date=<DATE>&description=<DESCRIPTION>"
To monitor logs and view data visualizations, access Kibana at:
http://localhost:5601
Consul is used for service discovery and configuration. Ensure that Consul is properly configured and running. Access the Consul UI at:
http://localhost:8500