{"id":48806360,"url":"https://github.com/tsotetsi/banking-withdrawal-fastapi","last_synced_at":"2026-04-14T05:33:51.878Z","repository":{"id":321373611,"uuid":"1056764816","full_name":"tsotetsi/banking-withdrawal-fastapi","owner":"tsotetsi","description":"Simulation of A Simple Bank Account Withdrawal Service Using FastAPI.","archived":false,"fork":false,"pushed_at":"2025-10-29T08:40:43.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-10-29T10:32:54.657Z","etag":null,"topics":["ddd-architecture","docker","docker-compose","fastapi","grafana","microservices","postgresql","prometheus","python3","sns","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsotetsi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-14T18:54:14.000Z","updated_at":"2025-10-29T08:40:46.000Z","dependencies_parsed_at":"2025-10-29T10:32:57.360Z","dependency_job_id":null,"html_url":"https://github.com/tsotetsi/banking-withdrawal-fastapi","commit_stats":null,"previous_names":["tsotetsi/banking-withdrawal-fastapi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tsotetsi/banking-withdrawal-fastapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsotetsi%2Fbanking-withdrawal-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsotetsi%2Fbanking-withdrawal-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsotetsi%2Fbanking-withdrawal-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsotetsi%2Fbanking-withdrawal-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsotetsi","download_url":"https://codeload.github.com/tsotetsi/banking-withdrawal-fastapi/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsotetsi%2Fbanking-withdrawal-fastapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31784253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"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":["ddd-architecture","docker","docker-compose","fastapi","grafana","microservices","postgresql","prometheus","python3","sns","sqlalchemy"],"created_at":"2026-04-14T05:33:51.167Z","updated_at":"2026-04-14T05:33:51.860Z","avatar_url":"https://github.com/tsotetsi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Banking Core Withdrawal API\n\n\u003cdiv align=\"center\"\u003e\n\n  [![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker\u0026logoColor=white)](https://www.docker.com/)\n  [![FastAPI](https://img.shields.io/badge/FastAPI-0.115-009688?logo=fastapi\u0026logoColor=white)](https://fastapi.tiangolo.com/)\n  [![Pydantic](https://img.shields.io/badge/-Pydantic-464646?logo=Pydantic)](https://docs.pydantic.dev/latest/)\n  [![Python](https://img.shields.io/badge/Python-3.13+-3776ab?logo=python\u0026logoColor=white)](https://www.python.org/)\n  [![PostgreSQL](https://img.shields.io/badge/PostgreSQL-17+-316192?style=flat\u0026logo=postgresql\u0026logoColor=white)](https://www.postgresql.org)\n  [![Prometheus](https://img.shields.io/badge/prometheus-3.0.6-fab005?style=flat\u0026logo=prometheus)](https://prometheus.io/docs/introduction/overview/)\n  [![Grafana](https://img.shields.io/badge/grafana-12.2-fab005?style=flat\u0026logo=grafana)](https://grafana.com/docs/)\n  [![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)\n\n\u003c/div\u003e\n\n\u003e A FastAPI-based banking core withdrawal service with full observability, audit logging, and domain-driven design approach.\n\n## Features\n\n- ✅ RESTful Withdrawal API with validation.\n- ✅ Domain-Driven Design architecture.\n- ✅ Request correlation and distributed tracing.\n- ✅ Performance monitoring with latency logging.\n- ✅ Structured logging for observability.\n- ✅ Event-driven architecture.\n- ✅ Comprehensive error handling.\n- ✅ Unit and integration tests.\n\n## 🚀 Getting Started\n\n#### Prerequisites\n- Python 3.13+\n- Docker and Docker compose\n\n#### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/tsotetsi/banking-withdrawal-fastapi.git\ncd banking-withdrawal-fastapi\n```\n### 🐳 Docker Support\n\nRun the following commad to spin-off all system services.\n\nSee `.env.example` for env values that you need to setup.\n\n```bash\ndocker compose up --build\n```\n\n### 📖 Alternative Documentation\n\n- ReDoc: http://localhost:8000/redoc\n\n- Beautiful, responsive API documentation.\n\n- Better for reading and understanding API structure.\n\n\n### 🧪 Testing\n```bash\n# Run all tests\npytest -v\n\n# Run with coverage report\npytest --cov=app --cov-report=html\n\n# Run specific test categories\npytest tests/unit/ -v\npytest tests/integration/ -v\n```\n\n### 🏗️ Architecture(DDD directory structure)\n```text\napp/\n├── domain/           # Business logic layer\n│   ├── models.py     # Domain models\n│   ├── services.py   # Business services\n│   └── exceptions.py # Domain exceptions\n├── infrastructure/   # Technical implementation\n│   ├── repository.py # Data persistence\n│   ├── event_bus.py  # Event publishing\n│   └── middleware/   # HTTP middlewares\n├── schemas/          # API contracts\n│   └── withdrawal.py # Request/response schemas\n└── api/              # HTTP layer\n    └── v1/           # API versioning\n```\n### 📡 API Usage\n\nWithdrawal Request Example\n```bash\ncurl -X POST \"http://localhost:8000/api/v1/withdrawal\"   -H \"Content-Type: application/json\"   -d '{\n    \"account_id\": \"1234567\",\n    \"amount\": 50.00,\n    \"correlation_id\": \"123e4567-e89b-12d3-a456-426614174001\"\n  }'\n```\n\n**Example Response**\n\n```json\n{\n  \"transaction_id\":\"f4f3128e-bdd7-4cda-bb6c-0e0cc885bc3d\",\"account_id\":\"42a52f24-7359-4b31-8dac-b884bb4eb861\",\"amount\":\"50.00\",\"balance\":\"600.00\",\"correlation_id\":\"123e4567-e89b-12d3-a456-426614174001\"\n}\n```\n\n## Access Grafana\n- Go to: http://localhost:3000\nLogin: admin/admin\n\n- Add Prometheus datasource: http://prometheus:9090\n\n- Create dashboard or import the banking dashboard\n\n- Available Metrics:\n**http_requests_total** - Request count by endpoint and status\n**http_request_duration_seconds** - Request latency\n**withdrawal_requests_total** - Withdrawal success/failure rates\n**withdrawal_amount** - Distribution of withdrawal amounts\n**transaction_processing_seconds** - Transaction processing time\n\n### 📝 License\n\nMIT License - See LICENSE file for details.\n\n### 🤝 Contributing\n\n- Fork the repository.\n\n- Create a feature branch.\n\n- Add tests for new functionality.\n\n- Submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsotetsi%2Fbanking-withdrawal-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsotetsi%2Fbanking-withdrawal-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsotetsi%2Fbanking-withdrawal-fastapi/lists"}