A Python application with Flask, RabbitMQ, and Celery for asynchronous email sending and logging, deployed behind Nginx.
- 📧 Email Queueing: Send emails asynchronously via Celery/RabbitMQ
- ⏱ Time Logging: Log current timestamp to a file
- 📜 Log Viewer: Access application logs via web endpoint
- 🚀 Nginx Integration: Served behind a production-ready web server
- 🌐 Public Access: Exposed via tunneling (Ngrok/serveo)
- Python 3.8+
- RabbitMQ server
- Nginx
- SMTP credentials (for email functionality)
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/RabbitMQ-Messaging-System.git cd RabbitMQ-Messaging-System - Set up virtual environment:
python -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windowspython -m venv venv
- Install dependencies:
pip install -r requirements.txt
-
Set up environment variables in .env: SMTP_SERVER=smtp.example.com SMTP_PORT=587 SMTP_USERNAME=your_email@example.com SMTP_PASSWORD=your_password
-
RabbitMQ Setup
sudo systemctl start rabbitmq-server
- Start Celery Worker:
celery -A tasks worker --loglevel=info
- Start Flask Application:
python app.py
- Configure Nginx (sample config in nginx/ directory)
ngrok http 5000
. ├── app.py # Flask application ├── tasks.py # Celery tasks ├── requirements.txt # Dependencies ├── nginx/ # Nginx configuration │ └── messaging_system.conf ├── .env.example # Environment variables template └── /var/log/messaging_system.log # Generated log file
. RabbitMQ Not Running:
sudo systemctl status rabbitmq-server
. Permission denied for log file:
```bash
. Celery worker not connecting:
Verify RabbitMQ is running and check broker URL in tasks.py