https://github.com/anganda/citybreak-flask-api-with-microservices
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.
https://github.com/anganda/citybreak-flask-api-with-microservices
consul docker elasticsearch elasticstack flask kibana logging microservices mysql redis
Last synced: 7 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/anganda/citybreak-flask-api-with-microservices
- Owner: AngAnda
- Created: 2024-07-31T12:01:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-04T19:06:11.000Z (over 1 year ago)
- Last Synced: 2025-06-25T22:02:06.569Z (7 months ago)
- Topics: consul, docker, elasticsearch, elasticstack, flask, kibana, logging, microservices, mysql, redis
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Project Overview
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.
## Technologies Used
- **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.
## Getting Started
### Prerequisites
- Docker and Docker Compose installed on your machine.
### Installation
1. **Clone the repository**:
```sh
git clone https://github.com/username/repo-name.git
cd repo-name
```
2. **Build and run the Docker containers**:
```sh
docker-compose up --build
```
## API Usage
### Endpoints
#### Access Citybreak Information
To get information about a citybreak for a specific city and date:
```sh
GET /citybreak?city=&date=
```
#### Post Weather Data
To post weather data for a specific city and date:
```sh
curl -X POST http://localhost:8081/weather -d "city=&temperature=&humidity=&wind=&date="
```
#### Post Event Data
To post event data for a specific city and date:
```sh
curl -X POST http://localhost:5000/service_events -d "city=&name=&date=&description="
```
### Monitoring and Logging
#### Accessing Kibana
To monitor logs and view data visualizations, access Kibana at:
```sh
http://localhost:5601
```
### Service Discovery and Configuration
#### Consul Usage
Consul is used for service discovery and configuration. Ensure that Consul is properly configured and running. Access the Consul UI at:
```sh
http://localhost:8500
```