https://github.com/abderrahmane-stack/flask-redis-iot
This project demonstrates an IoT setup where an ESP8266 microcontroller sends data to a Flask web application hosted in Docker. The ESP8266 transmits a name field via HTTP POST requests. Upon receiving this, Flask generates a timestamp and stores both name and date in a Redis database.
https://github.com/abderrahmane-stack/flask-redis-iot
flask iot redis
Last synced: 5 months ago
JSON representation
This project demonstrates an IoT setup where an ESP8266 microcontroller sends data to a Flask web application hosted in Docker. The ESP8266 transmits a name field via HTTP POST requests. Upon receiving this, Flask generates a timestamp and stores both name and date in a Redis database.
- Host: GitHub
- URL: https://github.com/abderrahmane-stack/flask-redis-iot
- Owner: abderrahmane-stack
- Created: 2024-11-05T14:22:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-05T14:28:52.000Z (over 1 year ago)
- Last Synced: 2025-04-12T05:36:11.614Z (about 1 year ago)
- Topics: flask, iot, redis
- Language: C++
- Homepage:
- Size: 194 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flask-Redis IoT Project
This project demonstrates an IoT setup where an ESP8266 module sends data to a Flask web application hosted in a Docker container. The data is stored in a Redis database, also running in Docker.
## Project Structure
- `app.py`: Flask application that receives data and stores it in Redis.
- `Dockerfile`: Configuration for building the Flask app Docker image.
- `docker-compose.yaml`: Configuration for setting up both Flask and Redis services.
- `requirements.txt`: Python dependencies required for the Flask app.
- `index.html`: HTML template for viewing stored data (optional).
## Setup Instructions
### Prerequisites
- Docker and Docker Compose
- Python 3.x and pip
- ESP8266 module (configured to send HTTP requests to the Flask app)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/abderrahmane-stack/flask-redis-iot.git
cd flask-redis-iot
2. Build and start the Docker containers:
```bash
docker-compose up --build -d
```
## Usage
Ensure your ESP8266 is configured to send JSON data (only name field) to the Flask app's endpoint.
Open http://localhost:5000/ in your browser to view the JSON data.
Access http://localhost:5000/action to view data in a web interface.