No project description provided
Project description
Distributed Chat Backend with Redundancy
This project is a Python-based backend designed to handle message storage in a database and ensure high availability and redundancy through communication between multiple backend instances using message queues (RabbitMQ).
⚙️ Key Features
- 💬 Stores incoming chat messages in a relational database.
- 🔁 Redundancy and synchronization across multiple backend instances.
- 🕸️ Inter-process communication using RabbitMQ.
- 🔐 Horizontally scalable architecture.
- 🚀 Ready for deployment in Docker/Kubernetes environments.
🧱 High-Level Architecture
+-----------+ +-------------+ +-----------+
| Frontend | <---> | Backend A | <---> | Backend B |
+-----------+ +-------------+ +-----------+
↑ ↓ ↑ ↓
[RabbitMQ] <----------> [RabbitMQ]
↑ ↓ ↑ ↓
[Database] [Database]
All backend instances are synchronized via message queues, allowing for load distribution and consistency.
🚀 Installation
-
Clone the repository:
git clone https://github.com/AbelGRubio/backend-chat.git cd backend-chat
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile with the required variables (RabbitMQ, DB, etc.)
▶️ Running the App
python src
Or with FastAPI and Uvicorn:
uvicorn src.back_chat:app --host 0.0.0.0 --port 8000
🛠 Required Environment Variables
RABBITMQ_URL=amqp://user:password@rabbitmq:5672/
DATABASE_URL=postgresql://user:password@localhost:5432/chat
INSTANCE_ID=backend-a
✅ Requirements
- Python 3.12+
- RabbitMQ
- PostgreSQL (or equivalent)
- Docker (optional but recommended)
Docker
🧪 Tests
Pending integration of automatic tests using pytest.
🤝 Contributing
Contributions, suggestions, and issues are welcome! Feel free to open a PR or issue.
🪪 License
This project is licensed under the MIT License.
✨ Author
Abel G. Rubio
GitHub: @AbelGRubio
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file back_chat-1.1.5.tar.gz.
File metadata
- Download URL: back_chat-1.1.5.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3abb7a49c0b60af26b6b7fa7733c5187c37ac6d64f1e5e7759be3a7f29107ee
|
|
| MD5 |
42e9c97fd8f5e82066c3bed7691ab668
|
|
| BLAKE2b-256 |
d0629b35b8293bed0e388f0b46cc65de7979d5d3f3b72e926d0b525acb3f9951
|
File details
Details for the file back_chat-1.1.5-py3-none-any.whl.
File metadata
- Download URL: back_chat-1.1.5-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c9a452e01d51dce0b16c13d46e261ca38058a6c5277c434789904e8f49bf5a5
|
|
| MD5 |
0c264c1ed734274fd39517d3167cb34a
|
|
| BLAKE2b-256 |
a3adb9375589879c808a1e2bb52299ba6abd0744a6b45343c27acf9fb26f4066
|