{"id":40675878,"url":"https://github.com/iml1111/void","last_synced_at":"2026-02-03T11:16:52.000Z","repository":{"id":326341654,"uuid":"1100420418","full_name":"iml1111/void","owner":"iml1111","description":"VOID is a Vibe-Oriented In-Domain Design framework.","archived":false,"fork":false,"pushed_at":"2026-01-01T13:21:59.000Z","size":53,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-21T19:36:14.735Z","etag":null,"topics":["ddd","fastapi","hexagonal-architecture","python3","sqs-consumer"],"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/iml1111.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-11-20T09:00:27.000Z","updated_at":"2026-01-01T13:22:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/iml1111/void","commit_stats":null,"previous_names":["iml1111/void"],"tags_count":3,"template":true,"template_full_name":null,"purl":"pkg:github/iml1111/void","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2Fvoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2Fvoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2Fvoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2Fvoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iml1111","download_url":"https://codeload.github.com/iml1111/void/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iml1111%2Fvoid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29044104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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","fastapi","hexagonal-architecture","python3","sqs-consumer"],"created_at":"2026-01-21T09:40:08.708Z","updated_at":"2026-02-03T11:16:51.970Z","avatar_url":"https://github.com/iml1111.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VOID\n\n**DDD + Hexagonal Architecture FastAPI Boilerplate**\n\nA production-ready boilerplate for building FastAPI applications with Domain-Driven Design and Hexagonal Architecture patterns.\n\n## Features\n\n- **Domain-Driven Design**: Clean separation of domain logic from infrastructure\n- **Hexagonal Architecture**: Port-Adapter pattern for flexible dependency management\n- **FastAPI**: Modern, fast web framework with automatic OpenAPI documentation\n- **MongoDB**: Async database operations with Motor\n- **AWS SQS**: FIFO queue integration for async task processing\n- **Unit of Work**: Transaction support with MongoDB replica sets\n- **Three Entrypoints**: API, Worker, CLI for different use cases\n\n## Quick Start\n\n### 1. Clone and Setup\n\n```bash\n# Clone the repository\ngit clone \u003cyour-repo-url\u003e your-project\ncd your-project\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # or `venv\\Scripts\\activate` on Windows\n\n# Install dependencies\npip install -r src/requirements.txt\n```\n\n### 2. Configure Environment\n\n```bash\n# Copy example environment file\ncp .env.example .env\n\n# Edit .env with your settings\nvi .env\n```\n\n### 3. Run the Application\n\n```bash\n# API Server (development)\n./void run api\n\n# SQS Worker\n./void run worker\n\n# CLI Job\n./void run job \u003cJOB_NAME\u003e\n```\n\n## Project Structure\n\n```\nsrc/\n├── domain/              # Pure Python domain logic\n│   ├── entities/        # Domain entities\n│   ├── ports/           # Abstract interfaces\n│   └── value_objects/   # Enums and value objects\n├── service_layer/       # Application services\n│   ├── application/     # Use case implementations\n│   └── exceptions.py    # Business exceptions\n├── adapters/            # Infrastructure implementations\n│   ├── aws/             # SQS client/producer/consumer\n│   ├── http/            # HTTP client (httpx)\n│   ├── mongodb/         # MongoDB adapters\n│   ├── repositories/    # Repository implementations\n│   └── uow/             # Unit of Work\n├── entrypoints/         # Application entry points\n│   ├── api/             # FastAPI application\n│   ├── worker/          # SQS Worker\n│   └── cli/             # CLI Jobs\n└── config.py            # Configuration\n```\n\n## Available Commands\n\n```bash\n# Start API server with hot reload\n./void run api\n\n# Start SQS consumer worker\n./void run worker\n\n# Run a specific CLI job\n./void run job process_item --item-id 507f1f77bcf86cd799439011\n\n# List available jobs\n./void run job list\n```\n\n## API Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/` | Root endpoint |\n| GET | `/health` | Health check |\n| POST | `/api/v1/items` | Create item |\n| GET | `/api/v1/items/{id}` | Get item by ID |\n\n## Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `ENVIRONMENT` | Environment name | `development` |\n| `DEBUG` | Debug mode | `true` |\n| `MONGODB_URI` | MongoDB connection URI | `mongodb://localhost:27017` |\n| `MONGODB_NAME` | Database name | `void` |\n| `AWS_ACCESS_KEY_ID` | AWS access key | - |\n| `AWS_SECRET_ACCESS_KEY` | AWS secret key | - |\n| `AWS_REGION` | AWS region | `ap-northeast-2` |\n| `SQS_QUEUE_URL` | SQS FIFO queue URL | - |\n\n## Architecture\n\nThis project follows **Domain-Driven Design (DDD)** and **Hexagonal Architecture** principles:\n\n### Layers\n\n1. **Domain Layer** (`domain/`)\n   - Pure Python with no external dependencies\n   - Contains entities, value objects, and port interfaces\n\n2. **Service Layer** (`service_layer/`)\n   - Application services implementing use cases\n   - Orchestrates domain logic and infrastructure\n\n3. **Adapters Layer** (`adapters/`)\n   - Infrastructure implementations\n   - MongoDB repositories, AWS clients, HTTP clients\n\n4. **Entrypoints Layer** (`entrypoints/`)\n   - Application entry points\n   - API routes, Worker tasks, CLI jobs\n\n### Key Patterns\n\n- **Repository Pattern**: Abstract data access through interfaces\n- **Unit of Work**: Transactional consistency (use only for multi-write operations)\n- **Dependency Injection**: FastAPI's Depends for loose coupling\n- **Task Registry**: Decorator-based worker task registration\n- **Job Registry**: Decorator-based CLI job registration\n- **Exception Pattern**: Class-level `status_code`/`error_type` for automatic HTTP response mapping\n\n## Development\n\n### Adding a New Entity\n\n1. Create entity in `domain/entities/` (with `create()` factory method)\n2. Define repository port in `domain/ports/`\n3. Add value objects in `domain/value_objects/` (if needed)\n4. Implement MongoDB adapter in `adapters/mongodb/collections/`\n5. Implement repository in `adapters/repositories/mongodb/`\n6. Register repository in `adapters/uow/mongo_unit_of_work.py`\n\n### Adding a New API Endpoint\n\n1. Create schemas in `entrypoints/api/schemas/`\n2. Create route handler in `entrypoints/api/routes/`\n3. Register router in `entrypoints/api/routes/__init__.py`\n\n### Adding a New Worker Task\n\n1. Create task handler with `@task` decorator in `entrypoints/worker/tasks/`\n2. Add module to `TASK_MODULES` in `entrypoints/worker/tasks/__init__.py`\n\n### Adding a New CLI Job\n\n1. Create job handler with `@job` decorator in `entrypoints/cli/jobs/`\n2. Add module to `JOB_MODULES` in `entrypoints/cli/jobs/__init__.py`\n\n### Adding a New Exception\n\n1. Define exception in `service_layer/exceptions.py` inheriting from `ServiceError`\n2. Set `status_code` and `error_type` class attributes\n3. Exception is automatically handled by API (no additional registration needed)\n\n## Requirements\n\n- Python 3.9+\n- MongoDB (Replica Set for transactions)\n- AWS Account (for SQS)\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiml1111%2Fvoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiml1111%2Fvoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiml1111%2Fvoid/lists"}