{"id":28801101,"url":"https://github.com/wnm-trojan/mailbox_api","last_synced_at":"2026-04-24T20:34:42.661Z","repository":{"id":298390548,"uuid":"999817713","full_name":"wnm-trojan/mailbox_api","owner":"wnm-trojan","description":"This is a mailbox system using Kafka that involves building a scalable and efficient messaging system where users can send, receive, and store messages.","archived":false,"fork":false,"pushed_at":"2025-07-12T08:21:34.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-12T10:21:24.848Z","etag":null,"topics":["fastapi","kafka","mailbox","mailbox-api","python3"],"latest_commit_sha":null,"homepage":"https://waruna.me","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wnm-trojan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-10T20:44:40.000Z","updated_at":"2025-07-12T08:21:37.000Z","dependencies_parsed_at":"2025-07-12T10:21:30.495Z","dependency_job_id":null,"html_url":"https://github.com/wnm-trojan/mailbox_api","commit_stats":null,"previous_names":["wnm-trojan/mailbox_api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wnm-trojan/mailbox_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnm-trojan%2Fmailbox_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnm-trojan%2Fmailbox_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnm-trojan%2Fmailbox_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnm-trojan%2Fmailbox_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wnm-trojan","download_url":"https://codeload.github.com/wnm-trojan/mailbox_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnm-trojan%2Fmailbox_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32239944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","kafka","mailbox","mailbox-api","python3"],"created_at":"2025-06-18T07:06:33.029Z","updated_at":"2026-04-24T20:34:42.657Z","avatar_url":"https://github.com/wnm-trojan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mailbox API\n\nA simple FastAPI-based mailbox API for managing and sending emails. This mailbox system using Kafka involves building a scalable and efficient messaging system where users can send, receive, and store messages.\n\n## Features\n\n- Send emails via API endpoints\n- Manage mailbox data\n- FastAPI backend\n\n## Requirements\n\n- Python 3.8+\n- [pip](https://pip.pypa.io/en/stable/)\n\n## Installation\n\n1. **Clone the repository:**\n    ```bash\n    git clone https://github.com/your-username/mailbox_api.git\n    cd mailbox_api\n    ```\n\n2. **Create a virtual environment (optional but recommended):**\n    ```bash\n    python -m venv venv\n    source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n    ```\n\n3. **Install dependencies:**\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n## Running the API\n\n```bash\nuvicorn main:app --reload\n```\n\n- The API will be available at: [http://localhost:8000](http://localhost:8000)\n- Interactive docs: [http://localhost:8000/docs](http://localhost:8000/docs)\n\n## Configuration\n\n- Edit `config.py` or environment variables as needed for email settings.\n\n## Running Kafka and Redis (Cache)\n\nTo enable email queuing and caching, you may need to run Kafka and Redis:\n\n### Start Kafka (using Docker)\n\n```bash\ndocker run -d --name kafka -p 9092:9092 -e KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 bitnami/kafka:latest\n```\n\n\u003e **Note:** You may also need to run Zookeeper:\n\u003e\n\u003e ```bash\n\u003e docker run -d --name zookeeper -p 2181:2181 bitnami/zookeeper:latest\n\u003e ```\n\n### Start Redis (using Docker)\n\n```bash\ndocker run -d --name redis -p 6379:6379 redis:latest\n```\n\nMake sure your application is configured to connect to these services as needed.\n\n## Running Kafka and Redis (Without Docker)\n\nIf you prefer not to use Docker, you can run Kafka and Redis directly on your system:\n\n### Install and Start Zookeeper\n\nKafka requires Zookeeper. Download and extract [Apache Zookeeper](https://zookeeper.apache.org/releases.html):\n\n```bash\ntar -xzf apache-zookeeper-*.tar.gz\ncd apache-zookeeper-*/\nbin/zkServer.sh start\n```\n\nor \n\n```bash\ncd kafka_2.13-3.6.1\nbin/zookeeper-server-start.sh config/zookeeper.properties\n```\n\n### Install and Start Kafka\n\nDownload and extract [Apache Kafka](https://kafka.apache.org/downloads):\n\n```bash\ntar -xzf kafka_*.tgz\ncd kafka_*/\nbin/kafka-server-start.sh config/server.properties\n```\n\nor\n\n```bash\ncd kafka_2.13-3.6.1\nbin/kafka-server-start.sh config/server.properties\n```\n\n### Install and Start Redis\n\nInstall Redis using your package manager:\n\n- **Ubuntu/Debian:**\n    ```bash\n    sudo apt update\n    sudo apt install redis-server\n    sudo systemctl start redis\n    ```\n- **macOS (with Homebrew):**\n    ```bash\n    brew install redis\n    brew services start redis\n    ```\n\nRefer to the official documentation for more details on configuration and management.\n\n## Alembic Setup\n\nAlembic is used for handling database migrations.\n\n### a. Install Alembic\n\n```bash\npip install alembic\nalembic init alembic\n```\n\n### b. Configure Database URL\n\nEdit `alembic.ini` and set your database URL:\n\n```ini\nsqlalchemy.url = postgresql://postgres:postgres@postgres:5432/mailbox_db\n```\n\n### c. Create and Apply Migrations\n\nGenerate and apply your initial migration:\n\n```bash\nalembic revision --autogenerate -m \"init schema\"\nalembic upgrade head\n```\n\n## You need to run this app\n\n### Run it without docker (Using linux OS)\nFirst you have to run kafka \n```bash\ncd kafka_2.13-3.6.1\nbin/zookeeper-server-start.sh config/zookeeper.properties\n```\n```bash\ncd kafka_2.13-3.6.1\nbin/kafka-server-start.sh config/server.properties\n```\nThen you should start postgresql server and radis\n```bash\n    sudo systemctl start postgresql\n    sudo systemctl start redis\n```\nNow You can run your FastApi App\n* Go to you python venv\n```bash\n    source venv/bin/activate\n```\n* Run your app\n```bash\n    uvicorn app.main:app --reload\n```\nThen you should run your kafka consumer service\n* Go to you python venv and then\n```bash\n    python consumer_service.py\n```\nNow you test your FastApi mailbox app using below url\n- The API will be available at: [http://localhost:8000](http://localhost:8000)\n- Interactive docs: [http://localhost:8000/docs](http://localhost:8000/docs)\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnm-trojan%2Fmailbox_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwnm-trojan%2Fmailbox_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnm-trojan%2Fmailbox_api/lists"}