# Distributed Chat Backend with Redundancy

[](https://badge.fury.io/py/back_chat)

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
1. Clone the repository:
```bash
git clone https://github.com/AbelGRubio/backend-chat.git
cd backend-chat
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Create a `.env` file with the required variables (RabbitMQ, DB, etc.)
---
## βΆοΈ Running the App
```bash
python src
```
Or with FastAPI and Uvicorn:
```bash
uvicorn src.back_chat:app --host 0.0.0.0 --port 8000
```
---
## π Required Environment Variables
```env
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
[Backend Chat](https://hub.docker.com/repository/docker/agrubio/backend-chat/general)
---
## π§ͺ 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](LICENSE).
---
## β¨ Author
**Abel G. Rubio**
GitHub: [@AbelGRubio](https://github.com/AbelGRubio)
Raw data
{
"_id": null,
"home_page": "https://github.com/AbelGRubio/backend-chat.git",
"name": "back-chat",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "development, setup, setuptools",
"author": "agrubio",
"author_email": "contact@agrubio.dev",
"download_url": "https://files.pythonhosted.org/packages/d0/62/9b35b8293bed0e388f0b46cc65de7979d5d3f3b72e926d0b525acb3f9951/back_chat-1.1.5.tar.gz",
"platform": null,
"description": "# Distributed Chat Backend with Redundancy\n\n\n[](https://badge.fury.io/py/back_chat)\n\n\nThis 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).\n\n## \u2699\ufe0f Key Features\n\n- \ud83d\udcac Stores incoming chat messages in a relational database.\n- \ud83d\udd01 Redundancy and synchronization across multiple backend instances.\n- \ud83d\udd78\ufe0f Inter-process communication using RabbitMQ.\n- \ud83d\udd10 Horizontally scalable architecture.\n- \ud83d\ude80 Ready for deployment in Docker/Kubernetes environments.\n\n---\n\n## \ud83e\uddf1 High-Level Architecture\n\n```\n+-----------+ +-------------+ +-----------+\n| Frontend | <---> | Backend A | <---> | Backend B |\n+-----------+ +-------------+ +-----------+\n \u2191 \u2193 \u2191 \u2193\n [RabbitMQ] <----------> [RabbitMQ]\n \u2191 \u2193 \u2191 \u2193\n [Database] [Database]\n```\n\n> All backend instances are synchronized via message queues, allowing for load distribution and consistency.\n\n---\n\n## \ud83d\ude80 Installation\n\n1. Clone the repository:\n ```bash\n git clone https://github.com/AbelGRubio/backend-chat.git\n cd backend-chat\n ```\n\n2. Install dependencies:\n ```bash\n pip install -r requirements.txt\n ```\n\n3. Create a `.env` file with the required variables (RabbitMQ, DB, etc.)\n\n---\n\n## \u25b6\ufe0f Running the App\n\n```bash\npython src\n```\n\nOr with FastAPI and Uvicorn:\n\n```bash\nuvicorn src.back_chat:app --host 0.0.0.0 --port 8000\n```\n\n---\n\n## \ud83d\udee0 Required Environment Variables\n\n```env\nRABBITMQ_URL=amqp://user:password@rabbitmq:5672/\nDATABASE_URL=postgresql://user:password@localhost:5432/chat\nINSTANCE_ID=backend-a\n```\n\n---\n\n## \u2705 Requirements\n\n- Python 3.12+\n- RabbitMQ\n- PostgreSQL (or equivalent)\n- Docker (optional but recommended)\n\n---\n\n## Docker\n\n[Backend Chat](https://hub.docker.com/repository/docker/agrubio/backend-chat/general)\n\n---\n\n## \ud83e\uddea Tests\n\n_Pending integration of automatic tests using `pytest`._\n\n---\n\n## \ud83e\udd1d Contributing\n\nContributions, suggestions, and issues are welcome! Feel free to open a PR or issue.\n\n---\n\n## \ud83e\udeaa License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n## \u2728 Author\n\n**Abel G. Rubio** \nGitHub: [@AbelGRubio](https://github.com/AbelGRubio)\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "1.1.5",
"project_urls": {
"Homepage": "https://github.com/AbelGRubio/backend-chat.git"
},
"split_keywords": [
"development",
" setup",
" setuptools"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a3adb9375589879c808a1e2bb52299ba6abd0744a6b45343c27acf9fb26f4066",
"md5": "0c264c1ed734274fd39517d3167cb34a",
"sha256": "4c9a452e01d51dce0b16c13d46e261ca38058a6c5277c434789904e8f49bf5a5"
},
"downloads": -1,
"filename": "back_chat-1.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0c264c1ed734274fd39517d3167cb34a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 23532,
"upload_time": "2025-08-28T12:32:40",
"upload_time_iso_8601": "2025-08-28T12:32:40.996861Z",
"url": "https://files.pythonhosted.org/packages/a3/ad/b9375589879c808a1e2bb52299ba6abd0744a6b45343c27acf9fb26f4066/back_chat-1.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d0629b35b8293bed0e388f0b46cc65de7979d5d3f3b72e926d0b525acb3f9951",
"md5": "42e9c97fd8f5e82066c3bed7691ab668",
"sha256": "e3abb7a49c0b60af26b6b7fa7733c5187c37ac6d64f1e5e7759be3a7f29107ee"
},
"downloads": -1,
"filename": "back_chat-1.1.5.tar.gz",
"has_sig": false,
"md5_digest": "42e9c97fd8f5e82066c3bed7691ab668",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 20381,
"upload_time": "2025-08-28T12:32:42",
"upload_time_iso_8601": "2025-08-28T12:32:42.820836Z",
"url": "https://files.pythonhosted.org/packages/d0/62/9b35b8293bed0e388f0b46cc65de7979d5d3f3b72e926d0b525acb3f9951/back_chat-1.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-28 12:32:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AbelGRubio",
"github_project": "backend-chat",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "back-chat"
}