{"id":15002532,"url":"https://github.com/tranvuongduy2003/eventhub","last_synced_at":"2025-10-30T08:31:23.314Z","repository":{"id":250557145,"uuid":"834756574","full_name":"tranvuongduy2003/EventHub","owner":"tranvuongduy2003","description":"A RESTful API server for the application about managing, hosting events and selling their tickes. Implementing Clean Architecture, DDD, CQRS, Repository, Unit of Work Patterns, Caching with Redis and Decorator Pattern, Idempotency and Outbox Pattern, Real-time Chat and Notification.","archived":false,"fork":false,"pushed_at":"2024-12-19T06:10:22.000Z","size":1027,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T07:23:05.714Z","etag":null,"topics":["clean-architecture","cqrs","docker","domain-driven-design","hangfire","idempotency","mediatr","mssql","redis","repository","seq","signalr","transactional-outbox","unit-of-work"],"latest_commit_sha":null,"homepage":"","language":"C#","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/tranvuongduy2003.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-07-28T09:09:29.000Z","updated_at":"2024-12-27T09:45:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"005dcb2c-64a7-4a8e-8342-06a8ebce6be2","html_url":"https://github.com/tranvuongduy2003/EventHub","commit_stats":{"total_commits":49,"total_committers":3,"mean_commits":"16.333333333333332","dds":"0.44897959183673475","last_synced_commit":"08df7f582dfbd89dcb3db63f5696a90cb7450cc6"},"previous_names":["tranvuongduy2003/eventhub"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranvuongduy2003%2FEventHub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranvuongduy2003%2FEventHub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranvuongduy2003%2FEventHub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tranvuongduy2003%2FEventHub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tranvuongduy2003","download_url":"https://codeload.github.com/tranvuongduy2003/EventHub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238945668,"owners_count":19556700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["clean-architecture","cqrs","docker","domain-driven-design","hangfire","idempotency","mediatr","mssql","redis","repository","seq","signalr","transactional-outbox","unit-of-work"],"created_at":"2024-09-24T18:51:00.357Z","updated_at":"2025-10-30T08:31:23.308Z","avatar_url":"https://github.com/tranvuongduy2003.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EventHub\n\nEventHub is an advanced event management platform built using modern software design principles and patterns. This README serves as a guide for understanding the architecture, folder structure, patterns, and deployment details of the application.\n\n---\n\n## ⭐ Give Us a Star\n\nIf this project is helpful to you, please consider giving it a star on GitHub. Your support means a lot!\n\n---\n\n## Solution Structure\n\nThe project is structured as follows:\n\n```\nEventHub\n├── deploy\n│   ├── .dockerignore\n│   ├── docker-compose.yml\n│   ├── docker-compose.development.yml\n│   └── docker-compose.production.yml\n├── Solution Items\n│   ├── .editorconfig\n│   ├── .gitignore\n│   ├── .gitlab-ci.yml\n│   ├── Directory.Build.props\n│   ├── LICENSE.txt\n│   └── README.md\n└── source\n    ├── EventHub.Application\n    ├── EventHub.Domain\n    ├── EventHub.Domain.Shared\n    ├── EventHub.Infrastructure\n    ├── EventHub.Infrastructure.Persistence\n    ├── EventHub.Infrastructure.SignalR\n    └── EventHub.Presentation\n```\n\n### Explanation of Folders\n\n- **deploy/**: Contains Docker-related configuration files, including Docker Compose files for development and production environments.\n- **Solution Items/**: Stores solution-level configuration files, CI/CD configuration (`.gitlab-ci.yml`), and other supporting documents such as the README and license.\n- **source/**: Contains the main source code, organized by Clean Architecture principles:\n    - **EventHub.Application**: Application layer with use cases and business rules.\n    - **EventHub.Domain**: Domain layer with core business logic and entities.\n    - **EventHub.Domain.Shared**: Shared utilities and functionality, enhancing reusability.\n    - **EventHub.Infrastructure**: Infrastructure layer for external services.\n    - **EventHub.Infrastructure.Persistence**: Handles database communications.\n    - **EventHub.Infrastructure.SignalR**: Manages real-time communication using SignalR.\n    - **EventHub.Presentation**: Presentation layer for API endpoints and UI components.\n\n---\n\n## Applied Architecture and Design Patterns\n\n### Clean Architecture\n\nClean Architecture ensures a clear separation of concerns, fostering maintainable and scalable code:\n\n- **Domain Layer** (`EventHub.Domain`): Encapsulates core business logic and entities.\n- **Application Layer** (`EventHub.Application`): Contains use cases and application-specific business rules.\n- **Infrastructure Layer** (`EventHub.Infrastructure`): Manages external services, including database interactions and third-party integrations.\n- **Presentation Layer** (`EventHub.Presentation`): Handles user interface and API endpoints.\n- **Persistence Module** (`EventHub.Infrastructure.Persistence`): A specialized component within Infrastructure to manage database communications.\n- **Shared Module** (`EventHub.Domain.Shared`): Contains common utilities and shared functionality, improving reusability across layers without violating Clean Architecture principles.\n- **SignalR Module** (`EventHub.Infrastructure.SignalR`): Manages real-time communication using SignalR for WebSocket-based interactions.\n\n### Repository Pattern\n\nFacilitates an abstraction layer for data access:\n\n- Includes both standard and cached repositories, utilizing Redis for enhanced performance.\n\n### Unit of Work Pattern\n\nEnsures consistent and atomic database operations:\n\n- Combines multiple repositories within a single `UnitOfWork` class for transaction management.\n\n### Domain-Driven Design (DDD)\n\nFocuses on modeling the core business domain:\n\n- Aligns software design with business requirements to improve quality and maintainability.\n\n### CQRS Pattern\n\nSeparates command (write) and query (read) responsibilities:\n\n- A single database is used for both operations in this implementation.\n\n### Transactional Outbox Pattern \u0026 Idempotency\n\nEnsures reliable and consistent event sourcing:\n\n- Prevents duplicate events and ensures successful message delivery using Hangfire for email notifications.\n\n### Additional Design Patterns\n\n- **Decorator Pattern**: Enhances object functionality dynamically.\n- **Factory Pattern**: Centralizes object creation logic.\n- **Singleton Pattern**: Managed through .NET Dependency Injection.\n\n---\n\n## Continuous Integration and Deployment (CI/CD)\n\nThe project includes a CI/CD pipeline configured for deployment on Azure App Service. Use it as a reference for deploying your applications to Azure.\n\n---\n\n## How to Run the Application (Development Environment)\n\n### Step 1: Run Docker Compose\n\nRun the following command to start the required services. Ensure the correct path for the Docker Compose file based on your current working directory:\n\n```sh\ndocker-compose -f deploy/docker-compose.development.yml -p eventhub up -d --remove-orphans\n```\n\n### Step 2: Run Migrations (First-Time Setup)\n\nRun migrations to set up the database schema. See the \"Run Migrations\" section for details.\n\n### Step 3: Start the Application\n\n- **HTTP (Development Environment):** Starts the application with the Development configuration.\n- **HTTPS (Production Environment):** Starts the application with the Production configuration.\n\n---\n\n## Run Migrations\n\nEnsure you are in the `/source` directory before running these commands.\n\n### Add a New Migration\n\nReplace `\u003cyour-migration-name\u003e` with your desired migration name:\n\n```sh\ndotnet ef migrations add \u003cyour-migration-name\u003e --startup-project EventHub.Presentation --project EventHub.Infrastructure.Persistence --output-dir ../EventHub.Infrastructure.Persistence/Migrations\n```\n\n### Apply Migrations\n\nRun the following command to update the database schema after adding a new migration:\n\n```sh\ndotnet ef database update --startup-project EventHub.Presentation --project EventHub.Infrastructure.Persistence\n```\n\n---\n\nBy adhering to robust design principles and patterns, EventHub delivers a reliable and scalable solution for event management. Explore, contribute, and make the most of this project!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranvuongduy2003%2Feventhub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftranvuongduy2003%2Feventhub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftranvuongduy2003%2Feventhub/lists"}